Merge "Fix cross user package visibility leakage for queryInstrumentation"
This commit is contained in:
@@ -6854,9 +6854,12 @@ public final class ActivityThread extends ClientTransactionHandler
|
||||
private InstrumentationInfo prepareInstrumentation(AppBindData data) {
|
||||
final InstrumentationInfo ii;
|
||||
try {
|
||||
ii = new ApplicationPackageManager(null, getPackageManager())
|
||||
.getInstrumentationInfo(data.instrumentationName, 0);
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
ii = getPackageManager().getInstrumentationInfoAsUser(data.instrumentationName,
|
||||
0 /* flags */, UserHandle.myUserId());
|
||||
} catch (RemoteException e) {
|
||||
throw e.rethrowFromSystemServer();
|
||||
}
|
||||
if (ii == null) {
|
||||
throw new RuntimeException(
|
||||
"Unable to find instrumentation info for: " + data.instrumentationName);
|
||||
}
|
||||
|
||||
@@ -1695,8 +1695,8 @@ public class ApplicationPackageManager extends PackageManager {
|
||||
ComponentName className, int flags)
|
||||
throws NameNotFoundException {
|
||||
try {
|
||||
InstrumentationInfo ii = mPM.getInstrumentationInfo(
|
||||
className, flags);
|
||||
InstrumentationInfo ii = mPM.getInstrumentationInfoAsUser(
|
||||
className, flags, getUserId());
|
||||
if (ii != null) {
|
||||
return ii;
|
||||
}
|
||||
@@ -1713,7 +1713,7 @@ public class ApplicationPackageManager extends PackageManager {
|
||||
String targetPackage, int flags) {
|
||||
try {
|
||||
ParceledListSlice<InstrumentationInfo> parceledList =
|
||||
mPM.queryInstrumentation(targetPackage, flags);
|
||||
mPM.queryInstrumentationAsUser(targetPackage, flags, getUserId());
|
||||
if (parceledList == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user