Merge "Yet another set of installd Binder methods."
This commit is contained in:
@@ -204,35 +204,70 @@ public final class Installer extends SystemService {
|
|||||||
outputPath, dexFlags, compilerFilter, volumeUuid, sharedLibraries);
|
outputPath, dexFlags, compilerFilter, volumeUuid, sharedLibraries);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean mergeProfiles(int uid, String pkgName) throws InstallerException {
|
public boolean mergeProfiles(int uid, String packageName) throws InstallerException {
|
||||||
return mInstaller.mergeProfiles(uid, pkgName);
|
checkLock();
|
||||||
|
try {
|
||||||
|
return mInstalld.mergeProfiles(uid, packageName);
|
||||||
|
} catch (RemoteException | ServiceSpecificException e) {
|
||||||
|
throw new InstallerException(e.getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean dumpProfiles(String gid, String packageName, String codePaths)
|
public boolean dumpProfiles(int uid, String packageName, String codePaths)
|
||||||
throws InstallerException {
|
throws InstallerException {
|
||||||
return mInstaller.dumpProfiles(gid, packageName, codePaths);
|
checkLock();
|
||||||
|
try {
|
||||||
|
return mInstalld.dumpProfiles(uid, packageName, codePaths);
|
||||||
|
} catch (RemoteException | ServiceSpecificException e) {
|
||||||
|
throw new InstallerException(e.getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void idmap(String targetApkPath, String overlayApkPath, int uid)
|
public void idmap(String targetApkPath, String overlayApkPath, int uid)
|
||||||
throws InstallerException {
|
throws InstallerException {
|
||||||
mInstaller.execute("idmap", targetApkPath, overlayApkPath, uid);
|
checkLock();
|
||||||
|
try {
|
||||||
|
mInstalld.idmap(targetApkPath, overlayApkPath, uid);
|
||||||
|
} catch (RemoteException | ServiceSpecificException e) {
|
||||||
|
throw new InstallerException(e.getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void rmdex(String codePath, String instructionSet) throws InstallerException {
|
public void rmdex(String codePath, String instructionSet) throws InstallerException {
|
||||||
assertValidInstructionSet(instructionSet);
|
assertValidInstructionSet(instructionSet);
|
||||||
mInstaller.execute("rmdex", codePath, instructionSet);
|
checkLock();
|
||||||
|
try {
|
||||||
|
mInstalld.rmdex(codePath, instructionSet);
|
||||||
|
} catch (RemoteException | ServiceSpecificException e) {
|
||||||
|
throw new InstallerException(e.getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void rmPackageDir(String packageDir) throws InstallerException {
|
public void rmPackageDir(String packageDir) throws InstallerException {
|
||||||
mInstaller.execute("rmpackagedir", packageDir);
|
checkLock();
|
||||||
|
try {
|
||||||
|
mInstalld.rmPackageDir(packageDir);
|
||||||
|
} catch (RemoteException | ServiceSpecificException e) {
|
||||||
|
throw new InstallerException(e.getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void clearAppProfiles(String pkgName) throws InstallerException {
|
public void clearAppProfiles(String packageName) throws InstallerException {
|
||||||
mInstaller.execute("clear_app_profiles", pkgName);
|
checkLock();
|
||||||
|
try {
|
||||||
|
mInstalld.clearAppProfiles(packageName);
|
||||||
|
} catch (RemoteException | ServiceSpecificException e) {
|
||||||
|
throw new InstallerException(e.getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void destroyAppProfiles(String pkgName) throws InstallerException {
|
public void destroyAppProfiles(String packageName) throws InstallerException {
|
||||||
mInstaller.execute("destroy_app_profiles", pkgName);
|
checkLock();
|
||||||
|
try {
|
||||||
|
mInstalld.destroyAppProfiles(packageName);
|
||||||
|
} catch (RemoteException | ServiceSpecificException e) {
|
||||||
|
throw new InstallerException(e.getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void createUserData(String uuid, int userId, int userSerial, int flags)
|
public void createUserData(String uuid, int userId, int userSerial, int flags)
|
||||||
@@ -256,11 +291,21 @@ public final class Installer extends SystemService {
|
|||||||
|
|
||||||
public void markBootComplete(String instructionSet) throws InstallerException {
|
public void markBootComplete(String instructionSet) throws InstallerException {
|
||||||
assertValidInstructionSet(instructionSet);
|
assertValidInstructionSet(instructionSet);
|
||||||
mInstaller.execute("markbootcomplete", instructionSet);
|
checkLock();
|
||||||
|
try {
|
||||||
|
mInstalld.markBootComplete(instructionSet);
|
||||||
|
} catch (RemoteException | ServiceSpecificException e) {
|
||||||
|
throw new InstallerException(e.getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void freeCache(String uuid, long freeStorageSize) throws InstallerException {
|
public void freeCache(String uuid, long freeStorageSize) throws InstallerException {
|
||||||
mInstaller.execute("freecache", uuid, freeStorageSize);
|
checkLock();
|
||||||
|
try {
|
||||||
|
mInstalld.freeCache(uuid, freeStorageSize);
|
||||||
|
} catch (RemoteException | ServiceSpecificException e) {
|
||||||
|
throw new InstallerException(e.getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -268,29 +313,54 @@ public final class Installer extends SystemService {
|
|||||||
* directory to the real location for backward compatibility. Note that no
|
* directory to the real location for backward compatibility. Note that no
|
||||||
* such symlink is created for 64 bit shared libraries.
|
* such symlink is created for 64 bit shared libraries.
|
||||||
*/
|
*/
|
||||||
public void linkNativeLibraryDirectory(String uuid, String dataPath, String nativeLibPath32,
|
public void linkNativeLibraryDirectory(String uuid, String packageName, String nativeLibPath32,
|
||||||
int userId) throws InstallerException {
|
int userId) throws InstallerException {
|
||||||
mInstaller.execute("linklib", uuid, dataPath, nativeLibPath32, userId);
|
checkLock();
|
||||||
|
try {
|
||||||
|
mInstalld.linkNativeLibraryDirectory(uuid, packageName, nativeLibPath32, userId);
|
||||||
|
} catch (RemoteException | ServiceSpecificException e) {
|
||||||
|
throw new InstallerException(e.getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void createOatDir(String oatDir, String dexInstructionSet)
|
public void createOatDir(String oatDir, String dexInstructionSet)
|
||||||
throws InstallerException {
|
throws InstallerException {
|
||||||
mInstaller.execute("createoatdir", oatDir, dexInstructionSet);
|
checkLock();
|
||||||
|
try {
|
||||||
|
mInstalld.createOatDir(oatDir, dexInstructionSet);
|
||||||
|
} catch (RemoteException | ServiceSpecificException e) {
|
||||||
|
throw new InstallerException(e.getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void linkFile(String relativePath, String fromBase, String toBase)
|
public void linkFile(String relativePath, String fromBase, String toBase)
|
||||||
throws InstallerException {
|
throws InstallerException {
|
||||||
mInstaller.execute("linkfile", relativePath, fromBase, toBase);
|
checkLock();
|
||||||
|
try {
|
||||||
|
mInstalld.linkFile(relativePath, fromBase, toBase);
|
||||||
|
} catch (RemoteException | ServiceSpecificException e) {
|
||||||
|
throw new InstallerException(e.getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void moveAb(String apkPath, String instructionSet, String outputPath)
|
public void moveAb(String apkPath, String instructionSet, String outputPath)
|
||||||
throws InstallerException {
|
throws InstallerException {
|
||||||
mInstaller.execute("move_ab", apkPath, instructionSet, outputPath);
|
checkLock();
|
||||||
|
try {
|
||||||
|
mInstalld.moveAb(apkPath, instructionSet, outputPath);
|
||||||
|
} catch (RemoteException | ServiceSpecificException e) {
|
||||||
|
throw new InstallerException(e.getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void deleteOdex(String apkPath, String instructionSet, String outputPath)
|
public void deleteOdex(String apkPath, String instructionSet, String outputPath)
|
||||||
throws InstallerException {
|
throws InstallerException {
|
||||||
mInstaller.execute("delete_odex", apkPath, instructionSet, outputPath);
|
checkLock();
|
||||||
|
try {
|
||||||
|
mInstalld.deleteOdex(apkPath, instructionSet, outputPath);
|
||||||
|
} catch (RemoteException | ServiceSpecificException e) {
|
||||||
|
throw new InstallerException(e.getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void assertValidInstructionSet(String instructionSet)
|
private static void assertValidInstructionSet(String instructionSet)
|
||||||
|
|||||||
@@ -7530,9 +7530,8 @@ public class PackageManagerService extends IPackageManager.Stub {
|
|||||||
final int sharedGid = UserHandle.getSharedAppGid(pkg.applicationInfo.uid);
|
final int sharedGid = UserHandle.getSharedAppGid(pkg.applicationInfo.uid);
|
||||||
try {
|
try {
|
||||||
List<String> allCodePaths = pkg.getAllCodePathsExcludingResourceOnly();
|
List<String> allCodePaths = pkg.getAllCodePathsExcludingResourceOnly();
|
||||||
String gid = Integer.toString(sharedGid);
|
|
||||||
String codePaths = TextUtils.join(";", allCodePaths);
|
String codePaths = TextUtils.join(";", allCodePaths);
|
||||||
mInstaller.dumpProfiles(gid, packageName, codePaths);
|
mInstaller.dumpProfiles(sharedGid, packageName, codePaths);
|
||||||
} catch (InstallerException e) {
|
} catch (InstallerException e) {
|
||||||
Slog.w(TAG, "Failed to dump profiles", e);
|
Slog.w(TAG, "Failed to dump profiles", e);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user