Loading core/jni/android_os_Debug.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -575,7 +575,7 @@ static void android_os_Debug_getMemInfo(JNIEnv *env, jobject clazz, jlongArray o if (outArray != NULL) { outLen = MEMINFO_COUNT; for (int i = 0; i < outLen; i++) { if (i == MEMINFO_VMALLOC_USED) { if (i == MEMINFO_VMALLOC_USED && mem[i] == 0) { outArray[i] = smi.ReadVmallocInfo() / 1024; continue; } Loading core/res/AndroidManifest.xml +71 −25 Original line number Diff line number Diff line Loading @@ -724,6 +724,10 @@ <!-- Allows an application to send SMS messages. <p>Protection level: dangerous <p> This is a hard restricted permission which cannot be held by an app until the installer on record did not whitelist the permission. For more details see {@link android.content.pm.PackageInstaller.SessionParams#setWhitelistedRestrictedPermissions(Set)}. --> <permission android:name="android.permission.SEND_SMS" android:permissionGroup="android.permission-group.UNDEFINED" Loading @@ -734,6 +738,10 @@ <!-- Allows an application to receive SMS messages. <p>Protection level: dangerous <p> This is a hard restricted permission which cannot be held by an app until the installer on record did not whitelist the permission. For more details see {@link android.content.pm.PackageInstaller.SessionParams#setWhitelistedRestrictedPermissions(Set)}. --> <permission android:name="android.permission.RECEIVE_SMS" android:permissionGroup="android.permission-group.UNDEFINED" Loading @@ -744,6 +752,10 @@ <!-- Allows an application to read SMS messages. <p>Protection level: dangerous <p> This is a hard restricted permission which cannot be held by an app until the installer on record did not whitelist the permission. For more details see {@link android.content.pm.PackageInstaller.SessionParams#setWhitelistedRestrictedPermissions(Set)}. --> <permission android:name="android.permission.READ_SMS" android:permissionGroup="android.permission-group.UNDEFINED" Loading @@ -754,6 +766,10 @@ <!-- Allows an application to receive WAP push messages. <p>Protection level: dangerous <p> This is a hard restricted permission which cannot be held by an app until the installer on record did not whitelist the permission. For more details see {@link android.content.pm.PackageInstaller.SessionParams#setWhitelistedRestrictedPermissions(Set)}. --> <permission android:name="android.permission.RECEIVE_WAP_PUSH" android:permissionGroup="android.permission-group.UNDEFINED" Loading @@ -764,6 +780,10 @@ <!-- Allows an application to monitor incoming MMS messages. <p>Protection level: dangerous <p> This is a hard restricted permission which cannot be held by an app until the installer on record did not whitelist the permission. For more details see {@link android.content.pm.PackageInstaller.SessionParams#setWhitelistedRestrictedPermissions(Set)}. --> <permission android:name="android.permission.RECEIVE_MMS" android:permissionGroup="android.permission-group.UNDEFINED" Loading @@ -783,6 +803,11 @@ when the alert is first received, and to delay presenting the info to the user until after the initial alert dialog is dismissed. <p>Protection level: dangerous <p> This is a hard restricted permission which cannot be held by an app until the installer on record did not whitelist the permission. For more details see {@link android.content.pm.PackageInstaller.SessionParams#setWhitelistedRestrictedPermissions(Set)}. @hide Pending API council approval --> <permission android:name="android.permission.READ_CELL_BROADCASTS" android:permissionGroup="android.permission-group.UNDEFINED" Loading Loading @@ -824,11 +849,16 @@ grants your app this permission. If you don't need this permission, be sure your <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code targetSdkVersion}</a> is 4 or higher. <p>Is this permission is not whitelisted for an app that targets an API level before {@link android.os.Build.VERSION_CODES#Q} this permission cannot be granted to apps.</p> <p>Is this permission is not whitelisted for an app that targets an API level {@link android.os.Build.VERSION_CODES#Q} or later the app will be forced into isolated storage. </p> <p> This is a soft restricted permission which cannot be held by an app it its full form until the installer on record did not whitelist the permission. Specifically, if the permission is whitelisted the holder app can access external storage and the visual and aural media collections while if the permission is not whitelisted the holder app can only access to the visual and aural medial collections. Also the permission is immutably restricted meaning that the whitelist state can be specified only at install time and cannot change until the app is installed. For more details see {@link android.content.pm.PackageInstaller.SessionParams#setWhitelistedRestrictedPermissions(Set)}. --> <permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:permissionGroup="android.permission-group.UNDEFINED" Loading Loading @@ -916,6 +946,10 @@ {@link #ACCESS_FINE_LOCATION}. Requesting this permission by itself doesn't give you location access. <p>Protection level: dangerous <p> This is a hard restricted permission which cannot be held by an app until the installer on record did not whitelist the permission. For more details see {@link android.content.pm.PackageInstaller.SessionParams#setWhitelistedRestrictedPermissions(Set)}. --> <permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" android:permissionGroup="android.permission-group.UNDEFINED" Loading Loading @@ -958,6 +992,10 @@ href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code targetSdkVersion}</a> is 16 or higher.</p> <p>Protection level: dangerous <p> This is a hard restricted permission which cannot be held by an app until the installer on record did not whitelist the permission. For more details see {@link android.content.pm.PackageInstaller.SessionParams#setWhitelistedRestrictedPermissions(Set)}. --> <permission android:name="android.permission.READ_CALL_LOG" android:permissionGroup="android.permission-group.UNDEFINED" Loading @@ -978,6 +1016,10 @@ href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code targetSdkVersion}</a> is 16 or higher.</p> <p>Protection level: dangerous <p> This is a hard restricted permission which cannot be held by an app until the installer on record did not whitelist the permission. For more details see {@link android.content.pm.PackageInstaller.SessionParams#setWhitelistedRestrictedPermissions(Set)}. --> <permission android:name="android.permission.WRITE_CALL_LOG" android:permissionGroup="android.permission-group.UNDEFINED" Loading @@ -991,6 +1033,10 @@ abort the call altogether. <p>Protection level: dangerous <p> This is a hard restricted permission which cannot be held by an app until the installer on record did not whitelist the permission. For more details see {@link android.content.pm.PackageInstaller.SessionParams#setWhitelistedRestrictedPermissions(Set)}. @deprecated Applications should use {@link android.telecom.CallRedirectionService} instead of the {@link android.content.Intent#ACTION_NEW_OUTGOING_CALL} broadcast. --> Loading packages/SettingsLib/src/com/android/settingslib/bluetooth/HidProfile.java +1 −1 Original line number Diff line number Diff line Loading @@ -117,7 +117,7 @@ public class HidProfile implements LocalBluetoothProfile { public boolean isPreferred(BluetoothDevice device) { if (mService == null) return false; return mService.getPriority(device) > BluetoothProfile.PRIORITY_OFF; return mService.getPriority(device) != BluetoothProfile.PRIORITY_OFF; } public int getPreferred(BluetoothDevice device) { Loading packages/SettingsLib/src/com/android/settingslib/net/DataUsageUtils.java +3 −22 Original line number Diff line number Diff line Loading @@ -18,15 +18,11 @@ package com.android.settingslib.net; import android.content.Context; import android.net.NetworkTemplate; import android.os.ParcelUuid; import android.telephony.SubscriptionInfo; import android.telephony.SubscriptionManager; import android.telephony.TelephonyManager; import android.util.Log; import java.util.ArrayList; import java.util.List; /** * Utils class for data usage */ Loading @@ -38,7 +34,7 @@ public class DataUsageUtils { */ public static NetworkTemplate getMobileTemplate(Context context, int subId) { final TelephonyManager telephonyManager = context.getSystemService( TelephonyManager.class); TelephonyManager.class).createForSubscriptionId(subId); final SubscriptionManager subscriptionManager = context.getSystemService( SubscriptionManager.class); final SubscriptionInfo info = subscriptionManager.getActiveSubscriptionInfo(subId); Loading @@ -49,23 +45,8 @@ public class DataUsageUtils { Log.i(TAG, "Subscription is not active: " + subId); return mobileAll; } final ParcelUuid groupUuid = info.getGroupUuid(); if (groupUuid == null) { Log.i(TAG, "Subscription doesn't have valid group uuid: " + subId); return mobileAll; } // Otherwise merge other subscriberId to create new NetworkTemplate final List<SubscriptionInfo> groupInfos = subscriptionManager.getSubscriptionsInGroup( groupUuid); final List<String> mergedSubscriberIds = new ArrayList<>(); for (SubscriptionInfo subInfo : groupInfos) { final String subscriberId = telephonyManager.getSubscriberId( subInfo.getSubscriptionId()); if (subscriberId != null) { mergedSubscriberIds.add(subscriberId); } } return NetworkTemplate.normalize(mobileAll, mergedSubscriberIds.toArray(new String[0])); // Use old API to build networkTemplate return NetworkTemplate.normalize(mobileAll, telephonyManager.getMergedSubscriberIds()); } } packages/SettingsLib/tests/robotests/src/com/android/settingslib/net/DataUsageUtilsTest.java +4 −15 Original line number Diff line number Diff line Loading @@ -44,7 +44,6 @@ import java.util.List; public class DataUsageUtilsTest { private static final int SUB_ID = 1; private static final int SUB_ID_2 = 2; private static final String SUBSCRIBER_ID = "Test Subscriber"; private static final String SUBSCRIBER_ID_2 = "Test Subscriber 2"; Loading @@ -67,11 +66,11 @@ public class DataUsageUtilsTest { mContext = spy(RuntimeEnvironment.application); when(mContext.getSystemService(TelephonyManager.class)).thenReturn(mTelephonyManager); when(mTelephonyManager.createForSubscriptionId(SUB_ID)).thenReturn(mTelephonyManager); when(mContext.getSystemService(SubscriptionManager.class)).thenReturn(mSubscriptionManager); when(mTelephonyManager.getSubscriberId(SUB_ID)).thenReturn(SUBSCRIBER_ID); when(mTelephonyManager.getSubscriberId(SUB_ID_2)).thenReturn(SUBSCRIBER_ID_2); when(mInfo1.getSubscriptionId()).thenReturn(SUB_ID); when(mInfo2.getSubscriptionId()).thenReturn(SUB_ID_2); when(mTelephonyManager.getMergedSubscriberIds()).thenReturn( new String[]{SUBSCRIBER_ID, SUBSCRIBER_ID_2}); mInfos = new ArrayList<>(); mInfos.add(mInfo1); Loading @@ -89,17 +88,7 @@ public class DataUsageUtilsTest { } @Test public void getMobileTemplate_groupUuidNull_returnMobileAll() { when(mSubscriptionManager.getActiveSubscriptionInfo(SUB_ID)).thenReturn(mInfo1); when(mInfo1.getGroupUuid()).thenReturn(null); final NetworkTemplate networkTemplate = DataUsageUtils.getMobileTemplate(mContext, SUB_ID); assertThat(networkTemplate.matchesSubscriberId(SUBSCRIBER_ID)).isTrue(); assertThat(networkTemplate.matchesSubscriberId(SUBSCRIBER_ID_2)).isFalse(); } @Test public void getMobileTemplate_groupUuidExist_returnMobileMerged() { public void getMobileTemplate_infoExisted_returnMobileMerged() { when(mSubscriptionManager.getActiveSubscriptionInfo(SUB_ID)).thenReturn(mInfo1); when(mInfo1.getGroupUuid()).thenReturn(mParcelUuid); Loading Loading
core/jni/android_os_Debug.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -575,7 +575,7 @@ static void android_os_Debug_getMemInfo(JNIEnv *env, jobject clazz, jlongArray o if (outArray != NULL) { outLen = MEMINFO_COUNT; for (int i = 0; i < outLen; i++) { if (i == MEMINFO_VMALLOC_USED) { if (i == MEMINFO_VMALLOC_USED && mem[i] == 0) { outArray[i] = smi.ReadVmallocInfo() / 1024; continue; } Loading
core/res/AndroidManifest.xml +71 −25 Original line number Diff line number Diff line Loading @@ -724,6 +724,10 @@ <!-- Allows an application to send SMS messages. <p>Protection level: dangerous <p> This is a hard restricted permission which cannot be held by an app until the installer on record did not whitelist the permission. For more details see {@link android.content.pm.PackageInstaller.SessionParams#setWhitelistedRestrictedPermissions(Set)}. --> <permission android:name="android.permission.SEND_SMS" android:permissionGroup="android.permission-group.UNDEFINED" Loading @@ -734,6 +738,10 @@ <!-- Allows an application to receive SMS messages. <p>Protection level: dangerous <p> This is a hard restricted permission which cannot be held by an app until the installer on record did not whitelist the permission. For more details see {@link android.content.pm.PackageInstaller.SessionParams#setWhitelistedRestrictedPermissions(Set)}. --> <permission android:name="android.permission.RECEIVE_SMS" android:permissionGroup="android.permission-group.UNDEFINED" Loading @@ -744,6 +752,10 @@ <!-- Allows an application to read SMS messages. <p>Protection level: dangerous <p> This is a hard restricted permission which cannot be held by an app until the installer on record did not whitelist the permission. For more details see {@link android.content.pm.PackageInstaller.SessionParams#setWhitelistedRestrictedPermissions(Set)}. --> <permission android:name="android.permission.READ_SMS" android:permissionGroup="android.permission-group.UNDEFINED" Loading @@ -754,6 +766,10 @@ <!-- Allows an application to receive WAP push messages. <p>Protection level: dangerous <p> This is a hard restricted permission which cannot be held by an app until the installer on record did not whitelist the permission. For more details see {@link android.content.pm.PackageInstaller.SessionParams#setWhitelistedRestrictedPermissions(Set)}. --> <permission android:name="android.permission.RECEIVE_WAP_PUSH" android:permissionGroup="android.permission-group.UNDEFINED" Loading @@ -764,6 +780,10 @@ <!-- Allows an application to monitor incoming MMS messages. <p>Protection level: dangerous <p> This is a hard restricted permission which cannot be held by an app until the installer on record did not whitelist the permission. For more details see {@link android.content.pm.PackageInstaller.SessionParams#setWhitelistedRestrictedPermissions(Set)}. --> <permission android:name="android.permission.RECEIVE_MMS" android:permissionGroup="android.permission-group.UNDEFINED" Loading @@ -783,6 +803,11 @@ when the alert is first received, and to delay presenting the info to the user until after the initial alert dialog is dismissed. <p>Protection level: dangerous <p> This is a hard restricted permission which cannot be held by an app until the installer on record did not whitelist the permission. For more details see {@link android.content.pm.PackageInstaller.SessionParams#setWhitelistedRestrictedPermissions(Set)}. @hide Pending API council approval --> <permission android:name="android.permission.READ_CELL_BROADCASTS" android:permissionGroup="android.permission-group.UNDEFINED" Loading Loading @@ -824,11 +849,16 @@ grants your app this permission. If you don't need this permission, be sure your <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code targetSdkVersion}</a> is 4 or higher. <p>Is this permission is not whitelisted for an app that targets an API level before {@link android.os.Build.VERSION_CODES#Q} this permission cannot be granted to apps.</p> <p>Is this permission is not whitelisted for an app that targets an API level {@link android.os.Build.VERSION_CODES#Q} or later the app will be forced into isolated storage. </p> <p> This is a soft restricted permission which cannot be held by an app it its full form until the installer on record did not whitelist the permission. Specifically, if the permission is whitelisted the holder app can access external storage and the visual and aural media collections while if the permission is not whitelisted the holder app can only access to the visual and aural medial collections. Also the permission is immutably restricted meaning that the whitelist state can be specified only at install time and cannot change until the app is installed. For more details see {@link android.content.pm.PackageInstaller.SessionParams#setWhitelistedRestrictedPermissions(Set)}. --> <permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:permissionGroup="android.permission-group.UNDEFINED" Loading Loading @@ -916,6 +946,10 @@ {@link #ACCESS_FINE_LOCATION}. Requesting this permission by itself doesn't give you location access. <p>Protection level: dangerous <p> This is a hard restricted permission which cannot be held by an app until the installer on record did not whitelist the permission. For more details see {@link android.content.pm.PackageInstaller.SessionParams#setWhitelistedRestrictedPermissions(Set)}. --> <permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" android:permissionGroup="android.permission-group.UNDEFINED" Loading Loading @@ -958,6 +992,10 @@ href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code targetSdkVersion}</a> is 16 or higher.</p> <p>Protection level: dangerous <p> This is a hard restricted permission which cannot be held by an app until the installer on record did not whitelist the permission. For more details see {@link android.content.pm.PackageInstaller.SessionParams#setWhitelistedRestrictedPermissions(Set)}. --> <permission android:name="android.permission.READ_CALL_LOG" android:permissionGroup="android.permission-group.UNDEFINED" Loading @@ -978,6 +1016,10 @@ href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code targetSdkVersion}</a> is 16 or higher.</p> <p>Protection level: dangerous <p> This is a hard restricted permission which cannot be held by an app until the installer on record did not whitelist the permission. For more details see {@link android.content.pm.PackageInstaller.SessionParams#setWhitelistedRestrictedPermissions(Set)}. --> <permission android:name="android.permission.WRITE_CALL_LOG" android:permissionGroup="android.permission-group.UNDEFINED" Loading @@ -991,6 +1033,10 @@ abort the call altogether. <p>Protection level: dangerous <p> This is a hard restricted permission which cannot be held by an app until the installer on record did not whitelist the permission. For more details see {@link android.content.pm.PackageInstaller.SessionParams#setWhitelistedRestrictedPermissions(Set)}. @deprecated Applications should use {@link android.telecom.CallRedirectionService} instead of the {@link android.content.Intent#ACTION_NEW_OUTGOING_CALL} broadcast. --> Loading
packages/SettingsLib/src/com/android/settingslib/bluetooth/HidProfile.java +1 −1 Original line number Diff line number Diff line Loading @@ -117,7 +117,7 @@ public class HidProfile implements LocalBluetoothProfile { public boolean isPreferred(BluetoothDevice device) { if (mService == null) return false; return mService.getPriority(device) > BluetoothProfile.PRIORITY_OFF; return mService.getPriority(device) != BluetoothProfile.PRIORITY_OFF; } public int getPreferred(BluetoothDevice device) { Loading
packages/SettingsLib/src/com/android/settingslib/net/DataUsageUtils.java +3 −22 Original line number Diff line number Diff line Loading @@ -18,15 +18,11 @@ package com.android.settingslib.net; import android.content.Context; import android.net.NetworkTemplate; import android.os.ParcelUuid; import android.telephony.SubscriptionInfo; import android.telephony.SubscriptionManager; import android.telephony.TelephonyManager; import android.util.Log; import java.util.ArrayList; import java.util.List; /** * Utils class for data usage */ Loading @@ -38,7 +34,7 @@ public class DataUsageUtils { */ public static NetworkTemplate getMobileTemplate(Context context, int subId) { final TelephonyManager telephonyManager = context.getSystemService( TelephonyManager.class); TelephonyManager.class).createForSubscriptionId(subId); final SubscriptionManager subscriptionManager = context.getSystemService( SubscriptionManager.class); final SubscriptionInfo info = subscriptionManager.getActiveSubscriptionInfo(subId); Loading @@ -49,23 +45,8 @@ public class DataUsageUtils { Log.i(TAG, "Subscription is not active: " + subId); return mobileAll; } final ParcelUuid groupUuid = info.getGroupUuid(); if (groupUuid == null) { Log.i(TAG, "Subscription doesn't have valid group uuid: " + subId); return mobileAll; } // Otherwise merge other subscriberId to create new NetworkTemplate final List<SubscriptionInfo> groupInfos = subscriptionManager.getSubscriptionsInGroup( groupUuid); final List<String> mergedSubscriberIds = new ArrayList<>(); for (SubscriptionInfo subInfo : groupInfos) { final String subscriberId = telephonyManager.getSubscriberId( subInfo.getSubscriptionId()); if (subscriberId != null) { mergedSubscriberIds.add(subscriberId); } } return NetworkTemplate.normalize(mobileAll, mergedSubscriberIds.toArray(new String[0])); // Use old API to build networkTemplate return NetworkTemplate.normalize(mobileAll, telephonyManager.getMergedSubscriberIds()); } }
packages/SettingsLib/tests/robotests/src/com/android/settingslib/net/DataUsageUtilsTest.java +4 −15 Original line number Diff line number Diff line Loading @@ -44,7 +44,6 @@ import java.util.List; public class DataUsageUtilsTest { private static final int SUB_ID = 1; private static final int SUB_ID_2 = 2; private static final String SUBSCRIBER_ID = "Test Subscriber"; private static final String SUBSCRIBER_ID_2 = "Test Subscriber 2"; Loading @@ -67,11 +66,11 @@ public class DataUsageUtilsTest { mContext = spy(RuntimeEnvironment.application); when(mContext.getSystemService(TelephonyManager.class)).thenReturn(mTelephonyManager); when(mTelephonyManager.createForSubscriptionId(SUB_ID)).thenReturn(mTelephonyManager); when(mContext.getSystemService(SubscriptionManager.class)).thenReturn(mSubscriptionManager); when(mTelephonyManager.getSubscriberId(SUB_ID)).thenReturn(SUBSCRIBER_ID); when(mTelephonyManager.getSubscriberId(SUB_ID_2)).thenReturn(SUBSCRIBER_ID_2); when(mInfo1.getSubscriptionId()).thenReturn(SUB_ID); when(mInfo2.getSubscriptionId()).thenReturn(SUB_ID_2); when(mTelephonyManager.getMergedSubscriberIds()).thenReturn( new String[]{SUBSCRIBER_ID, SUBSCRIBER_ID_2}); mInfos = new ArrayList<>(); mInfos.add(mInfo1); Loading @@ -89,17 +88,7 @@ public class DataUsageUtilsTest { } @Test public void getMobileTemplate_groupUuidNull_returnMobileAll() { when(mSubscriptionManager.getActiveSubscriptionInfo(SUB_ID)).thenReturn(mInfo1); when(mInfo1.getGroupUuid()).thenReturn(null); final NetworkTemplate networkTemplate = DataUsageUtils.getMobileTemplate(mContext, SUB_ID); assertThat(networkTemplate.matchesSubscriberId(SUBSCRIBER_ID)).isTrue(); assertThat(networkTemplate.matchesSubscriberId(SUBSCRIBER_ID_2)).isFalse(); } @Test public void getMobileTemplate_groupUuidExist_returnMobileMerged() { public void getMobileTemplate_infoExisted_returnMobileMerged() { when(mSubscriptionManager.getActiveSubscriptionInfo(SUB_ID)).thenReturn(mInfo1); when(mInfo1.getGroupUuid()).thenReturn(mParcelUuid); Loading