Loading packages/SystemUI/src/com/android/systemui/recents/OverviewProxyService.java +11 −8 Original line number Diff line number Diff line Loading @@ -140,7 +140,8 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis private final Handler mHandler; private final Lazy<NavigationBarController> mNavBarControllerLazy; private final NotificationShadeWindowController mStatusBarWinController; private final Runnable mConnectionRunnable = this::internalConnectToCurrentUser; private final Runnable mConnectionRunnable = () -> internalConnectToCurrentUser("runnable: startConnectionToCurrentUser"); private final ComponentName mRecentsComponentName; private final List<OverviewProxyListener> mConnectionCallbacks = new ArrayList<>(); private final Intent mQuickStepIntent; Loading Loading @@ -406,7 +407,7 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis // Failed to link to death (process may have died between binding and connecting), // just unbind the service for now and retry again Log.e(TAG_OPS, "Lost connection to launcher service", e); disconnectFromLauncherService(); disconnectFromLauncherService("Lost connection to launcher service"); retryConnectionWithBackoff(); return; } Loading Loading @@ -501,7 +502,7 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis @Override public void onUserChanged(int newUser, @NonNull Context userContext) { mConnectionBackoffAttempts = 0; internalConnectToCurrentUser(); internalConnectToCurrentUser("User changed"); } }; Loading Loading @@ -716,12 +717,12 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis if (mHandler.getLooper() != Looper.myLooper()) { mHandler.post(mConnectionRunnable); } else { internalConnectToCurrentUser(); internalConnectToCurrentUser("startConnectionToCurrentUser"); } } private void internalConnectToCurrentUser() { disconnectFromLauncherService(); private void internalConnectToCurrentUser(String reason) { disconnectFromLauncherService(reason); // If user has not setup yet or already connected, do not try to connect if (!isEnabled()) { Loading Loading @@ -783,7 +784,9 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis return mOverviewProxy; } private void disconnectFromLauncherService() { private void disconnectFromLauncherService(String disconnectReason) { Log.d(TAG_OPS, "disconnectFromLauncherService bound?: " + mBound + " currentProxy: " + mOverviewProxy + " disconnectReason: " + disconnectReason); if (mBound) { // Always unbind the service (ie. if called through onNullBinding or onBindingDied) mContext.unbindService(mOverviewServiceConnection); Loading Loading @@ -1047,6 +1050,6 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis mContext.unregisterReceiver(mLauncherStateChangedReceiver); mIsEnabled = false; mHandler.removeCallbacks(mConnectionRunnable); disconnectFromLauncherService(); disconnectFromLauncherService("Shutdown for test"); } } Loading
packages/SystemUI/src/com/android/systemui/recents/OverviewProxyService.java +11 −8 Original line number Diff line number Diff line Loading @@ -140,7 +140,8 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis private final Handler mHandler; private final Lazy<NavigationBarController> mNavBarControllerLazy; private final NotificationShadeWindowController mStatusBarWinController; private final Runnable mConnectionRunnable = this::internalConnectToCurrentUser; private final Runnable mConnectionRunnable = () -> internalConnectToCurrentUser("runnable: startConnectionToCurrentUser"); private final ComponentName mRecentsComponentName; private final List<OverviewProxyListener> mConnectionCallbacks = new ArrayList<>(); private final Intent mQuickStepIntent; Loading Loading @@ -406,7 +407,7 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis // Failed to link to death (process may have died between binding and connecting), // just unbind the service for now and retry again Log.e(TAG_OPS, "Lost connection to launcher service", e); disconnectFromLauncherService(); disconnectFromLauncherService("Lost connection to launcher service"); retryConnectionWithBackoff(); return; } Loading Loading @@ -501,7 +502,7 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis @Override public void onUserChanged(int newUser, @NonNull Context userContext) { mConnectionBackoffAttempts = 0; internalConnectToCurrentUser(); internalConnectToCurrentUser("User changed"); } }; Loading Loading @@ -716,12 +717,12 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis if (mHandler.getLooper() != Looper.myLooper()) { mHandler.post(mConnectionRunnable); } else { internalConnectToCurrentUser(); internalConnectToCurrentUser("startConnectionToCurrentUser"); } } private void internalConnectToCurrentUser() { disconnectFromLauncherService(); private void internalConnectToCurrentUser(String reason) { disconnectFromLauncherService(reason); // If user has not setup yet or already connected, do not try to connect if (!isEnabled()) { Loading Loading @@ -783,7 +784,9 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis return mOverviewProxy; } private void disconnectFromLauncherService() { private void disconnectFromLauncherService(String disconnectReason) { Log.d(TAG_OPS, "disconnectFromLauncherService bound?: " + mBound + " currentProxy: " + mOverviewProxy + " disconnectReason: " + disconnectReason); if (mBound) { // Always unbind the service (ie. if called through onNullBinding or onBindingDied) mContext.unbindService(mOverviewServiceConnection); Loading Loading @@ -1047,6 +1050,6 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis mContext.unregisterReceiver(mLauncherStateChangedReceiver); mIsEnabled = false; mHandler.removeCallbacks(mConnectionRunnable); disconnectFromLauncherService(); disconnectFromLauncherService("Shutdown for test"); } }