diff --git a/quickstep/src/com/android/quickstep/TouchInteractionService.java b/quickstep/src/com/android/quickstep/TouchInteractionService.java index efd9a5608f..f7fb18b542 100644 --- a/quickstep/src/com/android/quickstep/TouchInteractionService.java +++ b/quickstep/src/com/android/quickstep/TouchInteractionService.java @@ -47,7 +47,9 @@ import android.content.res.Configuration; import android.graphics.Region; import android.os.Bundle; import android.os.IBinder; +import android.os.IRemoteCallback; import android.os.Looper; +import android.os.RemoteException; import android.os.SystemClock; import android.util.Log; import android.view.Choreographer; @@ -385,6 +387,20 @@ public class TouchInteractionService extends Service { taskbarManager.onNavigationBarLumaSamplingEnabled(displayId, enable)); } + @Override + public void onUnbind(IRemoteCallback reply) { + // Run everything in the same main thread block to ensure the cleanup happens before + // sending the reply. + MAIN_EXECUTOR.execute(() -> { + executeForTaskbarManager(TaskbarManager::destroy); + try { + reply.sendResult(null); + } catch (RemoteException e) { + Log.w(TAG, "onUnbind: Failed to reply to OverviewProxyService", e); + } + }); + } + private void executeForTouchInteractionService( @NonNull Consumer tisConsumer) { TouchInteractionService tis = mTis.get();