Merge "Rebind TISBinder if service killed during connection" into sc-v2-dev am: 25a1e0b913

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/15828615

Change-Id: I06c2a96eaf0372f99ef2f833da41a9615ee899a7
This commit is contained in:
TreeHugger Robot
2021-09-15 00:34:37 +00:00
committed by Automerger Merge Worker

View File

@@ -124,6 +124,15 @@ public abstract class BaseQuickstepLauncher extends Launcher
private final ServiceConnection mTisBinderConnection = new ServiceConnection() {
@Override
public void onServiceConnected(ComponentName componentName, IBinder iBinder) {
if (!(iBinder instanceof TISBinder)) {
// Seems like there can be a race condition when user unlocks, which kills the TIS
// process and re-starts it. I guess in the meantime service can be connected to
// a killed TIS? Either way, unbind and try to re-connect in that case.
unbindService(mTisBinderConnection);
mHandler.postDelayed(mConnectionRunnable, BACKOFF_MILLIS);
return;
}
mTaskbarManager = ((TISBinder) iBinder).getTaskbarManager();
mTaskbarManager.setLauncher(BaseQuickstepLauncher.this);