Merge "Use package manager stock flags to pull lib info" into pi-dev

This commit is contained in:
TreeHugger Robot
2018-03-28 03:00:23 +00:00
committed by Android (Google) Code Review
5 changed files with 20 additions and 11 deletions

View File

@@ -10605,8 +10605,8 @@ public class ActivityManagerService extends IActivityManager.Stub
intent.addFlags(Intent.FLAG_ACTIVITY_RETAIN_IN_RECENTS);
}
}
final ActivityInfo ainfo = AppGlobals.getPackageManager().getActivityInfo(comp, 0,
UserHandle.getUserId(callingUid));
final ActivityInfo ainfo = AppGlobals.getPackageManager().getActivityInfo(comp,
STOCK_PM_FLAGS, UserHandle.getUserId(callingUid));
if (ainfo.applicationInfo.uid != callingUid) {
throw new SecurityException(
"Can't add task for another application: target uid="
@@ -21213,7 +21213,7 @@ public class ActivityManagerService extends IActivityManager.Stub
ApplicationInfo aInfo = null;
try {
aInfo = AppGlobals.getPackageManager()
.getApplicationInfo(ssp, 0 /*flags*/, userId);
.getApplicationInfo(ssp, STOCK_PM_FLAGS, userId);
} catch (RemoteException ignore) {}
if (aInfo == null) {
Slog.w(TAG, "Dropping ACTION_PACKAGE_REPLACED for non-existent pkg:"
@@ -21238,7 +21238,7 @@ public class ActivityManagerService extends IActivityManager.Stub
try {
ApplicationInfo ai = AppGlobals.getPackageManager().
getApplicationInfo(ssp, 0, 0);
getApplicationInfo(ssp, STOCK_PM_FLAGS, 0);
mBatteryStatsService.notePackageInstalled(ssp,
ai != null ? ai.versionCode : 0);
} catch (RemoteException e) {

View File

@@ -236,7 +236,8 @@ final class ActivityRecord extends ConfigurationContainer implements AppWindowCo
final IApplicationToken.Stub appToken; // window manager token
AppWindowContainerController mWindowContainerController;
final ActivityInfo info; // all about me
final ApplicationInfo appInfo; // information about activity's app
// TODO: This is duplicated state already contained in info.applicationInfo - remove
ApplicationInfo appInfo; // information about activity's app
final int launchedFromPid; // always the pid who started the activity.
final int launchedFromUid; // always the uid who started the activity.
final String launchedFromPackage; // always the package who started the activity.
@@ -605,6 +606,11 @@ final class ActivityRecord extends ConfigurationContainer implements AppWindowCo
}
}
void updateApplicationInfo(ApplicationInfo aInfo) {
appInfo = aInfo;
info.applicationInfo = aInfo;
}
private boolean crossesHorizontalSizeThreshold(int firstDp, int secondDp) {
return crossesSizeThreshold(mHorizontalSizeConfigurations, firstDp, secondDp);
}

View File

@@ -1324,7 +1324,7 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai
final ActivityRecord ar = activities.get(activityNdx);
if ((userId == ar.userId) && packageName.equals(ar.packageName)) {
ar.info.applicationInfo = aInfo;
ar.updateApplicationInfo(aInfo);
}
}
}
@@ -3987,7 +3987,8 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai
} else {
try {
ActivityInfo aInfo = AppGlobals.getPackageManager().getActivityInfo(
destIntent.getComponent(), 0, srec.userId);
destIntent.getComponent(), ActivityManagerService.STOCK_PM_FLAGS,
srec.userId);
// TODO(b/64750076): Check if calling pid should really be -1.
final int res = mService.getActivityStartController()
.obtainStarter(destIntent, "navigateUpTo")

View File

@@ -198,9 +198,10 @@ public class ActivityStartController {
// See if we should be showing the platform update setup UI.
final Intent intent = new Intent(Intent.ACTION_UPGRADE_SETUP);
final List<ResolveInfo> ris = mService.mContext.getPackageManager()
.queryIntentActivities(intent,
PackageManager.MATCH_SYSTEM_ONLY | PackageManager.GET_META_DATA);
final List<ResolveInfo> ris =
mService.mContext.getPackageManager().queryIntentActivities(intent,
PackageManager.MATCH_SYSTEM_ONLY | PackageManager.GET_META_DATA
| ActivityManagerService.STOCK_PM_FLAGS);
if (!ris.isEmpty()) {
final ResolveInfo ri = ris.get(0);
String vers = ri.activityInfo.metaData != null

View File

@@ -600,7 +600,8 @@ class RecentTasks {
// activities that are fully runnable based on
// current system state.
ai = pm.getActivityInfo(task.realActivity,
PackageManager.MATCH_DEBUG_TRIAGED_MISSING, userId);
PackageManager.MATCH_DEBUG_TRIAGED_MISSING
| ActivityManagerService.STOCK_PM_FLAGS, userId);
} catch (RemoteException e) {
// Will never happen.
continue;