Loading services/backup/java/com/android/server/backup/BackupManagerService.java +3 −8 Original line number Original line Diff line number Diff line Loading @@ -6645,8 +6645,8 @@ if (MORE_DEBUG) Slog.v(TAG, " + got " + nRead + "; now wanting " + (size - soF UnifiedRestoreState nextState = UnifiedRestoreState.FINAL; UnifiedRestoreState nextState = UnifiedRestoreState.FINAL; try { try { mRestoreDescription = mTransport.nextRestorePackage(); mRestoreDescription = mTransport.nextRestorePackage(); final int type = mRestoreDescription.getDataType(); final String pkgName = (mRestoreDescription != null) final String pkgName = mRestoreDescription.getPackageName(); ? mRestoreDescription.getPackageName() : null; if (pkgName == null) { if (pkgName == null) { Slog.e(TAG, "Failure getting next package name"); Slog.e(TAG, "Failure getting next package name"); EventLog.writeEvent(EventLogTags.RESTORE_TRANSPORT_FAILURE); EventLog.writeEvent(EventLogTags.RESTORE_TRANSPORT_FAILURE); Loading Loading @@ -6717,6 +6717,7 @@ if (MORE_DEBUG) Slog.v(TAG, " + got " + nRead + "; now wanting " + (size - soF // Reset per-package preconditions and fire the appropriate next state // Reset per-package preconditions and fire the appropriate next state mWidgetData = null; mWidgetData = null; final int type = mRestoreDescription.getDataType(); if (type == RestoreDescription.TYPE_KEY_VALUE) { if (type == RestoreDescription.TYPE_KEY_VALUE) { nextState = UnifiedRestoreState.RESTORE_KEYVALUE; nextState = UnifiedRestoreState.RESTORE_KEYVALUE; } else if (type == RestoreDescription.TYPE_FULL_STREAM) { } else if (type == RestoreDescription.TYPE_FULL_STREAM) { Loading Loading @@ -8470,12 +8471,6 @@ if (MORE_DEBUG) Slog.v(TAG, " + got " + nRead + "; now wanting " + (size - soF throw new SecurityException("No permission to restore other packages"); throw new SecurityException("No permission to restore other packages"); } } // If the package has no backup agent, we obviously cannot proceed if (app.applicationInfo.backupAgentName == null) { Slog.w(TAG, "Asked to restore package " + packageName + " with no agent"); return -1; } // So far so good; we're allowed to try to restore this package. Now // So far so good; we're allowed to try to restore this package. Now // check whether there is data for it in the current dataset, falling back // check whether there is data for it in the current dataset, falling back // to the ancestral dataset if not. // to the ancestral dataset if not. Loading Loading
services/backup/java/com/android/server/backup/BackupManagerService.java +3 −8 Original line number Original line Diff line number Diff line Loading @@ -6645,8 +6645,8 @@ if (MORE_DEBUG) Slog.v(TAG, " + got " + nRead + "; now wanting " + (size - soF UnifiedRestoreState nextState = UnifiedRestoreState.FINAL; UnifiedRestoreState nextState = UnifiedRestoreState.FINAL; try { try { mRestoreDescription = mTransport.nextRestorePackage(); mRestoreDescription = mTransport.nextRestorePackage(); final int type = mRestoreDescription.getDataType(); final String pkgName = (mRestoreDescription != null) final String pkgName = mRestoreDescription.getPackageName(); ? mRestoreDescription.getPackageName() : null; if (pkgName == null) { if (pkgName == null) { Slog.e(TAG, "Failure getting next package name"); Slog.e(TAG, "Failure getting next package name"); EventLog.writeEvent(EventLogTags.RESTORE_TRANSPORT_FAILURE); EventLog.writeEvent(EventLogTags.RESTORE_TRANSPORT_FAILURE); Loading Loading @@ -6717,6 +6717,7 @@ if (MORE_DEBUG) Slog.v(TAG, " + got " + nRead + "; now wanting " + (size - soF // Reset per-package preconditions and fire the appropriate next state // Reset per-package preconditions and fire the appropriate next state mWidgetData = null; mWidgetData = null; final int type = mRestoreDescription.getDataType(); if (type == RestoreDescription.TYPE_KEY_VALUE) { if (type == RestoreDescription.TYPE_KEY_VALUE) { nextState = UnifiedRestoreState.RESTORE_KEYVALUE; nextState = UnifiedRestoreState.RESTORE_KEYVALUE; } else if (type == RestoreDescription.TYPE_FULL_STREAM) { } else if (type == RestoreDescription.TYPE_FULL_STREAM) { Loading Loading @@ -8470,12 +8471,6 @@ if (MORE_DEBUG) Slog.v(TAG, " + got " + nRead + "; now wanting " + (size - soF throw new SecurityException("No permission to restore other packages"); throw new SecurityException("No permission to restore other packages"); } } // If the package has no backup agent, we obviously cannot proceed if (app.applicationInfo.backupAgentName == null) { Slog.w(TAG, "Asked to restore package " + packageName + " with no agent"); return -1; } // So far so good; we're allowed to try to restore this package. Now // So far so good; we're allowed to try to restore this package. Now // check whether there is data for it in the current dataset, falling back // check whether there is data for it in the current dataset, falling back // to the ancestral dataset if not. // to the ancestral dataset if not. Loading