Loading services/core/java/com/android/server/policy/AppOpsPolicy.java +7 −2 Original line number Original line Diff line number Diff line Loading @@ -185,8 +185,13 @@ public final class AppOpsPolicy implements AppOpsManagerInternal.CheckOpsDelegat initializeActivityRecognizersTags(); initializeActivityRecognizersTags(); // If this device does not have telephony, restrict the phone call ops // If this device does not have telephony or microphone features, the TelecomService will if (!mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_TELEPHONY)) { // not be started (which sets phone call ops to allow only its package). Therefore, phone // call ops need to be restricted here. PackageManager pm = mContext.getPackageManager(); if (!pm.hasSystemFeature(PackageManager.FEATURE_TELEPHONY) && !pm.hasSystemFeature(PackageManager.FEATURE_MICROPHONE) && !pm.hasSystemFeature(PackageManager.FEATURE_CONNECTION_SERVICE)) { AppOpsManager appOps = mContext.getSystemService(AppOpsManager.class); AppOpsManager appOps = mContext.getSystemService(AppOpsManager.class); appOps.setUserRestrictionForUser(AppOpsManager.OP_PHONE_CALL_MICROPHONE, true, mToken, appOps.setUserRestrictionForUser(AppOpsManager.OP_PHONE_CALL_MICROPHONE, true, mToken, null, UserHandle.USER_ALL); null, UserHandle.USER_ALL); Loading Loading
services/core/java/com/android/server/policy/AppOpsPolicy.java +7 −2 Original line number Original line Diff line number Diff line Loading @@ -185,8 +185,13 @@ public final class AppOpsPolicy implements AppOpsManagerInternal.CheckOpsDelegat initializeActivityRecognizersTags(); initializeActivityRecognizersTags(); // If this device does not have telephony, restrict the phone call ops // If this device does not have telephony or microphone features, the TelecomService will if (!mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_TELEPHONY)) { // not be started (which sets phone call ops to allow only its package). Therefore, phone // call ops need to be restricted here. PackageManager pm = mContext.getPackageManager(); if (!pm.hasSystemFeature(PackageManager.FEATURE_TELEPHONY) && !pm.hasSystemFeature(PackageManager.FEATURE_MICROPHONE) && !pm.hasSystemFeature(PackageManager.FEATURE_CONNECTION_SERVICE)) { AppOpsManager appOps = mContext.getSystemService(AppOpsManager.class); AppOpsManager appOps = mContext.getSystemService(AppOpsManager.class); appOps.setUserRestrictionForUser(AppOpsManager.OP_PHONE_CALL_MICROPHONE, true, mToken, appOps.setUserRestrictionForUser(AppOpsManager.OP_PHONE_CALL_MICROPHONE, true, mToken, null, UserHandle.USER_ALL); null, UserHandle.USER_ALL); Loading