From 9aaffe3c5c28fcbabfdefcc0ac2759fdc7d9eee1 Mon Sep 17 00:00:00 2001 From: Ruslan Tkhakokhov Date: Mon, 21 Dec 2020 16:06:06 +0000 Subject: [PATCH] Temporarily disable the new adb backup behavior Fall back to using the legacy android:allowBackup flag for apps that don't specify the new ALLOW_ADB_BACKUP property. This is done to not break GTS tests that rely on adb backup since corresponding apps can't use ALLOW_ADB_BACKUP yet (ag/13205188 is blocked with some failure that I'm currently investigating). Bug: 175250895 Test: atest CtsBackupHostTestCases Change-Id: Id40b2ae6b677afca18011077f57926518b28960f --- .../server/backup/utils/BackupEligibilityRules.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/services/backup/java/com/android/server/backup/utils/BackupEligibilityRules.java b/services/backup/java/com/android/server/backup/utils/BackupEligibilityRules.java index 2078492e67ab9..002f6d7e77904 100644 --- a/services/backup/java/com/android/server/backup/utils/BackupEligibilityRules.java +++ b/services/backup/java/com/android/server/backup/utils/BackupEligibilityRules.java @@ -183,7 +183,12 @@ public class BackupEligibilityRules { } catch (PackageManager.NameNotFoundException e) { Slog.w(TAG, "Failed to read allowAdbBackup property for + " + packageName); - return false; + + // This temporarily falls back to the legacy allowBackup flag to + // avoid breaking existing users of adb backup. Once they're able to use + // the new ALLOW_ADB_BACKUP property, we'll return false here. + // TODO(b/176088499): Return false here. + return allowBackup; } } else { // All other apps can use adb backup only when running in debuggable mode.