Merge "Fix Wear OS boot issue."
This commit is contained in:
committed by
Android (Google) Code Review
commit
bc1cd9c1f5
@@ -272,7 +272,6 @@ public class StatusBarManagerService extends IStatusBarService.Stub implements D
|
||||
mContext = context;
|
||||
|
||||
LocalServices.addService(StatusBarManagerInternal.class, mInternalService);
|
||||
LocalServices.addService(GlobalActionsProvider.class, mGlobalActionsProvider);
|
||||
|
||||
// We always have a default display.
|
||||
final UiState state = new UiState();
|
||||
@@ -289,6 +288,17 @@ public class StatusBarManagerService extends IStatusBarService.Stub implements D
|
||||
mSessionMonitor = new SessionMonitor(mContext);
|
||||
}
|
||||
|
||||
/**
|
||||
* Publish the {@link GlobalActionsProvider}.
|
||||
*/
|
||||
// TODO(b/259420401): investigate if we can extract GlobalActionsProvider to its own system
|
||||
// service.
|
||||
public void publishGlobalActionsProvider() {
|
||||
if (LocalServices.getService(GlobalActionsProvider.class) == null) {
|
||||
LocalServices.addService(GlobalActionsProvider.class, mGlobalActionsProvider);
|
||||
}
|
||||
}
|
||||
|
||||
private IOverlayManager getOverlayManager() {
|
||||
// No need to synchronize; worst-case scenario it will be fetched twice.
|
||||
if (mOverlayManager == null) {
|
||||
|
||||
@@ -1798,17 +1798,18 @@ public final class SystemServer implements Dumpable {
|
||||
dpms = mSystemServiceManager.startService(DevicePolicyManagerService.Lifecycle.class);
|
||||
t.traceEnd();
|
||||
|
||||
if (!isWatch) {
|
||||
t.traceBegin("StartStatusBarManagerService");
|
||||
try {
|
||||
statusBar = new StatusBarManagerService(context);
|
||||
ServiceManager.addService(Context.STATUS_BAR_SERVICE, statusBar, false,
|
||||
DUMP_FLAG_PRIORITY_NORMAL | DUMP_FLAG_PROTO);
|
||||
} catch (Throwable e) {
|
||||
reportWtf("starting StatusBarManagerService", e);
|
||||
t.traceBegin("StartStatusBarManagerService");
|
||||
try {
|
||||
statusBar = new StatusBarManagerService(context);
|
||||
if (!isWatch) {
|
||||
statusBar.publishGlobalActionsProvider();
|
||||
}
|
||||
t.traceEnd();
|
||||
ServiceManager.addService(Context.STATUS_BAR_SERVICE, statusBar, false,
|
||||
DUMP_FLAG_PRIORITY_NORMAL | DUMP_FLAG_PROTO);
|
||||
} catch (Throwable e) {
|
||||
reportWtf("starting StatusBarManagerService", e);
|
||||
}
|
||||
t.traceEnd();
|
||||
|
||||
if (deviceHasConfigString(context,
|
||||
R.string.config_defaultMusicRecognitionService)) {
|
||||
|
||||
@@ -44,6 +44,7 @@ import android.content.ComponentName;
|
||||
import android.content.Intent;
|
||||
import android.content.om.IOverlayManager;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.pm.PackageManagerInternal;
|
||||
import android.content.pm.ResolveInfo;
|
||||
@@ -669,7 +670,10 @@ public class StatusBarManagerServiceTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSetNavBarMode_setsModeKids() throws RemoteException {
|
||||
public void testSetNavBarMode_setsModeKids() throws Exception {
|
||||
mContext.setMockPackageManager(mPackageManager);
|
||||
when(mPackageManager.getPackageInfo(anyString(),
|
||||
any(PackageManager.PackageInfoFlags.class))).thenReturn(new PackageInfo());
|
||||
int navBarModeKids = StatusBarManager.NAV_BAR_MODE_KIDS;
|
||||
|
||||
mStatusBarManagerService.setNavBarMode(navBarModeKids);
|
||||
|
||||
Reference in New Issue
Block a user