Merge "Revert "Add extra debug to capture system state"" into qt-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
3abd182c39
@@ -5643,27 +5643,6 @@ public class PackageManagerService extends IPackageManager.Stub
|
|||||||
for (int i = 0; pkg == null && i < N; i++) {
|
for (int i = 0; pkg == null && i < N; i++) {
|
||||||
pkg = mPackages.get(packageNames[i]);
|
pkg = mPackages.get(packageNames[i]);
|
||||||
}
|
}
|
||||||
// Additional logs for b/111075456; ignore system UIDs
|
|
||||||
if (pkg == null && UserHandle.getAppId(uid) >= Process.FIRST_APPLICATION_UID) {
|
|
||||||
if (packageNames == null || packageNames.length < 2) {
|
|
||||||
// unclear if this is shared user or just a missing application
|
|
||||||
Log.e(TAG, "Failed to find package"
|
|
||||||
+ "; permName: " + permName
|
|
||||||
+ ", uid: " + uid
|
|
||||||
+ ", caller: " + Binder.getCallingUid(),
|
|
||||||
new Throwable());
|
|
||||||
} else {
|
|
||||||
// definitely shared user
|
|
||||||
Log.e(TAG, "Failed to find package"
|
|
||||||
+ "; permName: " + permName
|
|
||||||
+ ", uid: " + uid
|
|
||||||
+ ", caller: " + Binder.getCallingUid()
|
|
||||||
+ ", packages: " + Arrays.toString(packageNames),
|
|
||||||
new Throwable());
|
|
||||||
}
|
|
||||||
// run again just to try to get debug output
|
|
||||||
getPackagesForUid_debug(uid, true);
|
|
||||||
}
|
|
||||||
return mPermissionManager.checkUidPermission(permName, pkg, uid, getCallingUid());
|
return mPermissionManager.checkUidPermission(permName, pkg, uid, getCallingUid());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -6391,25 +6370,15 @@ public class PackageManagerService extends IPackageManager.Stub
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String[] getPackagesForUid(int uid) {
|
public String[] getPackagesForUid(int uid) {
|
||||||
return getPackagesForUid_debug(uid, false);
|
|
||||||
}
|
|
||||||
// Debug output for b/111075456
|
|
||||||
private String[] getPackagesForUid_debug(int uid, boolean debug) {
|
|
||||||
final int callingUid = Binder.getCallingUid();
|
final int callingUid = Binder.getCallingUid();
|
||||||
final boolean isCallerInstantApp = getInstantAppPackageName(callingUid) != null;
|
final boolean isCallerInstantApp = getInstantAppPackageName(callingUid) != null;
|
||||||
final int userId = UserHandle.getUserId(uid);
|
final int userId = UserHandle.getUserId(uid);
|
||||||
final int appId = UserHandle.getAppId(uid);
|
final int appId = UserHandle.getAppId(uid);
|
||||||
if (debug) Slog.e(TAG, "Finding packages for UID"
|
|
||||||
+ "; uid: " + uid
|
|
||||||
+ ", userId: " + userId
|
|
||||||
+ ", appId: " + appId
|
|
||||||
+ ", caller: " + callingUid);
|
|
||||||
// reader
|
// reader
|
||||||
synchronized (mPackages) {
|
synchronized (mPackages) {
|
||||||
final Object obj = mSettings.getSettingLPr(appId);
|
final Object obj = mSettings.getSettingLPr(appId);
|
||||||
if (obj instanceof SharedUserSetting) {
|
if (obj instanceof SharedUserSetting) {
|
||||||
if (isCallerInstantApp) {
|
if (isCallerInstantApp) {
|
||||||
if (debug) Slog.e(TAG, "Caller is instant and package has shared users");
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
final SharedUserSetting sus = (SharedUserSetting) obj;
|
final SharedUserSetting sus = (SharedUserSetting) obj;
|
||||||
@@ -6417,13 +6386,8 @@ public class PackageManagerService extends IPackageManager.Stub
|
|||||||
String[] res = new String[N];
|
String[] res = new String[N];
|
||||||
final Iterator<PackageSetting> it = sus.packages.iterator();
|
final Iterator<PackageSetting> it = sus.packages.iterator();
|
||||||
int i = 0;
|
int i = 0;
|
||||||
if (debug && !it.hasNext()) Slog.e(TAG, "Shared user, but, no packages");
|
|
||||||
while (it.hasNext()) {
|
while (it.hasNext()) {
|
||||||
PackageSetting ps = it.next();
|
PackageSetting ps = it.next();
|
||||||
if (debug) Slog.e(TAG, "Check shared package"
|
|
||||||
+ "; installed? " + ps.getInstalled(userId)
|
|
||||||
+ ", shared setting: " + ps
|
|
||||||
+ ", package setting: " + mSettings.mPackages.get(ps.name));
|
|
||||||
if (ps.getInstalled(userId)) {
|
if (ps.getInstalled(userId)) {
|
||||||
res[i++] = ps.name;
|
res[i++] = ps.name;
|
||||||
} else {
|
} else {
|
||||||
@@ -6436,12 +6400,6 @@ public class PackageManagerService extends IPackageManager.Stub
|
|||||||
if (ps.getInstalled(userId) && !filterAppAccessLPr(ps, callingUid, userId)) {
|
if (ps.getInstalled(userId) && !filterAppAccessLPr(ps, callingUid, userId)) {
|
||||||
return new String[]{ps.name};
|
return new String[]{ps.name};
|
||||||
}
|
}
|
||||||
if (debug) Slog.e(TAG, "Removing normal package"
|
|
||||||
+ "; installed? " + ps.getInstalled(userId)
|
|
||||||
+ ", filtered? " + filterAppAccessLPr(ps, callingUid, userId));
|
|
||||||
} else if (debug) {
|
|
||||||
if (debug) Slog.e(TAG, "No setting found"
|
|
||||||
+ "; obj: " + (obj == null ? "<<NULL>>" : obj.toString()));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
Reference in New Issue
Block a user