From e137fe5186d42a3faddac3474e57174f2e8a33bf Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Fri, 11 Nov 2022 20:05:39 +0000 Subject: Fix CompileTimeConstant ErrorProne findings in SystemUI Fixes: frameworks/base/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java:5469: error: [CompileTimeConstant] Non-compile-time constant expression passed to parameter with @CompileTimeConstant type annotation. frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java:3720: error: [NonFinalCompileTimeConstant] @CompileTimeConstant parameters should be final or effectively final frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java:3724: error: [CompileTimeConstant] Non-compile-time constant expression passed to parameter with @CompileTimeConstant type annotation. Did you mean to make 's' final? Bug: 255286870 Bug: 258754271 Bug: 256019562 Test: m RUN_ERROR_PRONE=true javac-check lint-check Change-Id: Ifaa3407784c11d0536104b616264bca949672918 --- .../android/systemui/shade/NotificationPanelViewController.java | 7 +++++-- .../notification/stack/NotificationStackScrollLayout.java | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java index 32c8f3bba6c1..d6b30db99d4b 100644 --- a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java +++ b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java @@ -5465,8 +5465,11 @@ public final class NotificationPanelViewController implements Dumpable { if (!animatingUnlockedShadeToKeyguard) { // Only make the status bar visible if we're not animating the screen off, since // we only want to be showing the clock/notifications during the animation. - mShadeLog.v("Updating keyguard status bar state to " - + (keyguardShowing ? "visible" : "invisible")); + if (keyguardShowing) { + mShadeLog.v("Updating keyguard status bar state to visible"); + } else { + mShadeLog.v("Updating keyguard status bar state to invisible"); + } mKeyguardStatusBarViewController.updateViewState( /* alpha= */ 1f, keyguardShowing ? View.VISIBLE : View.INVISIBLE); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java index 2c3330e12229..42522fff6a3f 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java @@ -3717,7 +3717,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable } } - private void debugLog(@CompileTimeConstant String s) { + private void debugLog(@CompileTimeConstant final String s) { if (mLogger == null) { return; } -- cgit v1.2.3-59-g8ed1b