[Status Bar] Fix NPE in #dumpBarTransitions.
Test: atest Fixes: 190927484 Change-Id: I7b0962b1240fde81c256f93a9aec479205f47101
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