Merge "use packageManager @SystemAPI"
This commit is contained in:
@@ -158,7 +158,7 @@ public final class SmsApplication {
|
|||||||
ApplicationInfo appInfo;
|
ApplicationInfo appInfo;
|
||||||
try {
|
try {
|
||||||
appInfo = pm.getApplicationInfoAsUser(mPackageName, 0,
|
appInfo = pm.getApplicationInfoAsUser(mPackageName, 0,
|
||||||
UserHandle.getUserId(mUid));
|
UserHandle.getUserHandleForUid(mUid));
|
||||||
} catch (NameNotFoundException e) {
|
} catch (NameNotFoundException e) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -300,7 +300,7 @@ public final class SmsApplication {
|
|||||||
Uri.fromParts(SCHEME_SMSTO, "", null));
|
Uri.fromParts(SCHEME_SMSTO, "", null));
|
||||||
List<ResolveInfo> respondServices = packageManager.queryIntentServicesAsUser(intent,
|
List<ResolveInfo> respondServices = packageManager.queryIntentServicesAsUser(intent,
|
||||||
PackageManager.MATCH_DIRECT_BOOT_AWARE | PackageManager.MATCH_DIRECT_BOOT_UNAWARE,
|
PackageManager.MATCH_DIRECT_BOOT_AWARE | PackageManager.MATCH_DIRECT_BOOT_UNAWARE,
|
||||||
userId);
|
UserHandle.getUserHandleForUid(userId));
|
||||||
for (ResolveInfo resolveInfo : respondServices) {
|
for (ResolveInfo resolveInfo : respondServices) {
|
||||||
final ServiceInfo serviceInfo = resolveInfo.serviceInfo;
|
final ServiceInfo serviceInfo = resolveInfo.serviceInfo;
|
||||||
if (serviceInfo == null) {
|
if (serviceInfo == null) {
|
||||||
|
|||||||
@@ -367,7 +367,7 @@ public final class TelephonyPermissions {
|
|||||||
ApplicationInfo callingPackageInfo = null;
|
ApplicationInfo callingPackageInfo = null;
|
||||||
try {
|
try {
|
||||||
callingPackageInfo = context.getPackageManager().getApplicationInfoAsUser(
|
callingPackageInfo = context.getPackageManager().getApplicationInfoAsUser(
|
||||||
callingPackage, 0, UserHandle.getUserId(uid));
|
callingPackage, 0, UserHandle.getUserHandleForUid(uid));
|
||||||
if (callingPackageInfo != null) {
|
if (callingPackageInfo != null) {
|
||||||
if (callingPackageInfo.isSystemApp()) {
|
if (callingPackageInfo.isSystemApp()) {
|
||||||
isPreinstalled = true;
|
isPreinstalled = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user