summaryrefslogtreecommitdiff
path: root/core/java/android
diff options
context:
space:
mode:
authorRafael Higuera Silva <rafahs@google.com>2021-12-22 20:57:00 +0000
committerRafael Higuera Silva <rafahs@google.com>2022-02-23 23:32:40 +0000
commit4467a524cd44944dedea2bd367cd1572872052e1 (patch)
tree5f21065dc7337e6bec1f216ab513f1ce4ec8f1e7 /core/java/android
parent7f9d05c6d240c7eb1eba10a96936f423c0cf50ed (diff)
Adding renounce permissions logic to ipc calls.
These changes make telephony APIs that returns ServiceState honor the renouncedPermissions set by caller's context i.e. ContextParams#setRenouncedPermissions(). Test: make, manual, cts Bug: 205326907 Change-Id: I49d5cc83891dc80d9440fa4a2711de0fcf51d892
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/telephony/TelephonyRegistryManager.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/core/java/android/telephony/TelephonyRegistryManager.java b/core/java/android/telephony/TelephonyRegistryManager.java
index 542de3fad8b0..c1fcd664f6fa 100644
--- a/core/java/android/telephony/TelephonyRegistryManager.java
+++ b/core/java/android/telephony/TelephonyRegistryManager.java
@@ -239,8 +239,10 @@ public class TelephonyRegistryManager {
* @param events Events
* @param notifyNow Whether to notify instantly
*/
- public void listenFromListener(int subId, @NonNull String pkg, @NonNull String featureId,
- @NonNull PhoneStateListener listener, @NonNull int events, boolean notifyNow) {
+ public void listenFromListener(int subId, @NonNull boolean renounceFineLocationAccess,
+ @NonNull boolean renounceCoarseLocationAccess, @NonNull String pkg,
+ @NonNull String featureId, @NonNull PhoneStateListener listener,
+ @NonNull int events, boolean notifyNow) {
if (listener == null) {
throw new IllegalStateException("telephony service is null.");
}
@@ -257,8 +259,8 @@ public class TelephonyRegistryManager {
} else if (listener.mSubId != null) {
subId = listener.mSubId;
}
- sRegistry.listenWithEventList(false, false, subId, pkg, featureId,
- listener.callback, eventsList, notifyNow);
+ sRegistry.listenWithEventList(renounceFineLocationAccess, renounceCoarseLocationAccess,
+ subId, pkg, featureId, listener.callback, eventsList, notifyNow);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}