Loading core/java/android/os/ServiceSpecificException.java +5 −0 Original line number Diff line number Diff line Loading @@ -39,4 +39,9 @@ public class ServiceSpecificException extends RuntimeException { public ServiceSpecificException(int errorCode) { this.errorCode = errorCode; } @Override public String toString() { return super.toString() + " (code " + errorCode + ")"; } } services/core/java/com/android/server/pm/Installer.java +26 −28 Original line number Diff line number Diff line Loading @@ -21,9 +21,7 @@ import android.content.Context; import android.content.pm.PackageStats; import android.os.Build; import android.os.IInstalld; import android.os.RemoteException; import android.os.ServiceManager; import android.os.ServiceSpecificException; import android.util.Slog; import com.android.server.SystemService; Loading Loading @@ -113,7 +111,7 @@ public class Installer extends SystemService { try { mInstalld.createAppData(uuid, packageName, userId, flags, appId, seInfo, targetSdkVersion); } catch (RemoteException | ServiceSpecificException e) { } catch (Exception e) { throw InstallerException.from(e); } } Loading @@ -123,7 +121,7 @@ public class Installer extends SystemService { if (!checkBeforeRemote()) return; try { mInstalld.restoreconAppData(uuid, packageName, userId, flags, appId, seInfo); } catch (RemoteException | ServiceSpecificException e) { } catch (Exception e) { throw InstallerException.from(e); } } Loading @@ -133,7 +131,7 @@ public class Installer extends SystemService { if (!checkBeforeRemote()) return; try { mInstalld.migrateAppData(uuid, packageName, userId, flags); } catch (RemoteException | ServiceSpecificException e) { } catch (Exception e) { throw InstallerException.from(e); } } Loading @@ -143,7 +141,7 @@ public class Installer extends SystemService { if (!checkBeforeRemote()) return; try { mInstalld.clearAppData(uuid, packageName, userId, flags, ceDataInode); } catch (RemoteException | ServiceSpecificException e) { } catch (Exception e) { throw InstallerException.from(e); } } Loading @@ -153,7 +151,7 @@ public class Installer extends SystemService { if (!checkBeforeRemote()) return; try { mInstalld.destroyAppData(uuid, packageName, userId, flags, ceDataInode); } catch (RemoteException | ServiceSpecificException e) { } catch (Exception e) { throw InstallerException.from(e); } } Loading @@ -165,7 +163,7 @@ public class Installer extends SystemService { try { mInstalld.moveCompleteApp(fromUuid, toUuid, packageName, dataAppName, appId, seInfo, targetSdkVersion); } catch (RemoteException | ServiceSpecificException e) { } catch (Exception e) { throw InstallerException.from(e); } } Loading @@ -179,7 +177,7 @@ public class Installer extends SystemService { stats.codeSize += res[0]; stats.dataSize += res[1]; stats.cacheSize += res[2]; } catch (RemoteException | ServiceSpecificException e) { } catch (Exception e) { throw InstallerException.from(e); } } Loading @@ -189,7 +187,7 @@ public class Installer extends SystemService { if (!checkBeforeRemote()) return -1; try { return mInstalld.getAppDataInode(uuid, packageName, userId, flags); } catch (RemoteException | ServiceSpecificException e) { } catch (Exception e) { throw InstallerException.from(e); } } Loading @@ -203,7 +201,7 @@ public class Installer extends SystemService { try { mInstalld.dexopt(apkPath, uid, pkgName, instructionSet, dexoptNeeded, outputPath, dexFlags, compilerFilter, volumeUuid, sharedLibraries); } catch (RemoteException | ServiceSpecificException e) { } catch (Exception e) { throw InstallerException.from(e); } } Loading @@ -212,7 +210,7 @@ public class Installer extends SystemService { if (!checkBeforeRemote()) return false; try { return mInstalld.mergeProfiles(uid, packageName); } catch (RemoteException | ServiceSpecificException e) { } catch (Exception e) { throw InstallerException.from(e); } } Loading @@ -222,7 +220,7 @@ public class Installer extends SystemService { if (!checkBeforeRemote()) return false; try { return mInstalld.dumpProfiles(uid, packageName, codePaths); } catch (RemoteException | ServiceSpecificException e) { } catch (Exception e) { throw InstallerException.from(e); } } Loading @@ -232,7 +230,7 @@ public class Installer extends SystemService { if (!checkBeforeRemote()) return; try { mInstalld.idmap(targetApkPath, overlayApkPath, uid); } catch (RemoteException | ServiceSpecificException e) { } catch (Exception e) { throw InstallerException.from(e); } } Loading @@ -242,7 +240,7 @@ public class Installer extends SystemService { if (!checkBeforeRemote()) return; try { mInstalld.rmdex(codePath, instructionSet); } catch (RemoteException | ServiceSpecificException e) { } catch (Exception e) { throw InstallerException.from(e); } } Loading @@ -251,7 +249,7 @@ public class Installer extends SystemService { if (!checkBeforeRemote()) return; try { mInstalld.rmPackageDir(packageDir); } catch (RemoteException | ServiceSpecificException e) { } catch (Exception e) { throw InstallerException.from(e); } } Loading @@ -260,7 +258,7 @@ public class Installer extends SystemService { if (!checkBeforeRemote()) return; try { mInstalld.clearAppProfiles(packageName); } catch (RemoteException | ServiceSpecificException e) { } catch (Exception e) { throw InstallerException.from(e); } } Loading @@ -269,7 +267,7 @@ public class Installer extends SystemService { if (!checkBeforeRemote()) return; try { mInstalld.destroyAppProfiles(packageName); } catch (RemoteException | ServiceSpecificException e) { } catch (Exception e) { throw InstallerException.from(e); } } Loading @@ -279,7 +277,7 @@ public class Installer extends SystemService { if (!checkBeforeRemote()) return; try { mInstalld.createUserData(uuid, userId, userSerial, flags); } catch (RemoteException | ServiceSpecificException e) { } catch (Exception e) { throw InstallerException.from(e); } } Loading @@ -288,7 +286,7 @@ public class Installer extends SystemService { if (!checkBeforeRemote()) return; try { mInstalld.destroyUserData(uuid, userId, flags); } catch (RemoteException | ServiceSpecificException e) { } catch (Exception e) { throw InstallerException.from(e); } } Loading @@ -298,7 +296,7 @@ public class Installer extends SystemService { if (!checkBeforeRemote()) return; try { mInstalld.markBootComplete(instructionSet); } catch (RemoteException | ServiceSpecificException e) { } catch (Exception e) { throw InstallerException.from(e); } } Loading @@ -307,7 +305,7 @@ public class Installer extends SystemService { if (!checkBeforeRemote()) return; try { mInstalld.freeCache(uuid, freeStorageSize); } catch (RemoteException | ServiceSpecificException e) { } catch (Exception e) { throw InstallerException.from(e); } } Loading @@ -322,7 +320,7 @@ public class Installer extends SystemService { if (!checkBeforeRemote()) return; try { mInstalld.linkNativeLibraryDirectory(uuid, packageName, nativeLibPath32, userId); } catch (RemoteException | ServiceSpecificException e) { } catch (Exception e) { throw InstallerException.from(e); } } Loading @@ -332,7 +330,7 @@ public class Installer extends SystemService { if (!checkBeforeRemote()) return; try { mInstalld.createOatDir(oatDir, dexInstructionSet); } catch (RemoteException | ServiceSpecificException e) { } catch (Exception e) { throw InstallerException.from(e); } } Loading @@ -342,7 +340,7 @@ public class Installer extends SystemService { if (!checkBeforeRemote()) return; try { mInstalld.linkFile(relativePath, fromBase, toBase); } catch (RemoteException | ServiceSpecificException e) { } catch (Exception e) { throw InstallerException.from(e); } } Loading @@ -352,7 +350,7 @@ public class Installer extends SystemService { if (!checkBeforeRemote()) return; try { mInstalld.moveAb(apkPath, instructionSet, outputPath); } catch (RemoteException | ServiceSpecificException e) { } catch (Exception e) { throw InstallerException.from(e); } } Loading @@ -362,7 +360,7 @@ public class Installer extends SystemService { if (!checkBeforeRemote()) return; try { mInstalld.deleteOdex(apkPath, instructionSet, outputPath); } catch (RemoteException | ServiceSpecificException e) { } catch (Exception e) { throw InstallerException.from(e); } } Loading @@ -383,7 +381,7 @@ public class Installer extends SystemService { } public static InstallerException from(Exception e) throws InstallerException { throw new InstallerException(e.getMessage()); throw new InstallerException(e.toString()); } } } Loading
core/java/android/os/ServiceSpecificException.java +5 −0 Original line number Diff line number Diff line Loading @@ -39,4 +39,9 @@ public class ServiceSpecificException extends RuntimeException { public ServiceSpecificException(int errorCode) { this.errorCode = errorCode; } @Override public String toString() { return super.toString() + " (code " + errorCode + ")"; } }
services/core/java/com/android/server/pm/Installer.java +26 −28 Original line number Diff line number Diff line Loading @@ -21,9 +21,7 @@ import android.content.Context; import android.content.pm.PackageStats; import android.os.Build; import android.os.IInstalld; import android.os.RemoteException; import android.os.ServiceManager; import android.os.ServiceSpecificException; import android.util.Slog; import com.android.server.SystemService; Loading Loading @@ -113,7 +111,7 @@ public class Installer extends SystemService { try { mInstalld.createAppData(uuid, packageName, userId, flags, appId, seInfo, targetSdkVersion); } catch (RemoteException | ServiceSpecificException e) { } catch (Exception e) { throw InstallerException.from(e); } } Loading @@ -123,7 +121,7 @@ public class Installer extends SystemService { if (!checkBeforeRemote()) return; try { mInstalld.restoreconAppData(uuid, packageName, userId, flags, appId, seInfo); } catch (RemoteException | ServiceSpecificException e) { } catch (Exception e) { throw InstallerException.from(e); } } Loading @@ -133,7 +131,7 @@ public class Installer extends SystemService { if (!checkBeforeRemote()) return; try { mInstalld.migrateAppData(uuid, packageName, userId, flags); } catch (RemoteException | ServiceSpecificException e) { } catch (Exception e) { throw InstallerException.from(e); } } Loading @@ -143,7 +141,7 @@ public class Installer extends SystemService { if (!checkBeforeRemote()) return; try { mInstalld.clearAppData(uuid, packageName, userId, flags, ceDataInode); } catch (RemoteException | ServiceSpecificException e) { } catch (Exception e) { throw InstallerException.from(e); } } Loading @@ -153,7 +151,7 @@ public class Installer extends SystemService { if (!checkBeforeRemote()) return; try { mInstalld.destroyAppData(uuid, packageName, userId, flags, ceDataInode); } catch (RemoteException | ServiceSpecificException e) { } catch (Exception e) { throw InstallerException.from(e); } } Loading @@ -165,7 +163,7 @@ public class Installer extends SystemService { try { mInstalld.moveCompleteApp(fromUuid, toUuid, packageName, dataAppName, appId, seInfo, targetSdkVersion); } catch (RemoteException | ServiceSpecificException e) { } catch (Exception e) { throw InstallerException.from(e); } } Loading @@ -179,7 +177,7 @@ public class Installer extends SystemService { stats.codeSize += res[0]; stats.dataSize += res[1]; stats.cacheSize += res[2]; } catch (RemoteException | ServiceSpecificException e) { } catch (Exception e) { throw InstallerException.from(e); } } Loading @@ -189,7 +187,7 @@ public class Installer extends SystemService { if (!checkBeforeRemote()) return -1; try { return mInstalld.getAppDataInode(uuid, packageName, userId, flags); } catch (RemoteException | ServiceSpecificException e) { } catch (Exception e) { throw InstallerException.from(e); } } Loading @@ -203,7 +201,7 @@ public class Installer extends SystemService { try { mInstalld.dexopt(apkPath, uid, pkgName, instructionSet, dexoptNeeded, outputPath, dexFlags, compilerFilter, volumeUuid, sharedLibraries); } catch (RemoteException | ServiceSpecificException e) { } catch (Exception e) { throw InstallerException.from(e); } } Loading @@ -212,7 +210,7 @@ public class Installer extends SystemService { if (!checkBeforeRemote()) return false; try { return mInstalld.mergeProfiles(uid, packageName); } catch (RemoteException | ServiceSpecificException e) { } catch (Exception e) { throw InstallerException.from(e); } } Loading @@ -222,7 +220,7 @@ public class Installer extends SystemService { if (!checkBeforeRemote()) return false; try { return mInstalld.dumpProfiles(uid, packageName, codePaths); } catch (RemoteException | ServiceSpecificException e) { } catch (Exception e) { throw InstallerException.from(e); } } Loading @@ -232,7 +230,7 @@ public class Installer extends SystemService { if (!checkBeforeRemote()) return; try { mInstalld.idmap(targetApkPath, overlayApkPath, uid); } catch (RemoteException | ServiceSpecificException e) { } catch (Exception e) { throw InstallerException.from(e); } } Loading @@ -242,7 +240,7 @@ public class Installer extends SystemService { if (!checkBeforeRemote()) return; try { mInstalld.rmdex(codePath, instructionSet); } catch (RemoteException | ServiceSpecificException e) { } catch (Exception e) { throw InstallerException.from(e); } } Loading @@ -251,7 +249,7 @@ public class Installer extends SystemService { if (!checkBeforeRemote()) return; try { mInstalld.rmPackageDir(packageDir); } catch (RemoteException | ServiceSpecificException e) { } catch (Exception e) { throw InstallerException.from(e); } } Loading @@ -260,7 +258,7 @@ public class Installer extends SystemService { if (!checkBeforeRemote()) return; try { mInstalld.clearAppProfiles(packageName); } catch (RemoteException | ServiceSpecificException e) { } catch (Exception e) { throw InstallerException.from(e); } } Loading @@ -269,7 +267,7 @@ public class Installer extends SystemService { if (!checkBeforeRemote()) return; try { mInstalld.destroyAppProfiles(packageName); } catch (RemoteException | ServiceSpecificException e) { } catch (Exception e) { throw InstallerException.from(e); } } Loading @@ -279,7 +277,7 @@ public class Installer extends SystemService { if (!checkBeforeRemote()) return; try { mInstalld.createUserData(uuid, userId, userSerial, flags); } catch (RemoteException | ServiceSpecificException e) { } catch (Exception e) { throw InstallerException.from(e); } } Loading @@ -288,7 +286,7 @@ public class Installer extends SystemService { if (!checkBeforeRemote()) return; try { mInstalld.destroyUserData(uuid, userId, flags); } catch (RemoteException | ServiceSpecificException e) { } catch (Exception e) { throw InstallerException.from(e); } } Loading @@ -298,7 +296,7 @@ public class Installer extends SystemService { if (!checkBeforeRemote()) return; try { mInstalld.markBootComplete(instructionSet); } catch (RemoteException | ServiceSpecificException e) { } catch (Exception e) { throw InstallerException.from(e); } } Loading @@ -307,7 +305,7 @@ public class Installer extends SystemService { if (!checkBeforeRemote()) return; try { mInstalld.freeCache(uuid, freeStorageSize); } catch (RemoteException | ServiceSpecificException e) { } catch (Exception e) { throw InstallerException.from(e); } } Loading @@ -322,7 +320,7 @@ public class Installer extends SystemService { if (!checkBeforeRemote()) return; try { mInstalld.linkNativeLibraryDirectory(uuid, packageName, nativeLibPath32, userId); } catch (RemoteException | ServiceSpecificException e) { } catch (Exception e) { throw InstallerException.from(e); } } Loading @@ -332,7 +330,7 @@ public class Installer extends SystemService { if (!checkBeforeRemote()) return; try { mInstalld.createOatDir(oatDir, dexInstructionSet); } catch (RemoteException | ServiceSpecificException e) { } catch (Exception e) { throw InstallerException.from(e); } } Loading @@ -342,7 +340,7 @@ public class Installer extends SystemService { if (!checkBeforeRemote()) return; try { mInstalld.linkFile(relativePath, fromBase, toBase); } catch (RemoteException | ServiceSpecificException e) { } catch (Exception e) { throw InstallerException.from(e); } } Loading @@ -352,7 +350,7 @@ public class Installer extends SystemService { if (!checkBeforeRemote()) return; try { mInstalld.moveAb(apkPath, instructionSet, outputPath); } catch (RemoteException | ServiceSpecificException e) { } catch (Exception e) { throw InstallerException.from(e); } } Loading @@ -362,7 +360,7 @@ public class Installer extends SystemService { if (!checkBeforeRemote()) return; try { mInstalld.deleteOdex(apkPath, instructionSet, outputPath); } catch (RemoteException | ServiceSpecificException e) { } catch (Exception e) { throw InstallerException.from(e); } } Loading @@ -383,7 +381,7 @@ public class Installer extends SystemService { } public static InstallerException from(Exception e) throws InstallerException { throw new InstallerException(e.getMessage()); throw new InstallerException(e.toString()); } } }