Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit db573fc0 authored by Christopher Tate's avatar Christopher Tate Committed by Android (Google) Code Review
Browse files

Merge "A couple of restore fixes:" into lmp-dev

parents 5f054cea 7ff106c2
Loading
Loading
Loading
Loading
+3 −8
Original line number Original line Diff line number Diff line
@@ -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);
@@ -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) {
@@ -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.