Merge "Setting Session commited broadcast when an existing apk is enabled for a different user" into oc-dev
This commit is contained in:
@@ -1696,15 +1696,27 @@ public class ApplicationPackageManager extends PackageManager {
|
||||
|
||||
@Override
|
||||
public int installExistingPackage(String packageName) throws NameNotFoundException {
|
||||
return installExistingPackageAsUser(packageName, mContext.getUserId());
|
||||
return installExistingPackage(packageName, PackageManager.INSTALL_REASON_UNKNOWN);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int installExistingPackage(String packageName, int installReason)
|
||||
throws NameNotFoundException {
|
||||
return installExistingPackageAsUser(packageName, installReason, mContext.getUserId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int installExistingPackageAsUser(String packageName, int userId)
|
||||
throws NameNotFoundException {
|
||||
return installExistingPackageAsUser(packageName, PackageManager.INSTALL_REASON_UNKNOWN,
|
||||
userId);
|
||||
}
|
||||
|
||||
private int installExistingPackageAsUser(String packageName, int installReason, int userId)
|
||||
throws NameNotFoundException {
|
||||
try {
|
||||
int res = mPM.installExistingPackageAsUser(packageName, userId, 0 /*installFlags*/,
|
||||
PackageManager.INSTALL_REASON_UNKNOWN);
|
||||
installReason);
|
||||
if (res == INSTALL_FAILED_INVALID_URI) {
|
||||
throw new NameNotFoundException("Package " + packageName + " doesn't exist");
|
||||
}
|
||||
|
||||
@@ -4628,6 +4628,14 @@ public abstract class PackageManager {
|
||||
*/
|
||||
public abstract int installExistingPackage(String packageName) throws NameNotFoundException;
|
||||
|
||||
/**
|
||||
* If there is already an application with the given package name installed
|
||||
* on the system for other users, also install it for the calling user.
|
||||
* @hide
|
||||
*/
|
||||
public abstract int installExistingPackage(String packageName, @InstallReason int installReason)
|
||||
throws NameNotFoundException;
|
||||
|
||||
/**
|
||||
* If there is already an application with the given package name installed
|
||||
* on the system for other users, also install it for the specified user.
|
||||
|
||||
Reference in New Issue
Block a user