Fix backup and restore for default browser app.
This was broken by ag/6216880 back in Q because it didn't take into
account that writeDefaultAppsLPr() is also used by
getDefaultAppsBackup(), so that it didn't modify
getDefaultAppsBackup() to read the browser role instead when
effectively removing pm/Settings.mDefaultBrowserApp.
This CL fixes the regression in a minimal and backwards-compatible
way. It extracts the XML related code into a static method, and makes
getDefaultAppsBackup() use that static method by passing in the
current default browser obtained from the browser role.
Bug: 271337188
Test: manually perform a restore via cable and verify that the source
device provided its current default browser to backup helper via
locally added log.
Change-Id: I1fde685049e9f3371bbef6956418f9a7eb5ff850
Merged-In: I1fde685049e9f3371bbef6956418f9a7eb5ff850
(cherry picked from commit 6963b38af61c6f43549ba2308f2a54552aee6be8)
3 files changed