Skip to content

Commit c03b1ba

Browse files
author
Aman Choudhary
committed
Apply spotless and fix build issue
1 parent 5e7a210 commit c03b1ba

File tree

3 files changed

+39
-8
lines changed

3 files changed

+39
-8
lines changed

misc/src/main/java/com/example/snippets/InspectorModuleJavaSnippets.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/*
2+
* Copyright 2025 The Android Open Source Project
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
package com.example.snippets;
218

319
import android.content.Context;

misc/src/main/java/com/example/snippets/InspectorModuleKotlinSnippets.kt

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/*
2+
* Copyright 2025 The Android Open Source Project
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
package com.example.snippets
218

319
import android.content.Context
@@ -11,9 +27,9 @@ import androidx.media3.exoplayer.MediaExtractorCompat
1127
import androidx.media3.exoplayer.source.TrackGroupArray
1228
import androidx.media3.inspector.FrameExtractor
1329
import androidx.media3.inspector.MetadataRetriever
14-
import kotlinx.coroutines.guava.await
1530
import java.io.IOException
1631
import java.nio.ByteBuffer
32+
import kotlinx.coroutines.guava.await
1733

1834
const val TAG = "InspectorModuleLog"
1935

@@ -58,7 +74,7 @@ class InspectorModuleKotlinSnippets {
5874
// [END android_media3_inspector_FrameExtractor_kotlin]
5975

6076
// [START android_media3_inspector_MediaExtractorCompat_kotlin]
61-
fun extractSamples(context: Context, mediaPath: String){
77+
fun extractSamples(context: Context, mediaPath: String) {
6278
val extractor = MediaExtractorCompat(context)
6379
try {
6480
// 1. Setup the extractor
@@ -97,5 +113,4 @@ class InspectorModuleKotlinSnippets {
97113
Log.d(TAG, "Timeline: $timeline us")
98114
Log.d(TAG, "Duration: $durationUs us")
99115
}
100-
101-
}
116+
}

misc/src/main/java/com/example/snippets/PreloadManagerKotlinSnippets.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class MyTargetPreloadStatusControl(
3737
currentPlayingIndex: Int = C.INDEX_UNSET
3838
) : TargetPreloadStatusControl<Int, DefaultPreloadManager.PreloadStatus> {
3939

40-
override fun getTargetPreloadStatus(index: Int): DefaultPreloadManager.PreloadStatus? {
40+
override fun getTargetPreloadStatus(index: Int): DefaultPreloadManager.PreloadStatus {
4141
if (index - currentPlayingIndex == 1) { // next track
4242
// return a PreloadStatus that is labelled by STAGE_SPECIFIED_RANGE_LOADED and
4343
// suggest loading 3000ms from the default start position
@@ -48,12 +48,12 @@ class MyTargetPreloadStatusControl(
4848
return DefaultPreloadManager.PreloadStatus.specifiedRangeLoaded(3000L)
4949
} else if (abs(index - currentPlayingIndex) == 2) {
5050
// return a PreloadStatus that is labelled by STAGE_TRACKS_SELECTED
51-
return DefaultPreloadManager.PreloadStatus.TRACKS_SELECTED
51+
return DefaultPreloadManager.PreloadStatus.PRELOAD_STATUS_TRACKS_SELECTED
5252
} else if (abs(index - currentPlayingIndex) <= 4) {
5353
// return a PreloadStatus that is labelled by STAGE_SOURCE_PREPARED
54-
return DefaultPreloadManager.PreloadStatus.SOURCE_PREPARED
54+
return DefaultPreloadManager.PreloadStatus.PRELOAD_STATUS_SOURCE_PREPARED
5555
}
56-
return null
56+
return DefaultPreloadManager.PreloadStatus.PRELOAD_STATUS_NOT_PRELOADED
5757
}
5858
}
5959
// [END android_defaultpreloadmanager_MyTargetPreloadStatusControl]

0 commit comments

Comments
 (0)