PackageManager: don't call Debug.getCallers() for an error message

Debug.getCallers is expensive, so don't call it as part of a potential
exception message.

Test: no Debug.getCallers runtime
Bug: 161323622

Change-Id: Iffe875edc3d8a7d55941642680d604a0862a7eb4
This commit is contained in:
Tim Murray
2020-12-01 19:19:59 +00:00
parent 74f5161e3d
commit 0d14e02d42

View File

@@ -260,7 +260,6 @@ import android.net.Uri;
import android.os.Binder;
import android.os.Build;
import android.os.Bundle;
import android.os.Debug;
import android.os.Environment;
import android.os.FileUtils;
import android.os.Handler;
@@ -5529,8 +5528,7 @@ public class PackageManagerService extends IPackageManager.Stub
// to the same user is not sufficient
enforceCrossUserPermission(Binder.getCallingUid(), userId, false, false,
!isRecentsAccessingChildProfiles(Binder.getCallingUid(), userId),
"MATCH_ANY_USER flag requires INTERACT_ACROSS_USERS permission at "
+ Debug.getCallers(5));
"MATCH_ANY_USER flag requires INTERACT_ACROSS_USERS permission");
} else if ((flags & PackageManager.MATCH_UNINSTALLED_PACKAGES) != 0 && isCallerSystemUser
&& mUserManager.hasManagedProfile(UserHandle.USER_SYSTEM)) {
// If the caller wants all packages and has a restricted profile associated with it,