Skip to content

Commit 09cf3eb

Browse files
committed
Disabling some "unused" warnings
I'd submitted code that's never actually used in the android/snippets apps. Ideally we'd include it in an app, but in the meantime, disabling the "unused" warnings. Also removed one line (outside of a published-on-DAC code block) that turned out not to be needed. No changes to the code that's included on DAC, and the code still compiles. (I also see some areas where the actual code snippet is generating warnings, but I'll resolve those in separate PRs that can be reviewed by the appropriate SMEs for those docs.)
1 parent e2de07a commit 09cf3eb

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import java.lang.Math.abs
3030
// constants to make the code snippets work
3131
const val currentPlayingIndex = 10
3232

33+
@Suppress("UNUSED_PARAMETER")
3334
@UnstableApi
3435
// [START android_defaultpreloadmanager_MyTargetPreloadStatusControl]
3536
class MyTargetPreloadStatusControl(
@@ -57,6 +58,7 @@ class MyTargetPreloadStatusControl(
5758
}
5859
// [END android_defaultpreloadmanager_MyTargetPreloadStatusControl]
5960

61+
@Suppress("UNUSED_PARAMETER")
6062
class PreloadManagerSnippetsKotlin {
6163

6264
class PreloadSnippetsActivity : AppCompatActivity() {
@@ -73,8 +75,6 @@ class PreloadManagerSnippetsKotlin {
7375
val preloadManager = preloadManagerBuilder.build()
7476
// [END android_defaultpreloadmanager_createPLM]
7577

76-
val player = preloadManagerBuilder.buildExoPlayer()
77-
7878
// [START android_defaultpreloadmanager_addMedia]
7979
val initialMediaItems = pullMediaItemsFromService(/* count= */ 20)
8080
for (index in 0 until initialMediaItems.size) {

misc/src/main/java/com/example/snippets/backgroundwork/WakeLockSnippetsJava.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
import androidx.annotation.Nullable;
88

9+
@SuppressWarnings("Unused")
910
public class WakeLockSnippetsJava extends Activity {
1011

1112
PowerManager.WakeLock wakeLock;
@@ -23,6 +24,7 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
2324
super.onCreate(savedInstanceState);
2425
}
2526

27+
@SuppressWarnings("UNUSED")
2628
// [START android_backgroundwork_wakelock_release_java]
2729
void doSomethingAndRelease() throws MyException {
2830
try {

misc/src/main/java/com/example/snippets/backgroundwork/WakeLockSnippetsKotlin.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import android.os.Bundle
2222
import android.os.PowerManager
2323

2424
// Snippets for doc page go here
25+
@Suppress("UNUSED_PARAMETER")
2526
class WakeLockSnippetsKotlin : Activity() {
2627

2728
// [START android_backgroundwork_wakelock_create_kotlin]

0 commit comments

Comments
 (0)