Loading services/backup/java/com/android/server/backup/UserBackupManagerService.java +1 −1 Original line number Diff line number Diff line Loading @@ -1863,7 +1863,7 @@ public class UserBackupManagerService { // The agent was running with a stub Application object, so shut it down. // !!! We hardcode the confirmation UI's package name here rather than use a // manifest flag! TODO something less direct. if (app.uid >= Process.FIRST_APPLICATION_UID if (!UserHandle.isCore(app.uid) && !app.packageName.equals("com.android.backupconfirm")) { if (MORE_DEBUG) Slog.d(TAG, "Killing agent host process"); mActivityManager.killApplicationProcess(app.processName, app.uid); Loading services/backup/java/com/android/server/backup/restore/PerformUnifiedRestoreTask.java +2 −2 Original line number Diff line number Diff line Loading @@ -45,9 +45,9 @@ import android.content.pm.PackageManagerInternal; import android.os.Bundle; import android.os.Message; import android.os.ParcelFileDescriptor; import android.os.Process; import android.os.RemoteException; import android.os.SystemClock; import android.os.UserHandle; import android.util.EventLog; import android.util.Slog; Loading Loading @@ -1174,7 +1174,7 @@ public class PerformUnifiedRestoreTask implements BackupRestoreTask { // b. the app does not state android:killAfterRestore="false" in its manifest final int appFlags = mCurrentPackage.applicationInfo.flags; final boolean killAfterRestore = (mCurrentPackage.applicationInfo.uid >= Process.FIRST_APPLICATION_UID) !UserHandle.isCore(mCurrentPackage.applicationInfo.uid) && ((mRestoreDescription.getDataType() == RestoreDescription.TYPE_FULL_STREAM) || ((appFlags & ApplicationInfo.FLAG_KILL_AFTER_RESTORE) != 0)); Loading services/backup/java/com/android/server/backup/utils/AppBackupUtils.java +1 −2 Original line number Diff line number Diff line Loading @@ -31,7 +31,6 @@ import android.content.pm.PackageManager; import android.content.pm.PackageManagerInternal; import android.content.pm.Signature; import android.content.pm.SigningInfo; import android.os.Process; import android.os.RemoteException; import android.os.UserHandle; import android.util.Slog; Loading Loading @@ -72,7 +71,7 @@ public class AppBackupUtils { } // 2. they run as a system-level uid if ((app.uid < Process.FIRST_APPLICATION_UID)) { if (UserHandle.isCore(app.uid)) { // and the backup is happening for non-system user if (userId != UserHandle.USER_SYSTEM && !app.packageName.equals( PACKAGE_MANAGER_SENTINEL)) { Loading services/backup/java/com/android/server/backup/utils/RestoreUtils.java +2 −2 Original line number Diff line number Diff line Loading @@ -34,7 +34,7 @@ import android.content.pm.PackageManagerInternal; import android.content.pm.Signature; import android.os.Bundle; import android.os.IBinder; import android.os.Process; import android.os.UserHandle; import android.util.Slog; import com.android.internal.annotations.GuardedBy; Loading Loading @@ -162,7 +162,7 @@ public class RestoreUtils { if (AppBackupUtils.signaturesMatch(sigs, pkg, pmi)) { // If this is a system-uid app without a declared backup agent, // don't restore any of the file data. if ((pkg.applicationInfo.uid < Process.FIRST_APPLICATION_UID) if (UserHandle.isCore(pkg.applicationInfo.uid) && (pkg.applicationInfo.backupAgentName == null)) { Slog.w(TAG, "Installed app " + info.packageName + " has restricted uid and no agent"); Loading services/backup/java/com/android/server/backup/utils/TarBackupReader.java +2 −3 Original line number Diff line number Diff line Loading @@ -53,7 +53,7 @@ import android.content.pm.PackageManager; import android.content.pm.PackageManagerInternal; import android.content.pm.Signature; import android.os.Bundle; import android.os.Process; import android.os.UserHandle; import android.util.Slog; import com.android.server.backup.FileMetadata; Loading Loading @@ -404,8 +404,7 @@ public class TarBackupReader { if ((flags & ApplicationInfo.FLAG_ALLOW_BACKUP) != 0) { // Restore system-uid-space packages only if they have // defined a custom backup agent if ((pkgInfo.applicationInfo.uid >= Process.FIRST_APPLICATION_UID) if (!UserHandle.isCore(pkgInfo.applicationInfo.uid) || (pkgInfo.applicationInfo.backupAgentName != null)) { // Verify signatures against any installed version; if they // don't match, then we fall though and ignore the data. The Loading Loading
services/backup/java/com/android/server/backup/UserBackupManagerService.java +1 −1 Original line number Diff line number Diff line Loading @@ -1863,7 +1863,7 @@ public class UserBackupManagerService { // The agent was running with a stub Application object, so shut it down. // !!! We hardcode the confirmation UI's package name here rather than use a // manifest flag! TODO something less direct. if (app.uid >= Process.FIRST_APPLICATION_UID if (!UserHandle.isCore(app.uid) && !app.packageName.equals("com.android.backupconfirm")) { if (MORE_DEBUG) Slog.d(TAG, "Killing agent host process"); mActivityManager.killApplicationProcess(app.processName, app.uid); Loading
services/backup/java/com/android/server/backup/restore/PerformUnifiedRestoreTask.java +2 −2 Original line number Diff line number Diff line Loading @@ -45,9 +45,9 @@ import android.content.pm.PackageManagerInternal; import android.os.Bundle; import android.os.Message; import android.os.ParcelFileDescriptor; import android.os.Process; import android.os.RemoteException; import android.os.SystemClock; import android.os.UserHandle; import android.util.EventLog; import android.util.Slog; Loading Loading @@ -1174,7 +1174,7 @@ public class PerformUnifiedRestoreTask implements BackupRestoreTask { // b. the app does not state android:killAfterRestore="false" in its manifest final int appFlags = mCurrentPackage.applicationInfo.flags; final boolean killAfterRestore = (mCurrentPackage.applicationInfo.uid >= Process.FIRST_APPLICATION_UID) !UserHandle.isCore(mCurrentPackage.applicationInfo.uid) && ((mRestoreDescription.getDataType() == RestoreDescription.TYPE_FULL_STREAM) || ((appFlags & ApplicationInfo.FLAG_KILL_AFTER_RESTORE) != 0)); Loading
services/backup/java/com/android/server/backup/utils/AppBackupUtils.java +1 −2 Original line number Diff line number Diff line Loading @@ -31,7 +31,6 @@ import android.content.pm.PackageManager; import android.content.pm.PackageManagerInternal; import android.content.pm.Signature; import android.content.pm.SigningInfo; import android.os.Process; import android.os.RemoteException; import android.os.UserHandle; import android.util.Slog; Loading Loading @@ -72,7 +71,7 @@ public class AppBackupUtils { } // 2. they run as a system-level uid if ((app.uid < Process.FIRST_APPLICATION_UID)) { if (UserHandle.isCore(app.uid)) { // and the backup is happening for non-system user if (userId != UserHandle.USER_SYSTEM && !app.packageName.equals( PACKAGE_MANAGER_SENTINEL)) { Loading
services/backup/java/com/android/server/backup/utils/RestoreUtils.java +2 −2 Original line number Diff line number Diff line Loading @@ -34,7 +34,7 @@ import android.content.pm.PackageManagerInternal; import android.content.pm.Signature; import android.os.Bundle; import android.os.IBinder; import android.os.Process; import android.os.UserHandle; import android.util.Slog; import com.android.internal.annotations.GuardedBy; Loading Loading @@ -162,7 +162,7 @@ public class RestoreUtils { if (AppBackupUtils.signaturesMatch(sigs, pkg, pmi)) { // If this is a system-uid app without a declared backup agent, // don't restore any of the file data. if ((pkg.applicationInfo.uid < Process.FIRST_APPLICATION_UID) if (UserHandle.isCore(pkg.applicationInfo.uid) && (pkg.applicationInfo.backupAgentName == null)) { Slog.w(TAG, "Installed app " + info.packageName + " has restricted uid and no agent"); Loading
services/backup/java/com/android/server/backup/utils/TarBackupReader.java +2 −3 Original line number Diff line number Diff line Loading @@ -53,7 +53,7 @@ import android.content.pm.PackageManager; import android.content.pm.PackageManagerInternal; import android.content.pm.Signature; import android.os.Bundle; import android.os.Process; import android.os.UserHandle; import android.util.Slog; import com.android.server.backup.FileMetadata; Loading Loading @@ -404,8 +404,7 @@ public class TarBackupReader { if ((flags & ApplicationInfo.FLAG_ALLOW_BACKUP) != 0) { // Restore system-uid-space packages only if they have // defined a custom backup agent if ((pkgInfo.applicationInfo.uid >= Process.FIRST_APPLICATION_UID) if (!UserHandle.isCore(pkgInfo.applicationInfo.uid) || (pkgInfo.applicationInfo.backupAgentName != null)) { // Verify signatures against any installed version; if they // don't match, then we fall though and ignore the data. The Loading