Merge "Clear binder identity in callback of IMS IPC interfaces" am: 67e10842b2
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1771685 Change-Id: I80edbe7adc7d6b4eae5ba77e05656f130888d0dc
This commit is contained in:
@@ -13425,7 +13425,12 @@ public class TelephonyManager {
|
|||||||
IBooleanConsumer aidlConsumer = callback == null ? null : new IBooleanConsumer.Stub() {
|
IBooleanConsumer aidlConsumer = callback == null ? null : new IBooleanConsumer.Stub() {
|
||||||
@Override
|
@Override
|
||||||
public void accept(boolean result) {
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -444,7 +444,12 @@ public class ImsMmTelManager implements RegistrationManager {
|
|||||||
iTelephony.getImsMmTelRegistrationState(mSubId, new IIntegerConsumer.Stub() {
|
iTelephony.getImsMmTelRegistrationState(mSubId, new IIntegerConsumer.Stub() {
|
||||||
@Override
|
@Override
|
||||||
public void accept(int result) {
|
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 (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
@@ -485,7 +490,12 @@ public class ImsMmTelManager implements RegistrationManager {
|
|||||||
new IIntegerConsumer.Stub() {
|
new IIntegerConsumer.Stub() {
|
||||||
@Override
|
@Override
|
||||||
public void accept(int result) {
|
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 (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
@@ -802,7 +812,12 @@ public class ImsMmTelManager implements RegistrationManager {
|
|||||||
iTelephony.isMmTelCapabilitySupported(mSubId, new IIntegerConsumer.Stub() {
|
iTelephony.isMmTelCapabilitySupported(mSubId, new IIntegerConsumer.Stub() {
|
||||||
@Override
|
@Override
|
||||||
public void accept(int result) {
|
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);
|
}, capability, transportType);
|
||||||
} catch (ServiceSpecificException sse) {
|
} catch (ServiceSpecificException sse) {
|
||||||
@@ -1348,7 +1363,12 @@ public class ImsMmTelManager implements RegistrationManager {
|
|||||||
iTelephony.getImsMmTelFeatureState(mSubId, new IIntegerConsumer.Stub() {
|
iTelephony.getImsMmTelFeatureState(mSubId, new IIntegerConsumer.Stub() {
|
||||||
@Override
|
@Override
|
||||||
public void accept(int result) {
|
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) {
|
} catch (ServiceSpecificException sse) {
|
||||||
|
|||||||
@@ -299,7 +299,12 @@ public class ImsRcsManager {
|
|||||||
imsRcsController.getImsRcsRegistrationState(mSubId, new IIntegerConsumer.Stub() {
|
imsRcsController.getImsRcsRegistrationState(mSubId, new IIntegerConsumer.Stub() {
|
||||||
@Override
|
@Override
|
||||||
public void accept(int result) {
|
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 (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
@@ -343,7 +348,12 @@ public class ImsRcsManager {
|
|||||||
new IIntegerConsumer.Stub() {
|
new IIntegerConsumer.Stub() {
|
||||||
@Override
|
@Override
|
||||||
public void accept(int result) {
|
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 (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user