diff options
author | Xin Li <delphij@google.com> | 2021-10-06 22:54:09 +0000 |
---|---|---|
committer | Xin Li <delphij@google.com> | 2021-10-06 22:54:09 +0000 |
commit | a7de7b95de698a51f6e76bc45f1ceb20ca67d154 (patch) | |
tree | e9700fa34e5e575576b01f4753f83afe9bec1f24 | |
parent | 94d45bf10a72d032597852ecef21734ce4efa8a8 (diff) | |
parent | 84a1d14b6bf41fbd9d145bfed6ab65b4aada068e (diff) | |
download | CallLogProvider-android-s-v2-preview-1.tar.gz |
Merge Android 12android-s-v2-preview-2android-s-v2-preview-1android-s-v2-beta-2android-s-v2-preview-1
Bug: 202323961
Merged-In: If1994d3809629429ecb684d6f58b2cbd28fddd22
Change-Id: I26274bfb1f82370d9860232120298f4859915885
-rw-r--r-- | AndroidManifest.xml | 1 | ||||
-rw-r--r-- | src/com/android/calllogbackup/CallLogBackupAgent.java | 16 | ||||
-rw-r--r-- | src/com/android/calllogbackup/CallLogChangeReceiver.java | 12 |
3 files changed, 3 insertions, 26 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 69001e3..e3f43a1 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -4,6 +4,7 @@ android:sharedUserLabel="@string/sharedUserLabel"> <uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" /> + <uses-permission android:name="com.android.voicemail.permission.READ_VOICEMAIL" /> <application android:label="@string/app_label" android:allowBackup="true" diff --git a/src/com/android/calllogbackup/CallLogBackupAgent.java b/src/com/android/calllogbackup/CallLogBackupAgent.java index d589708..02b7839 100644 --- a/src/com/android/calllogbackup/CallLogBackupAgent.java +++ b/src/com/android/calllogbackup/CallLogBackupAgent.java @@ -105,8 +105,6 @@ public class CallLogBackupAgent extends BackupAgent { private static final String TAG = "CallLogBackupAgent"; - private static final String USER_FULL_DATA_BACKUP_AWARE = "user_full_data_backup_aware"; - /** Current version of CallLogBackup. Used to track the backup format. */ @VisibleForTesting static final int VERSION = 1008; @@ -148,14 +146,6 @@ public class CallLogBackupAgent extends BackupAgent { @Override public void onBackup(ParcelFileDescriptor oldStateDescriptor, BackupDataOutput data, ParcelFileDescriptor newStateDescriptor) throws IOException { - - if (shouldPreventBackup(this)) { - if (isDebug()) { - Log.d(TAG, "Skipping onBackup"); - } - return; - } - // Get the list of the previous calls IDs which were backed up. DataInputStream dataInput = new DataInputStream( new FileInputStream(oldStateDescriptor.getFileDescriptor())); @@ -598,12 +588,6 @@ public class CallLogBackupAgent extends BackupAgent { } } - static boolean shouldPreventBackup(Context context) { - // Check to see that the user is full-data aware before performing calllog backup. - return Settings.Secure.getInt( - context.getContentResolver(), USER_FULL_DATA_BACKUP_AWARE, 0) == 0; - } - private static boolean isDebug() { return Log.isLoggable(TAG, Log.DEBUG); } diff --git a/src/com/android/calllogbackup/CallLogChangeReceiver.java b/src/com/android/calllogbackup/CallLogChangeReceiver.java index faede1f..b9339cc 100644 --- a/src/com/android/calllogbackup/CallLogChangeReceiver.java +++ b/src/com/android/calllogbackup/CallLogChangeReceiver.java @@ -37,16 +37,8 @@ public class CallLogChangeReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { if (ACTION_CALL_LOG_CHANGE.equals(intent.getAction())) { - - if (CallLogBackupAgent.shouldPreventBackup(context)) { - // User is not full-backup-data aware so we skip calllog backup until they are. - if (VDBG) { - Log.v(TAG, "Skipping call log backup due to lack of full-data check."); - } - } else { - BackupManager bm = new BackupManager(context); - bm.dataChanged(); - } + BackupManager bm = new BackupManager(context); + bm.dataChanged(); } } |