From 9bdb503274a292741ece14215c1545d6bcb0e67f Mon Sep 17 00:00:00 2001 From: Eric Erfanian Date: Wed, 9 Aug 2017 15:37:50 -0700 Subject: Implement Dialer K/V Backup and Restore. This CL ensures that Restore works correctly (to unblock us for ODR system image). As restore happens on the system image and the logic cannot be updated via PlayStore, this CL is time sensitive, to ensure we can get it into the ODR system drop. This CL only backups com.android.dialer.app_preferences.xml for now, but can always be changed to update more shared preference files when needed via an playstore update. Since we are using PersistentBackupAgentHelper, we don't have to worry about not being able to restore additional backed up shared preference files from the future, as PersistentBackupAgentHelper will allow us to restore all the shared preferences that were ever backed up via Key/Value. Currently I added an end to end unit test, and tested restore via "adb shell bmgr restore com.google.android.dialer", which restored the stored data sets. A follow up CL will include additional files to backup and impression logging. Bug: 64363054 Test: DialerPersistentBackupAgentTest PiperOrigin-RevId: 164524465 Change-Id: I5bd65215a42744ba4149a9359e443679306b6cc0 --- Android.mk | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'Android.mk') diff --git a/Android.mk b/Android.mk index ff7b0a38e..140b41fe8 100644 --- a/Android.mk +++ b/Android.mk @@ -80,6 +80,13 @@ LOCAL_FULL_LIBS_MANIFEST_FILES := \ LOCAL_SRC_FILES := $(call all-java-files-under, $(SRC_DIRS)) LOCAL_SRC_FILES := $(filter-out $(EXCLUDE_FILES),$(LOCAL_SRC_FILES)) LOCAL_SRC_FILES += $(call all-proto-files-under, $(SRC_DIRS)) + +# Backup Library +BACKUP_LIB_SRC_DIR := ../../../external/libbackup/src/com/google/android/libraries/backup +EXCLUDE_BACKUP_LIB_SRCS := $(call all-java-files-under, $(BACKUP_LIB_SRC_DIR)/shadow) +LOCAL_SRC_FILES += $(call all-java-files-under, $(BACKUP_LIB_SRC_DIR)) +LOCAL_SRC_FILES := $(filter-out $(EXCLUDE_BACKUP_LIB_SRCS),$(LOCAL_SRC_FILES)) + LOCAL_PROTOC_FLAGS := --proto_path=$(LOCAL_PATH) LOCAL_RESOURCE_DIR := $(addprefix $(LOCAL_PATH)/, $(RES_DIRS)) @@ -204,6 +211,8 @@ PROCESSOR_LIBRARIES_TARGET := PROCESSOR_JARS := EXCLUDE_MANIFESTS := EXCLUDE_EXTRA_PACKAGES := +BACKUP_LIB_SRC_DIR := +EXCLUDE_BACKUP_LIB_SRCS := # Create references to prebuilt libraries. include $(CLEAR_VARS) -- cgit v1.2.3