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

Commit 683bb56f authored by gang.huang's avatar gang.huang
Browse files

Ensure ActivityManagerInternal instance is non-null

Pulling up the initialization to avoid having earlier code
run into uses of mActivityManagerInternal.

Bug: 283724099

Test: Manual.
Change-Id: I910993401915bc67af73bc7ad3e68a6a76df8026
parent 61dae344
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1882,6 +1882,7 @@ public class AlarmManagerService extends SystemService {
        mActivityOptsRestrictBal.setPendingIntentBackgroundActivityLaunchAllowed(false);
        mBroadcastOptsRestrictBal.setPendingIntentBackgroundActivityLaunchAllowed(false);
        mMetricsHelper = new MetricsHelper(getContext(), mLock);
        mActivityManagerInternal = LocalServices.getService(ActivityManagerInternal.class);

        mListenerDeathRecipient = new IBinder.DeathRecipient() {
            @Override
@@ -1983,7 +1984,6 @@ public class AlarmManagerService extends SystemService {
                Slog.w(TAG, "Failed to open alarm driver. Falling back to a handler.");
            }
        }
        mActivityManagerInternal = LocalServices.getService(ActivityManagerInternal.class);
        publishLocalService(AlarmManagerInternal.class, new LocalService());
        publishBinderService(Context.ALARM_SERVICE, mService);
    }