Merge "Clear binder calling identity before calling callback" into sc-dev

This commit is contained in:
Benedict Wong
2021-07-20 17:50:24 +00:00
committed by Android (Google) Code Review

View File

@@ -111,7 +111,12 @@ public class TelephonyRegistryManager {
IOnSubscriptionsChangedListener callback = new IOnSubscriptionsChangedListener.Stub() {
@Override
public void onSubscriptionsChanged () {
executor.execute(() -> listener.onSubscriptionsChanged());
final long identity = Binder.clearCallingIdentity();
try {
executor.execute(() -> listener.onSubscriptionsChanged());
} finally {
Binder.restoreCallingIdentity(identity);
}
}
};
mSubscriptionChangedListenerMap.put(listener, callback);