Rebind TISBinder if service killed during connection

Fixes: 198845519
Change-Id: I6af79af5591e2dca941ca4428c550169a178479c
This commit is contained in:
Vinit Nayak
2021-09-14 11:05:03 -07:00
parent 2d9741b832
commit c64c3cf488

View File

@@ -122,6 +122,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);