Merge "Use cached getPackageInfo for target overlayable" into rvc-dev am: f1a1caadb5 am: 23f409c101

Change-Id: I5ade3f5a35fae028a9bc14985d2b998175ba99b0
This commit is contained in:
TreeHugger Robot
2020-04-27 22:26:55 +00:00
committed by Automerger Merge Worker
3 changed files with 4 additions and 8 deletions

View File

@@ -23,7 +23,6 @@ import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo; import android.content.pm.PackageInfo;
import android.net.Uri; import android.net.Uri;
import android.os.Process; import android.os.Process;
import android.os.RemoteException;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Pair; import android.util.Pair;
@@ -140,7 +139,7 @@ public class OverlayActorEnforcer {
return ActorState.MISSING_LEGACY_PERMISSION; return ActorState.MISSING_LEGACY_PERMISSION;
} }
} }
} catch (RemoteException | IOException e) { } catch (IOException e) {
return ActorState.ERROR_READING_OVERLAYABLE; return ActorState.ERROR_READING_OVERLAYABLE;
} }
} }

View File

@@ -1151,9 +1151,8 @@ public final class OverlayManagerService extends SystemService {
@Override @Override
public boolean doesTargetDefineOverlayable(String targetPackageName, int userId) public boolean doesTargetDefineOverlayable(String targetPackageName, int userId)
throws RemoteException, IOException { throws IOException {
PackageInfo packageInfo = mPackageManager.getPackageInfo(targetPackageName, 0, PackageInfo packageInfo = getPackageInfo(targetPackageName, userId);
userId);
if (packageInfo == null) { if (packageInfo == null) {
throw new IOException("Unable to get target package"); throw new IOException("Unable to get target package");
} }

View File

@@ -22,7 +22,6 @@ import android.annotation.Nullable;
import android.content.om.OverlayableInfo; import android.content.om.OverlayableInfo;
import android.content.pm.PackageInfo; import android.content.pm.PackageInfo;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.os.RemoteException;
import com.android.server.pm.PackageManagerServiceUtils; import com.android.server.pm.PackageManagerServiceUtils;
@@ -68,8 +67,7 @@ public interface OverlayableInfoCallback {
/** /**
* @return true if the target package has declared an overlayable * @return true if the target package has declared an overlayable
*/ */
boolean doesTargetDefineOverlayable(String targetPackageName, int userId) boolean doesTargetDefineOverlayable(String targetPackageName, int userId) throws IOException;
throws RemoteException, IOException;
/** /**
* @throws SecurityException containing message if the caller doesn't have the given * @throws SecurityException containing message if the caller doesn't have the given