Merge "Clear binder identity in callback of IMS IPC interfaces" am: 67e10842b2 am: 3d97b23aa1 am: e5026e2532

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1771685

Change-Id: I3d2a499fcfd72c61605ba345b0b576ea7896370f
This commit is contained in:
Rambo Wang
2021-07-20 01:02:06 +00:00
committed by Automerger Merge Worker
3 changed files with 42 additions and 7 deletions

View File

@@ -13965,7 +13965,12 @@ public class TelephonyManager {
IBooleanConsumer aidlConsumer = callback == null ? null : new IBooleanConsumer.Stub() {
@Override
public void accept(boolean result) {
executor.execute(() -> callback.accept(result));
final long identity = Binder.clearCallingIdentity();
try {
executor.execute(() -> callback.accept(result));
} finally {
Binder.restoreCallingIdentity(identity);
}
}
};

View File

@@ -445,7 +445,12 @@ public class ImsMmTelManager implements RegistrationManager {
iTelephony.getImsMmTelRegistrationState(mSubId, new IIntegerConsumer.Stub() {
@Override
public void accept(int result) {
executor.execute(() -> stateCallback.accept(result));
final long identity = Binder.clearCallingIdentity();
try {
executor.execute(() -> stateCallback.accept(result));
} finally {
Binder.restoreCallingIdentity(identity);
}
}
});
} catch (ServiceSpecificException | RemoteException e) {
@@ -487,7 +492,12 @@ public class ImsMmTelManager implements RegistrationManager {
new IIntegerConsumer.Stub() {
@Override
public void accept(int result) {
executor.execute(() -> transportTypeCallback.accept(result));
final long identity = Binder.clearCallingIdentity();
try {
executor.execute(() -> transportTypeCallback.accept(result));
} finally {
Binder.restoreCallingIdentity(identity);
}
}
});
} catch (ServiceSpecificException | RemoteException e) {
@@ -807,7 +817,12 @@ public class ImsMmTelManager implements RegistrationManager {
iTelephony.isMmTelCapabilitySupported(mSubId, new IIntegerConsumer.Stub() {
@Override
public void accept(int result) {
executor.execute(() -> callback.accept(result == 1));
final long identity = Binder.clearCallingIdentity();
try {
executor.execute(() -> callback.accept(result == 1));
} finally {
Binder.restoreCallingIdentity(identity);
}
}
}, capability, transportType);
} catch (ServiceSpecificException sse) {
@@ -1452,7 +1467,12 @@ public class ImsMmTelManager implements RegistrationManager {
iTelephony.getImsMmTelFeatureState(mSubId, new IIntegerConsumer.Stub() {
@Override
public void accept(int result) {
executor.execute(() -> callback.accept(result));
final long identity = Binder.clearCallingIdentity();
try {
executor.execute(() -> callback.accept(result));
} finally {
Binder.restoreCallingIdentity(identity);
}
}
});
} catch (ServiceSpecificException sse) {

View File

@@ -299,7 +299,12 @@ public class ImsRcsManager {
imsRcsController.getImsRcsRegistrationState(mSubId, new IIntegerConsumer.Stub() {
@Override
public void accept(int result) {
executor.execute(() -> stateCallback.accept(result));
final long identity = Binder.clearCallingIdentity();
try {
executor.execute(() -> stateCallback.accept(result));
} finally {
Binder.restoreCallingIdentity(identity);
}
}
});
} catch (ServiceSpecificException | RemoteException e) {
@@ -345,7 +350,12 @@ public class ImsRcsManager {
new IIntegerConsumer.Stub() {
@Override
public void accept(int result) {
executor.execute(() -> transportTypeCallback.accept(result));
final long identity = Binder.clearCallingIdentity();
try {
executor.execute(() -> transportTypeCallback.accept(result));
} finally {
Binder.restoreCallingIdentity(identity);
}
}
});
} catch (ServiceSpecificException | RemoteException e) {