diff options
| author | TreeHugger Robot <treehugger-gerrit@google.com> | 2021-12-10 20:56:40 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2021-12-10 20:56:40 +0000 |
| commit | 48845b2b7e3a7f18eb275f2ed4bb495347e7a053 (patch) | |
| tree | c63e291da04197bf96ec972db457ee938a7cd890 /core/java/android | |
| parent | 6913cd525936adb24865c83d1e0f99ae2faaa936 (diff) | |
| parent | 1e7a4169ce148f474a67d6b4544bb9df2faf4dac (diff) | |
Merge "Allow renounce location permission"
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/telephony/TelephonyRegistryManager.java | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/core/java/android/telephony/TelephonyRegistryManager.java b/core/java/android/telephony/TelephonyRegistryManager.java index cb1cff9cda22..859fd804dea5 100644 --- a/core/java/android/telephony/TelephonyRegistryManager.java +++ b/core/java/android/telephony/TelephonyRegistryManager.java @@ -247,8 +247,8 @@ public class TelephonyRegistryManager { } else if (listener.mSubId != null) { subId = listener.mSubId; } - sRegistry.listenWithEventList( - subId, pkg, featureId, listener.callback, eventsList, notifyNow); + sRegistry.listenWithEventList(false, false, subId, pkg, featureId, + listener.callback, eventsList, notifyNow); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } @@ -263,11 +263,13 @@ public class TelephonyRegistryManager { * @param events List events * @param notifyNow Whether to notify instantly */ - private void listenFromCallback(int subId, @NonNull String pkg, @NonNull String featureId, + private void listenFromCallback(boolean renounceFineLocationAccess, + boolean renounceCoarseLocationAccess, int subId, + @NonNull String pkg, @NonNull String featureId, @NonNull TelephonyCallback telephonyCallback, @NonNull int[] events, boolean notifyNow) { try { - sRegistry.listenWithEventList( + sRegistry.listenWithEventList(renounceFineLocationAccess, renounceCoarseLocationAccess, subId, pkg, featureId, telephonyCallback.callback, events, notifyNow); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); @@ -1161,14 +1163,17 @@ public class TelephonyRegistryManager { * * @param callback The {@link TelephonyCallback} object to register. */ - public void registerTelephonyCallback(@NonNull @CallbackExecutor Executor executor, + public void registerTelephonyCallback(boolean renounceFineLocationAccess, + boolean renounceCoarseLocationAccess, + @NonNull @CallbackExecutor Executor executor, int subId, String pkgName, String attributionTag, @NonNull TelephonyCallback callback, boolean notifyNow) { if (callback == null) { throw new IllegalStateException("telephony service is null."); } callback.init(executor); - listenFromCallback(subId, pkgName, attributionTag, callback, + listenFromCallback(renounceFineLocationAccess, renounceCoarseLocationAccess, subId, + pkgName, attributionTag, callback, getEventsFromCallback(callback).stream().mapToInt(i -> i).toArray(), notifyNow); } @@ -1179,6 +1184,7 @@ public class TelephonyRegistryManager { */ public void unregisterTelephonyCallback(int subId, String pkgName, String attributionTag, @NonNull TelephonyCallback callback, boolean notifyNow) { - listenFromCallback(subId, pkgName, attributionTag, callback, new int[0], notifyNow); + listenFromCallback(false, false, subId, + pkgName, attributionTag, callback, new int[0], notifyNow); } } |
