Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bc1cd9c1 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix Wear OS boot issue."

parents 24920c20 33f5206c
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -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) {
+10 −9
Original line number Diff line number Diff line
@@ -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);
                if (!isWatch) {
                    statusBar.publishGlobalActionsProvider();
                }
                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)) {
+5 −1
Original line number Diff line number Diff line
@@ -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);