Methods Summary |
---|
public int | clearUserData(java.lang.String name, int userId)
StringBuilder builder = new StringBuilder("rmuserdata");
builder.append(' ");
builder.append(name);
builder.append(' ");
builder.append(userId);
return mInstaller.execute(builder.toString());
|
public int | createUserConfig(int userId)
StringBuilder builder = new StringBuilder("mkuserconfig");
builder.append(' ");
builder.append(userId);
return mInstaller.execute(builder.toString());
|
public int | createUserData(java.lang.String name, int uid, int userId, java.lang.String seinfo)
StringBuilder builder = new StringBuilder("mkuserdata");
builder.append(' ");
builder.append(name);
builder.append(' ");
builder.append(uid);
builder.append(' ");
builder.append(userId);
builder.append(' ");
builder.append(seinfo != null ? seinfo : "!");
return mInstaller.execute(builder.toString());
|
public int | deleteCacheFiles(java.lang.String name, int userId)
StringBuilder builder = new StringBuilder("rmcache");
builder.append(' ");
builder.append(name);
builder.append(' ");
builder.append(userId);
return mInstaller.execute(builder.toString());
|
public int | deleteCodeCacheFiles(java.lang.String name, int userId)
StringBuilder builder = new StringBuilder("rmcodecache");
builder.append(' ");
builder.append(name);
builder.append(' ");
builder.append(userId);
return mInstaller.execute(builder.toString());
|
public int | dexopt(java.lang.String apkPath, int uid, boolean isPublic, java.lang.String instructionSet)
if (!isValidInstructionSet(instructionSet)) {
Slog.e(TAG, "Invalid instruction set: " + instructionSet);
return -1;
}
return mInstaller.dexopt(apkPath, uid, isPublic, instructionSet);
|
public int | dexopt(java.lang.String apkPath, int uid, boolean isPublic, java.lang.String pkgName, java.lang.String instructionSet, boolean vmSafeMode)
if (!isValidInstructionSet(instructionSet)) {
Slog.e(TAG, "Invalid instruction set: " + instructionSet);
return -1;
}
return mInstaller.dexopt(apkPath, uid, isPublic, pkgName, instructionSet, vmSafeMode);
|
public int | fixUid(java.lang.String name, int uid, int gid)
StringBuilder builder = new StringBuilder("fixuid");
builder.append(' ");
builder.append(name);
builder.append(' ");
builder.append(uid);
builder.append(' ");
builder.append(gid);
return mInstaller.execute(builder.toString());
|
public int | freeCache(long freeStorageSize)
StringBuilder builder = new StringBuilder("freecache");
builder.append(' ");
builder.append(String.valueOf(freeStorageSize));
return mInstaller.execute(builder.toString());
|
public int | getSizeInfo(java.lang.String pkgName, int persona, java.lang.String apkPath, java.lang.String libDirPath, java.lang.String fwdLockApkPath, java.lang.String asecPath, java.lang.String[] instructionSets, android.content.pm.PackageStats pStats)
for (String instructionSet : instructionSets) {
if (!isValidInstructionSet(instructionSet)) {
Slog.e(TAG, "Invalid instruction set: " + instructionSet);
return -1;
}
}
StringBuilder builder = new StringBuilder("getsize");
builder.append(' ");
builder.append(pkgName);
builder.append(' ");
builder.append(persona);
builder.append(' ");
builder.append(apkPath);
builder.append(' ");
// TODO: Extend getSizeInfo to look at the full subdirectory tree,
// not just the first level.
builder.append(libDirPath != null ? libDirPath : "!");
builder.append(' ");
builder.append(fwdLockApkPath != null ? fwdLockApkPath : "!");
builder.append(' ");
builder.append(asecPath != null ? asecPath : "!");
builder.append(' ");
// TODO: Extend getSizeInfo to look at *all* instrution sets, not
// just the primary.
builder.append(instructionSets[0]);
String s = mInstaller.transact(builder.toString());
String res[] = s.split(" ");
if ((res == null) || (res.length != 5)) {
return -1;
}
try {
pStats.codeSize = Long.parseLong(res[1]);
pStats.dataSize = Long.parseLong(res[2]);
pStats.cacheSize = Long.parseLong(res[3]);
pStats.externalCodeSize = Long.parseLong(res[4]);
return Integer.parseInt(res[0]);
} catch (NumberFormatException e) {
return -1;
}
|
public int | idmap(java.lang.String targetApkPath, java.lang.String overlayApkPath, int uid)
StringBuilder builder = new StringBuilder("idmap");
builder.append(' ");
builder.append(targetApkPath);
builder.append(' ");
builder.append(overlayApkPath);
builder.append(' ");
builder.append(uid);
return mInstaller.execute(builder.toString());
|
public int | install(java.lang.String name, int uid, int gid, java.lang.String seinfo)
StringBuilder builder = new StringBuilder("install");
builder.append(' ");
builder.append(name);
builder.append(' ");
builder.append(uid);
builder.append(' ");
builder.append(gid);
builder.append(' ");
builder.append(seinfo != null ? seinfo : "!");
return mInstaller.execute(builder.toString());
|
private static boolean | isValidInstructionSet(java.lang.String instructionSet)Returns true iff. {@code instructionSet} is a valid instruction set.
if (instructionSet == null) {
return false;
}
for (String abi : Build.SUPPORTED_ABIS) {
if (instructionSet.equals(VMRuntime.getInstructionSet(abi))) {
return true;
}
}
return false;
|
public int | linkNativeLibraryDirectory(java.lang.String dataPath, java.lang.String nativeLibPath32, int userId)Links the 32 bit native library directory in an application's data directory to the
real location for backward compatibility. Note that no such symlink is created for
64 bit shared libraries.
if (dataPath == null) {
Slog.e(TAG, "linkNativeLibraryDirectory dataPath is null");
return -1;
} else if (nativeLibPath32 == null) {
Slog.e(TAG, "linkNativeLibraryDirectory nativeLibPath is null");
return -1;
}
StringBuilder builder = new StringBuilder("linklib ");
builder.append(dataPath);
builder.append(' ");
builder.append(nativeLibPath32);
builder.append(' ");
builder.append(userId);
return mInstaller.execute(builder.toString());
|
public int | markBootComplete(java.lang.String instructionSet)
if (!isValidInstructionSet(instructionSet)) {
Slog.e(TAG, "Invalid instruction set: " + instructionSet);
return -1;
}
StringBuilder builder = new StringBuilder("markbootcomplete");
builder.append(' ");
builder.append(instructionSet);
return mInstaller.execute(builder.toString());
|
public int | moveFiles()
return mInstaller.execute("movefiles");
|
public int | movedex(java.lang.String srcPath, java.lang.String dstPath, java.lang.String instructionSet)
if (!isValidInstructionSet(instructionSet)) {
Slog.e(TAG, "Invalid instruction set: " + instructionSet);
return -1;
}
StringBuilder builder = new StringBuilder("movedex");
builder.append(' ");
builder.append(srcPath);
builder.append(' ");
builder.append(dstPath);
builder.append(' ");
builder.append(instructionSet);
return mInstaller.execute(builder.toString());
|
public void | onStart()
Slog.i(TAG, "Waiting for installd to be ready.");
ping();
|
public int | patchoat(java.lang.String apkPath, int uid, boolean isPublic, java.lang.String pkgName, java.lang.String instructionSet)
if (!isValidInstructionSet(instructionSet)) {
Slog.e(TAG, "Invalid instruction set: " + instructionSet);
return -1;
}
return mInstaller.patchoat(apkPath, uid, isPublic, pkgName, instructionSet);
|
public int | patchoat(java.lang.String apkPath, int uid, boolean isPublic, java.lang.String instructionSet)
if (!isValidInstructionSet(instructionSet)) {
Slog.e(TAG, "Invalid instruction set: " + instructionSet);
return -1;
}
return mInstaller.patchoat(apkPath, uid, isPublic, instructionSet);
|
public boolean | ping()
if (mInstaller.execute("ping") < 0) {
return false;
} else {
return true;
}
|
public int | remove(java.lang.String name, int userId)
StringBuilder builder = new StringBuilder("remove");
builder.append(' ");
builder.append(name);
builder.append(' ");
builder.append(userId);
return mInstaller.execute(builder.toString());
|
public int | removeUserDataDirs(int userId)
StringBuilder builder = new StringBuilder("rmuser");
builder.append(' ");
builder.append(userId);
return mInstaller.execute(builder.toString());
|
public int | rename(java.lang.String oldname, java.lang.String newname)
StringBuilder builder = new StringBuilder("rename");
builder.append(' ");
builder.append(oldname);
builder.append(' ");
builder.append(newname);
return mInstaller.execute(builder.toString());
|
public boolean | restoreconData(java.lang.String pkgName, java.lang.String seinfo, int uid)
StringBuilder builder = new StringBuilder("restorecondata");
builder.append(' ");
builder.append(pkgName);
builder.append(' ");
builder.append(seinfo != null ? seinfo : "!");
builder.append(' ");
builder.append(uid);
return (mInstaller.execute(builder.toString()) == 0);
|
public int | rmdex(java.lang.String codePath, java.lang.String instructionSet)
if (!isValidInstructionSet(instructionSet)) {
Slog.e(TAG, "Invalid instruction set: " + instructionSet);
return -1;
}
StringBuilder builder = new StringBuilder("rmdex");
builder.append(' ");
builder.append(codePath);
builder.append(' ");
builder.append(instructionSet);
return mInstaller.execute(builder.toString());
|