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

Change-Id: I2ddb87f4954afd51017853101dbcf7c91f2732e1
This commit is contained in:
TreeHugger Robot
2020-04-27 22:37:32 +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.net.Uri;
import android.os.Process;
import android.os.RemoteException;
import android.text.TextUtils;
import android.util.Pair;
@@ -140,7 +139,7 @@ public class OverlayActorEnforcer {
return ActorState.MISSING_LEGACY_PERMISSION;
}
}
} catch (RemoteException | IOException e) {
} catch (IOException e) {
return ActorState.ERROR_READING_OVERLAYABLE;
}
}

View File

@@ -1151,9 +1151,8 @@ public final class OverlayManagerService extends SystemService {
@Override
public boolean doesTargetDefineOverlayable(String targetPackageName, int userId)
throws RemoteException, IOException {
PackageInfo packageInfo = mPackageManager.getPackageInfo(targetPackageName, 0,
userId);
throws IOException {
PackageInfo packageInfo = getPackageInfo(targetPackageName, userId);
if (packageInfo == null) {
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.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.os.RemoteException;
import com.android.server.pm.PackageManagerServiceUtils;
@@ -68,8 +67,7 @@ public interface OverlayableInfoCallback {
/**
* @return true if the target package has declared an overlayable
*/
boolean doesTargetDefineOverlayable(String targetPackageName, int userId)
throws RemoteException, IOException;
boolean doesTargetDefineOverlayable(String targetPackageName, int userId) throws IOException;
/**
* @throws SecurityException containing message if the caller doesn't have the given