Merge "Use cached getPackageInfo for target overlayable" into rvc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
f1a1caadb5
@@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user