Merge "[Status Bar] Fix NPE in #dumpBarTransitions." into sc-dev am: ae8d7cff27
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14997041 Change-Id: Ifab95650a37f63ac9058ed59b2c252bdeb2e4951
This commit is contained in:
@@ -2778,9 +2778,14 @@ public class StatusBar extends SystemUI implements DemoMode,
|
||||
+ String.valueOf(CameraIntents.getOverrideCameraPackage(mContext)));
|
||||
}
|
||||
|
||||
public static void dumpBarTransitions(PrintWriter pw, String var, BarTransitions transitions) {
|
||||
public static void dumpBarTransitions(
|
||||
PrintWriter pw, String var, @Nullable BarTransitions transitions) {
|
||||
pw.print(" "); pw.print(var); pw.print(".BarTransitions.mMode=");
|
||||
pw.println(BarTransitions.modeToString(transitions.getMode()));
|
||||
if (transitions != null) {
|
||||
pw.println(BarTransitions.modeToString(transitions.getMode()));
|
||||
} else {
|
||||
pw.println("Unknown");
|
||||
}
|
||||
}
|
||||
|
||||
public void createAndAddWindows(@Nullable RegisterStatusBarResult result) {
|
||||
|
||||
@@ -776,6 +776,12 @@ public class StatusBarTest extends SysuiTestCase {
|
||||
mStatusBar.dump(null, new PrintWriter(new ByteArrayOutputStream()), null);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDumpBarTransitions_DoesNotCrash() {
|
||||
StatusBar.dumpBarTransitions(
|
||||
new PrintWriter(new ByteArrayOutputStream()), "var", /* transitions= */ null);
|
||||
}
|
||||
|
||||
@Test
|
||||
@RunWithLooper(setAsMainLooper = true)
|
||||
public void testUpdateKeyguardState_DoesNotCrash() {
|
||||
|
||||
Reference in New Issue
Block a user