Loading core/java/android/provider/DeviceConfig.java +8 −0 Original line number Diff line number Diff line Loading @@ -239,6 +239,14 @@ public final class DeviceConfig { * Whether to show location access check notifications. */ String PROPERTY_LOCATION_ACCESS_CHECK_ENABLED = "location_access_check_enabled"; /** * Whether to disable the new device identifier access restrictions. * * @hide */ String PROPERTY_DEVICE_IDENTIFIER_ACCESS_RESTRICTIONS_DISABLED = "device_identifier_access_restrictions_disabled"; } /** Loading telephony/java/com/android/internal/telephony/TelephonyPermissions.java +13 −3 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ import android.os.Process; import android.os.RemoteException; import android.os.ServiceManager; import android.os.UserHandle; import android.provider.DeviceConfig; import android.provider.Settings; import android.telephony.Rlog; import android.telephony.SubscriptionManager; Loading Loading @@ -319,9 +320,10 @@ public final class TelephonyPermissions { // The new Q restrictions for device identifier access will be enforced for all apps with // settings to individually disable the new restrictions for privileged, preloaded // non-privileged, and 3P apps. if ((!is3PApp && !isNonPrivApp && !relaxPrivDeviceIdentifierCheck) if (!isIdentifierCheckDisabled() && ( (!is3PApp && !isNonPrivApp && !relaxPrivDeviceIdentifierCheck) || (is3PApp && !relax3PDeviceIdentifierCheck) || (isNonPrivApp && !relaxNonPrivDeviceIdentifierCheck)) { || (isNonPrivApp && !relaxNonPrivDeviceIdentifierCheck))) { Log.wtf(LOG_TAG, "reportAccessDeniedToReadIdentifiers:" + callingPackage + ":" + message + ":is3PApp=" + is3PApp + ":isNonPrivApp=" + isNonPrivApp); // if the target SDK is pre-Q then check if the calling package would have previously Loading @@ -347,6 +349,14 @@ public final class TelephonyPermissions { } } /** * Returns true if the new device identifier access restrictions are disabled. */ private static boolean isIdentifierCheckDisabled() { return Boolean.parseBoolean(DeviceConfig.getProperty(DeviceConfig.Privacy.NAMESPACE, DeviceConfig.Privacy.PROPERTY_DEVICE_IDENTIFIER_ACCESS_RESTRICTIONS_DISABLED)); } /** * Check whether the app with the given pid/uid can read the call log. * @return {@code true} if the specified app has the read call log permission and AppOpp granted Loading Loading
core/java/android/provider/DeviceConfig.java +8 −0 Original line number Diff line number Diff line Loading @@ -239,6 +239,14 @@ public final class DeviceConfig { * Whether to show location access check notifications. */ String PROPERTY_LOCATION_ACCESS_CHECK_ENABLED = "location_access_check_enabled"; /** * Whether to disable the new device identifier access restrictions. * * @hide */ String PROPERTY_DEVICE_IDENTIFIER_ACCESS_RESTRICTIONS_DISABLED = "device_identifier_access_restrictions_disabled"; } /** Loading
telephony/java/com/android/internal/telephony/TelephonyPermissions.java +13 −3 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ import android.os.Process; import android.os.RemoteException; import android.os.ServiceManager; import android.os.UserHandle; import android.provider.DeviceConfig; import android.provider.Settings; import android.telephony.Rlog; import android.telephony.SubscriptionManager; Loading Loading @@ -319,9 +320,10 @@ public final class TelephonyPermissions { // The new Q restrictions for device identifier access will be enforced for all apps with // settings to individually disable the new restrictions for privileged, preloaded // non-privileged, and 3P apps. if ((!is3PApp && !isNonPrivApp && !relaxPrivDeviceIdentifierCheck) if (!isIdentifierCheckDisabled() && ( (!is3PApp && !isNonPrivApp && !relaxPrivDeviceIdentifierCheck) || (is3PApp && !relax3PDeviceIdentifierCheck) || (isNonPrivApp && !relaxNonPrivDeviceIdentifierCheck)) { || (isNonPrivApp && !relaxNonPrivDeviceIdentifierCheck))) { Log.wtf(LOG_TAG, "reportAccessDeniedToReadIdentifiers:" + callingPackage + ":" + message + ":is3PApp=" + is3PApp + ":isNonPrivApp=" + isNonPrivApp); // if the target SDK is pre-Q then check if the calling package would have previously Loading @@ -347,6 +349,14 @@ public final class TelephonyPermissions { } } /** * Returns true if the new device identifier access restrictions are disabled. */ private static boolean isIdentifierCheckDisabled() { return Boolean.parseBoolean(DeviceConfig.getProperty(DeviceConfig.Privacy.NAMESPACE, DeviceConfig.Privacy.PROPERTY_DEVICE_IDENTIFIER_ACCESS_RESTRICTIONS_DISABLED)); } /** * Check whether the app with the given pid/uid can read the call log. * @return {@code true} if the specified app has the read call log permission and AppOpp granted Loading