summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad Ebinger <breadley@google.com>2016-03-21 15:11:49 -0700
committerBrad Ebinger <breadley@google.com>2016-03-23 13:26:30 -0700
commit7914bccda3fde840ae3a476baa9cf735ac962e46 (patch)
tree7df980136cd75deae1f3b57c566c4867d23034ec
parenta111fff1b5cba3b562b393d2e85e2de93ae29cf5 (diff)
downloadandroid_packages_providers_CallLogProvider-7914bccda3fde840ae3a476baa9cf735ac962e46.tar.gz
android_packages_providers_CallLogProvider-7914bccda3fde840ae3a476baa9cf735ac962e46.tar.bz2
android_packages_providers_CallLogProvider-7914bccda3fde840ae3a476baa9cf735ac962e46.zip
Add VIA number column to CallLog Backup
Add a column to the CallLog Backup that records the secondary line number that an incoming call has been received on. More specifically, a call is assumed to be considered a "VIA number" if the call's incoming line number does not match the number registered with the SIM card. BUG: 25594198 Change-Id: I14c02e846e1382c3f14c3cc1947144ce310e4b8c
-rw-r--r--src/com/android/calllogbackup/CallLogBackupAgent.java13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/com/android/calllogbackup/CallLogBackupAgent.java b/src/com/android/calllogbackup/CallLogBackupAgent.java
index 9aa20ea..77ac82c 100644
--- a/src/com/android/calllogbackup/CallLogBackupAgent.java
+++ b/src/com/android/calllogbackup/CallLogBackupAgent.java
@@ -68,6 +68,7 @@ public class CallLogBackupAgent extends BackupAgent {
long duration;
String number;
String postDialDigits = "";
+ String viaNumber = "";
int type;
int numberPresentation;
String accountComponentName;
@@ -103,7 +104,7 @@ public class CallLogBackupAgent extends BackupAgent {
/** Current version of CallLogBackup. Used to track the backup format. */
@VisibleForTesting
- static final int VERSION = 1004;
+ static final int VERSION = 1005;
/** Version indicating that there exists no previous backup entry. */
@VisibleForTesting
static final int VERSION_NO_PREVIOUS_STATE = 0;
@@ -121,6 +122,7 @@ public class CallLogBackupAgent extends BackupAgent {
CallLog.Calls.DURATION,
CallLog.Calls.NUMBER,
CallLog.Calls.POST_DIAL_DIGITS,
+ CallLog.Calls.VIA_NUMBER,
CallLog.Calls.TYPE,
CallLog.Calls.COUNTRY_ISO,
CallLog.Calls.GEOCODED_LOCATION,
@@ -264,7 +266,7 @@ public class CallLogBackupAgent extends BackupAgent {
}
boolean addForAllUsers = call.addForAllUsers == 1;
// We backup the calllog in the user running this backup agent, so write calls to this user.
- Calls.addCall(null /* CallerInfo */, this, call.number, call.postDialDigits,
+ Calls.addCall(null /* CallerInfo */, this, call.number, call.postDialDigits, call.viaNumber,
call.numberPresentation, call.type, call.features, handle, call.date,
(int) call.duration, dataUsage, addForAllUsers, null, true /* is_read */);
}
@@ -363,6 +365,10 @@ public class CallLogBackupAgent extends BackupAgent {
call.postDialDigits = readString(dataInput);
}
+ if(version >= 1005) {
+ call.viaNumber = readString(dataInput);
+ }
+
return call;
} catch (IOException e) {
Log.e(TAG, "Error reading call data for " + callId, e);
@@ -378,6 +384,7 @@ public class CallLogBackupAgent extends BackupAgent {
call.number = cursor.getString(cursor.getColumnIndex(CallLog.Calls.NUMBER));
call.postDialDigits = cursor.getString(
cursor.getColumnIndex(CallLog.Calls.POST_DIAL_DIGITS));
+ call.viaNumber = cursor.getString(cursor.getColumnIndex(CallLog.Calls.VIA_NUMBER));
call.type = cursor.getInt(cursor.getColumnIndex(CallLog.Calls.TYPE));
call.numberPresentation =
cursor.getInt(cursor.getColumnIndex(CallLog.Calls.NUMBER_PRESENTATION));
@@ -420,6 +427,8 @@ public class CallLogBackupAgent extends BackupAgent {
writeString(data, call.postDialDigits);
+ writeString(data, call.viaNumber);
+
data.flush();
output.writeEntityHeader(Integer.toString(call.id), baos.size());