Fix SmartspaceService callback comparison.

We should use binder references when comparing two IPC callbacks.

Test: Inject a test code into LocscreenSmartspaceController#reloadSmartspace() that register and unregister a test smartspace listener. Verify that the listeners is
get invoked without the fix and is not get invoked with the fix.
Change-Id: I3229c6496cde43ba1df65412857eb36b47b525c4
This commit is contained in:
Andrey Epin
2023-01-12 19:56:56 -08:00
parent 027b3b377f
commit 86f01c4cd9

View File

@@ -302,7 +302,7 @@ public abstract class SmartspaceService extends Service {
Slog.e(TAG, "Callback is null, likely the binder has died.");
return false;
}
return mCallback.equals(callback);
return mCallback.asBinder().equals(callback.asBinder());
}
@Override