From 21380738ea452772db76b08823de6814c292902b Mon Sep 17 00:00:00 2001 From: Jason Monk Date: Thu, 19 Jan 2017 15:13:31 -0500 Subject: [PATCH] Fix up the tests. They got broken because the pre-submits were broken :( Test: runtest systemui Change-Id: I45d5b2d3e8614cd1d3fa7eb24da57c26588120ff --- .../android/systemui/statusbar/phone/PhoneStatusBar.java | 8 ++++++-- packages/SystemUI/tests/AndroidManifest.xml | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java index 9f12ca7fcd9f2..046928248d396 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -74,6 +74,7 @@ import android.os.Bundle; import android.os.Handler; import android.os.HandlerThread; import android.os.IBinder; +import android.os.Looper; import android.os.Message; import android.os.PowerManager; import android.os.Process; @@ -126,6 +127,7 @@ import com.android.systemui.EventLogTags; import com.android.systemui.Interpolators; import com.android.systemui.Prefs; import com.android.systemui.R; +import com.android.systemui.SysUiServiceProvider; import com.android.systemui.SystemUIApplication; import com.android.systemui.SystemUIFactory; import com.android.systemui.classifier.FalsingLog; @@ -1029,8 +1031,10 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, } public static Handler getTimeTickHandler(Context context) { - return ((SystemUIApplication) context.getApplicationContext()) - .getComponent(PhoneStatusBar.class).getTimeTickHandler(); + PhoneStatusBar statusBar = ((SysUiServiceProvider) context.getApplicationContext()) + .getComponent(PhoneStatusBar.class); + return statusBar != null ? statusBar.getTimeTickHandler() : + new Handler(Looper.getMainLooper()); } protected void createNavigationBar() { diff --git a/packages/SystemUI/tests/AndroidManifest.xml b/packages/SystemUI/tests/AndroidManifest.xml index dec8ba6c05db8..f2d6d89d259c9 100644 --- a/packages/SystemUI/tests/AndroidManifest.xml +++ b/packages/SystemUI/tests/AndroidManifest.xml @@ -28,6 +28,7 @@ +