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

Commit 4fee9310 authored by Bryan Mawhinney's avatar Bryan Mawhinney
Browse files

Start agent in correct mode for adb k/v restore

Previously we always started the agent in "dolly" mode, which meant that
the application context might not be what the agent was expecting.

Bug: 62524964
Test: Manual
Change-Id: I6cd2fafcac97f7ca01a6e172325968d79cc01194
parent 84a333c7
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -7562,7 +7562,9 @@ if (MORE_DEBUG) Slog.v(TAG, " + got " + nRead + "; now wanting " + (size - soF
                                // All set; now set up the IPC and launch the agent
                                // All set; now set up the IPC and launch the agent
                                setUpPipes();
                                setUpPipes();
                                mAgent = bindToAgentSynchronous(mTargetApp,
                                mAgent = bindToAgentSynchronous(mTargetApp,
                                        ApplicationThreadConstants.BACKUP_MODE_RESTORE_FULL);
                                        FullBackup.KEY_VALUE_DATA_TOKEN.equals(info.domain)
                                                ? ApplicationThreadConstants.BACKUP_MODE_INCREMENTAL
                                                : ApplicationThreadConstants.BACKUP_MODE_RESTORE_FULL);
                                mAgentPackage = pkg;
                                mAgentPackage = pkg;
                            } catch (IOException e) {
                            } catch (IOException e) {
                                // fall through to error handling
                                // fall through to error handling
+3 −1
Original line number Original line Diff line number Diff line
@@ -610,7 +610,9 @@ public class PerformAdbRestoreTask implements Runnable {
                            // All set; now set up the IPC and launch the agent
                            // All set; now set up the IPC and launch the agent
                            setUpPipes();
                            setUpPipes();
                            mAgent = mBackupManagerService.bindToAgentSynchronous(mTargetApp,
                            mAgent = mBackupManagerService.bindToAgentSynchronous(mTargetApp,
                                    ApplicationThreadConstants.BACKUP_MODE_RESTORE_FULL);
                                    FullBackup.KEY_VALUE_DATA_TOKEN.equals(info.domain)
                                            ? ApplicationThreadConstants.BACKUP_MODE_INCREMENTAL
                                            : ApplicationThreadConstants.BACKUP_MODE_RESTORE_FULL);
                            mAgentPackage = pkg;
                            mAgentPackage = pkg;
                        } catch (IOException e) {
                        } catch (IOException e) {
                            // fall through to error handling
                            // fall through to error handling