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

Commit a6db4ab6 authored by Adam Lesinski's avatar Adam Lesinski
Browse files

Fix issue with early service start

NotificationListener services would start too early
and crash due to system_server not being ready.

Bug: 13439345
Change-Id: I86ee93b50d016bfa0119e21a8cde8635212b16a4
parent c01e1aeb
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -1195,7 +1195,6 @@ public class NotificationManagerService extends SystemService {
        getContext().registerReceiver(mIntentReceiver, sdFilter);

        mSettingsObserver = new SettingsObserver(mHandler);
        mSettingsObserver.observe();

        // spin up NotificationScorers
        String[] notificationScorerNames = resources.getStringArray(
@@ -1250,8 +1249,10 @@ public class NotificationManagerService extends SystemService {
            // Grab our optional AudioService
            mAudioManager = (AudioManager) getContext().getSystemService(Context.AUDIO_SERVICE);

            // make sure our listener services are properly bound
            rebindListenerServices();
        } else if (phase == SystemService.PHASE_THIRD_PARTY_APPS_CAN_START) {
            // This observer will force an update when observe is called, causing us to
            // bind to listener services.
            mSettingsObserver.observe();
        }
    }

+1 −3
Original line number Diff line number Diff line
@@ -233,9 +233,7 @@ public class UserManagerService extends IUserManager.Stub {
    }

    void systemReady() {
        final Context context = ActivityThread.systemMain().getSystemContext();
        mUserPackageMonitor.register(context,
                null, UserHandle.ALL, false);
        mUserPackageMonitor.register(mContext, null, UserHandle.ALL, false);
        userForeground(UserHandle.USER_OWNER);
    }