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

Commit cac002dd authored by Sunny Goyal's avatar Sunny Goyal
Browse files

Do not wait until bindComplete for setting NotificationListener

Notification badges are applied only to the icons which are already
bound. So even if some notification changes in the middle of binding
it will get applied properly.

Change-Id: Icc77981688206b61ea4b9c9d311dff2c72fa8f18
parent 6c870f29
Loading
Loading
Loading
Loading
+1 −14
Original line number Diff line number Diff line
@@ -240,8 +240,6 @@ public class Launcher extends BaseActivity

    @Thunk boolean mWorkspaceLoading = true;

    private boolean mPaused = true;

    private OnResumeCallback mOnResumeCallback;

    private ViewOnDrawExecutor mPendingExecutor;
@@ -336,11 +334,6 @@ public class Launcher extends BaseActivity
        mAppWidgetHost = new LauncherAppWidgetHost(this);
        mAppWidgetHost.startListening();

        // If we are getting an onCreate, we can actually preempt onResume and unset mPaused here,
        // this also ensures that any synchronous binding below doesn't re-trigger another
        // LauncherModel load.
        mPaused = false;

        mLauncherView = LayoutInflater.from(this).inflate(R.layout.launcher, null);

        setupViews();
@@ -780,10 +773,7 @@ public class Launcher extends BaseActivity
            mLauncherCallbacks.onStart();
        }
        mAppWidgetHost.setListenIfResumed(true);

        if (!isWorkspaceLoading()) {
        NotificationListener.setNotificationsChangedListener(mPopupDataProvider);
        }

        if (mShouldFadeInScrim && mDragLayer.getBackground() != null) {
            if (mScrimAnimator != null) {
@@ -813,7 +803,6 @@ public class Launcher extends BaseActivity

        mAppLaunchSuccess = false;
        getUserEventDispatcher().resetElapsedSessionMillis();
        mPaused = false;
        setOnResumeCallback(null);
        // Process any items that were added while Launcher was away.
        InstallShortcutReceiver.disableAndFlushInstallQueue(
@@ -836,7 +825,6 @@ public class Launcher extends BaseActivity
        InstallShortcutReceiver.enableInstallQueue(InstallShortcutReceiver.FLAG_ACTIVITY_PAUSED);

        super.onPause();
        mPaused = true;
        mDragController.cancelDrag();
        mDragController.resetLastGestureUpTime();

@@ -2553,7 +2541,6 @@ public class Launcher extends BaseActivity
        InstallShortcutReceiver.disableAndFlushInstallQueue(
                InstallShortcutReceiver.FLAG_LOADER_RUNNING, this);

        NotificationListener.setNotificationsChangedListener(mPopupDataProvider);
        TraceHelper.endSection("finishBindingItems");
    }