mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-20 11:18:21 +00:00
hook database restore with restore session
1. Create feature flag for new backup & restore flow. 2. For each restore session (install reason is restore), if its creation time is newer than the one we have in SharedPreference, we update the entry and restores favorite table from backup. 3. The restore operation is debounced so that when multiple restore session is created within a small amount of time, only the last invocation will get executed. Bug: 141472083 Change-Id: I7b5b63ec28741ba2b02ccfd13f591c961362ba36 Test: 1. apply on master, build & flash on physical device. 2. factory reset the device. 3. go through SuW, perform restore, exit without adding work profile. 4. settings -> account -> add work profile account. 5. finish work profile setup, verify work profiles is restored as well.
This commit is contained in:
@@ -78,6 +78,7 @@ public class SessionCommitReceiver extends BroadcastReceiver {
|
||||
}
|
||||
|
||||
InstallSessionHelper packageInstallerCompat = InstallSessionHelper.INSTANCE.get(context);
|
||||
packageInstallerCompat.restoreDbIfApplicable(info);
|
||||
if (TextUtils.isEmpty(info.getAppPackageName())
|
||||
|| info.getInstallReason() != PackageManager.INSTALL_REASON_USER
|
||||
|| packageInstallerCompat.promiseIconAddedForId(info.getSessionId())) {
|
||||
|
||||
Reference in New Issue
Block a user