Loading src/java/com/android/internal/telephony/SMSDispatcher.java +2 −1 Original line number Diff line number Diff line Loading @@ -1343,7 +1343,8 @@ public abstract class SMSDispatcher extends Handler { private CharSequence getAppLabel(String appPackage, @UserIdInt int userId) { PackageManager pm = mContext.getPackageManager(); try { ApplicationInfo appInfo = pm.getApplicationInfoAsUser(appPackage, 0, userId); ApplicationInfo appInfo = pm.getApplicationInfoAsUser(appPackage, 0, UserHandle.getUserHandleForUid(userId)); return appInfo.loadSafeLabel(pm, PackageItemInfo.DEFAULT_MAX_LABEL_SIZE_PX, PackageItemInfo.SAFE_LABEL_FLAG_TRIM | PackageItemInfo.SAFE_LABEL_FLAG_FIRST_LINE); Loading src/java/com/android/internal/telephony/ims/ImsResolver.java +1 −1 Original line number Diff line number Diff line Loading @@ -1349,7 +1349,7 @@ public class ImsResolver implements ImsServiceController.ImsServiceControllerCal for (ResolveInfo entry : packageManager.queryIntentServicesAsUser( serviceIntent, PackageManager.GET_META_DATA, mContext.getUserId())) { UserHandle.getUserHandleForUid(mContext.getUserId()))) { ServiceInfo serviceInfo = entry.serviceInfo; if (serviceInfo != null) { Loading tests/telephonytests/src/com/android/internal/telephony/ContextFixture.java +1 −1 Original line number Diff line number Diff line Loading @@ -597,7 +597,7 @@ public class ContextFixture implements TestFixture<Context> { (Intent) invocation.getArguments()[0], (Integer) invocation.getArguments()[1]); } }).when(mPackageManager).queryIntentServicesAsUser((Intent) any(), anyInt(), anyInt()); }).when(mPackageManager).queryIntentServicesAsUser((Intent) any(), anyInt(), any()); try { doReturn(mPackageInfo).when(mPackageManager).getPackageInfoAsUser(any(), anyInt(), Loading tests/telephonytests/src/com/android/internal/telephony/TelephonyPermissionsTest.java +3 −2 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import static org.mockito.ArgumentMatchers.anyInt; import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.doNothing; import static org.mockito.Mockito.doThrow; Loading Loading @@ -395,8 +396,8 @@ public class TelephonyPermissionsTest { // regardless of if the package satisfies the previous requirements for device ID access. mMockApplicationInfo.targetSdkVersion = Build.VERSION_CODES.Q; when(mMockContext.getPackageManager()).thenReturn(mMockPackageManager); when(mMockPackageManager.getApplicationInfoAsUser(eq(PACKAGE), anyInt(), anyInt())).thenReturn(mMockApplicationInfo); when(mMockPackageManager.getApplicationInfoAsUser(eq(PACKAGE), anyInt(), any())) .thenReturn(mMockApplicationInfo); when(mMockContext.checkCallingOrSelfPermission( android.Manifest.permission.READ_DEVICE_CONFIG)).thenReturn( Loading tests/telephonytests/src/com/android/internal/telephony/TelephonyTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -672,7 +672,7 @@ public abstract class TelephonyTest { // regardless of if the package satisfies the previous requirements for device ID access. mApplicationInfo.targetSdkVersion = Build.VERSION_CODES.Q; doReturn(mApplicationInfo).when(mPackageManager).getApplicationInfoAsUser(eq(TAG), anyInt(), anyInt()); any()); // TelephonyPermissions queries DeviceConfig to determine if the identifier access // restrictions should be enabled; this results in a NPE when DeviceConfig uses Loading Loading
src/java/com/android/internal/telephony/SMSDispatcher.java +2 −1 Original line number Diff line number Diff line Loading @@ -1343,7 +1343,8 @@ public abstract class SMSDispatcher extends Handler { private CharSequence getAppLabel(String appPackage, @UserIdInt int userId) { PackageManager pm = mContext.getPackageManager(); try { ApplicationInfo appInfo = pm.getApplicationInfoAsUser(appPackage, 0, userId); ApplicationInfo appInfo = pm.getApplicationInfoAsUser(appPackage, 0, UserHandle.getUserHandleForUid(userId)); return appInfo.loadSafeLabel(pm, PackageItemInfo.DEFAULT_MAX_LABEL_SIZE_PX, PackageItemInfo.SAFE_LABEL_FLAG_TRIM | PackageItemInfo.SAFE_LABEL_FLAG_FIRST_LINE); Loading
src/java/com/android/internal/telephony/ims/ImsResolver.java +1 −1 Original line number Diff line number Diff line Loading @@ -1349,7 +1349,7 @@ public class ImsResolver implements ImsServiceController.ImsServiceControllerCal for (ResolveInfo entry : packageManager.queryIntentServicesAsUser( serviceIntent, PackageManager.GET_META_DATA, mContext.getUserId())) { UserHandle.getUserHandleForUid(mContext.getUserId()))) { ServiceInfo serviceInfo = entry.serviceInfo; if (serviceInfo != null) { Loading
tests/telephonytests/src/com/android/internal/telephony/ContextFixture.java +1 −1 Original line number Diff line number Diff line Loading @@ -597,7 +597,7 @@ public class ContextFixture implements TestFixture<Context> { (Intent) invocation.getArguments()[0], (Integer) invocation.getArguments()[1]); } }).when(mPackageManager).queryIntentServicesAsUser((Intent) any(), anyInt(), anyInt()); }).when(mPackageManager).queryIntentServicesAsUser((Intent) any(), anyInt(), any()); try { doReturn(mPackageInfo).when(mPackageManager).getPackageInfoAsUser(any(), anyInt(), Loading
tests/telephonytests/src/com/android/internal/telephony/TelephonyPermissionsTest.java +3 −2 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import static org.mockito.ArgumentMatchers.anyInt; import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.doNothing; import static org.mockito.Mockito.doThrow; Loading Loading @@ -395,8 +396,8 @@ public class TelephonyPermissionsTest { // regardless of if the package satisfies the previous requirements for device ID access. mMockApplicationInfo.targetSdkVersion = Build.VERSION_CODES.Q; when(mMockContext.getPackageManager()).thenReturn(mMockPackageManager); when(mMockPackageManager.getApplicationInfoAsUser(eq(PACKAGE), anyInt(), anyInt())).thenReturn(mMockApplicationInfo); when(mMockPackageManager.getApplicationInfoAsUser(eq(PACKAGE), anyInt(), any())) .thenReturn(mMockApplicationInfo); when(mMockContext.checkCallingOrSelfPermission( android.Manifest.permission.READ_DEVICE_CONFIG)).thenReturn( Loading
tests/telephonytests/src/com/android/internal/telephony/TelephonyTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -672,7 +672,7 @@ public abstract class TelephonyTest { // regardless of if the package satisfies the previous requirements for device ID access. mApplicationInfo.targetSdkVersion = Build.VERSION_CODES.Q; doReturn(mApplicationInfo).when(mPackageManager).getApplicationInfoAsUser(eq(TAG), anyInt(), anyInt()); any()); // TelephonyPermissions queries DeviceConfig to determine if the identifier access // restrictions should be enabled; this results in a NPE when DeviceConfig uses Loading