Merge "Add onUnbind from OverviewProxyService, and destroy taskbar" into main

This commit is contained in:
Behnam Heydarshahi
2025-01-15 08:28:03 -08:00
committed by Android (Google) Code Review
@@ -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<TouchInteractionService> tisConsumer) {
TouchInteractionService tis = mTis.get();