Skip to content
Snippets Groups Projects
Commit 4b5f423c authored by Chen Xu's avatar Chen Xu
Browse files

use packageManager @SystemAPI

Bug: 137202333
Test: Build
Change-Id: I1c0cb7840cb7d68fd720723eec96aa51aefc1df8
parent 5047e888
No related branches found
No related tags found
No related merge requests found
......@@ -158,7 +158,7 @@ public final class SmsApplication {
ApplicationInfo appInfo;
try {
appInfo = pm.getApplicationInfoAsUser(mPackageName, 0,
UserHandle.getUserId(mUid));
UserHandle.getUserHandleForUid(mUid));
} catch (NameNotFoundException e) {
return null;
}
......@@ -300,7 +300,7 @@ public final class SmsApplication {
Uri.fromParts(SCHEME_SMSTO, "", null));
List<ResolveInfo> respondServices = packageManager.queryIntentServicesAsUser(intent,
PackageManager.MATCH_DIRECT_BOOT_AWARE | PackageManager.MATCH_DIRECT_BOOT_UNAWARE,
userId);
UserHandle.getUserHandleForUid(userId));
for (ResolveInfo resolveInfo : respondServices) {
final ServiceInfo serviceInfo = resolveInfo.serviceInfo;
if (serviceInfo == null) {
......
......@@ -367,7 +367,7 @@ public final class TelephonyPermissions {
ApplicationInfo callingPackageInfo = null;
try {
callingPackageInfo = context.getPackageManager().getApplicationInfoAsUser(
callingPackage, 0, UserHandle.getUserId(uid));
callingPackage, 0, UserHandle.getUserHandleForUid(uid));
if (callingPackageInfo != null) {
if (callingPackageInfo.isSystemApp()) {
isPreinstalled = true;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment