diff options
| author | 2022-04-05 19:48:53 +0000 | |
|---|---|---|
| committer | 2022-04-05 19:48:53 +0000 | |
| commit | c8cc6d03a9d36565b3aed45b1f1e685e02252d72 (patch) | |
| tree | 760e7f59963fee55d11a3cb7459b3afc60eb128d | |
| parent | e3250aa2ad7d9948965878a74651d068caf1f4c3 (diff) | |
| parent | 68c29dc3ffee26ac2874c210bcb828ce958415c2 (diff) | |
Merge "Restrict PHONE_CALL ops based on TelecomService" into tm-dev am: 68c29dc3ff
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17200774
Change-Id: Ic78e17c7252c1b72aca3a4f8dad7d55b144b49cb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
| -rw-r--r-- | services/core/java/com/android/server/policy/AppOpsPolicy.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/policy/AppOpsPolicy.java b/services/core/java/com/android/server/policy/AppOpsPolicy.java index 70d69c663572..e157a277366f 100644 --- a/services/core/java/com/android/server/policy/AppOpsPolicy.java +++ b/services/core/java/com/android/server/policy/AppOpsPolicy.java @@ -187,8 +187,12 @@ public final class AppOpsPolicy implements AppOpsManagerInternal.CheckOpsDelegat initializeActivityRecognizersTags(); - // If this device does not have telephony, restrict the phone call ops - if (!mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_TELEPHONY)) { + // Restrict phone call ops if the TelecomService will not start (conditioned on having + // FEATURE_MICROPHONE, FEATURE_TELECOM, or FEATURE_TELEPHONY). + PackageManager pm = mContext.getPackageManager(); + if (!pm.hasSystemFeature(PackageManager.FEATURE_TELEPHONY) + && !pm.hasSystemFeature(PackageManager.FEATURE_MICROPHONE) + && !pm.hasSystemFeature(PackageManager.FEATURE_TELECOM)) { AppOpsManager appOps = mContext.getSystemService(AppOpsManager.class); appOps.setUserRestrictionForUser(AppOpsManager.OP_PHONE_CALL_MICROPHONE, true, mToken, null, UserHandle.USER_ALL); |