From 2e7515b419259216dcce5c0817653193dcae0a96 Mon Sep 17 00:00:00 2001 From: Wzaw1 <78591480+wzaw1@users.noreply.github.com> Date: Sun, 6 Feb 2022 20:52:47 +0100 Subject: [PATCH 1/2] Add dual sim feature --- app/src/main/java/com/termux/api/CallLogAPI.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/termux/api/CallLogAPI.java b/app/src/main/java/com/termux/api/CallLogAPI.java index cf7232f63..d9f59d6a7 100644 --- a/app/src/main/java/com/termux/api/CallLogAPI.java +++ b/app/src/main/java/com/termux/api/CallLogAPI.java @@ -32,7 +32,7 @@ public void writeJson(JsonWriter out) throws Exception { } - private static void getCallLogs(Context context, JsonWriter out, int offset, int limit) throws IOException { +private static void getCallLogs(Context context, JsonWriter out, int offset, int limit) throws IOException { ContentResolver cr = context.getContentResolver(); String sortOrder = "date DESC LIMIT + " + limit + " OFFSET " + offset; @@ -44,6 +44,7 @@ private static void getCallLogs(Context context, JsonWriter out, int offset, int int dateIndex = cur.getColumnIndex(CallLog.Calls.DATE); int durationIndex = cur.getColumnIndex(CallLog.Calls.DURATION); int callTypeIndex = cur.getColumnIndex(CallLog.Calls.TYPE); + int simtTypeIndex = cur.getColumnIndex(Calllog.Calls.PHONE_ACCOUNT_ID); SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault()); out.beginArray(); @@ -56,6 +57,7 @@ private static void getCallLogs(Context context, JsonWriter out, int offset, int out.name("type").value(getCallTypeString(cur.getInt(callTypeIndex))); out.name("date").value(getDateString(cur.getLong(dateIndex), dateFormat)); out.name("duration").value(getTimeString(cur.getInt(durationIndex))); + out.name("sim_id").value(getString(simTypeIndex)); cur.moveToPrevious(); out.endObject(); From 02199c80570fb691427445b493f123676181359f Mon Sep 17 00:00:00 2001 From: Wzaw1 <78591480+wzaw1@users.noreply.github.com> Date: Sun, 6 Feb 2022 20:54:42 +0100 Subject: [PATCH 2/2] Update CallLogAPI.java --- app/src/main/java/com/termux/api/CallLogAPI.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/termux/api/CallLogAPI.java b/app/src/main/java/com/termux/api/CallLogAPI.java index d9f59d6a7..b3e5da7d3 100644 --- a/app/src/main/java/com/termux/api/CallLogAPI.java +++ b/app/src/main/java/com/termux/api/CallLogAPI.java @@ -32,7 +32,7 @@ public void writeJson(JsonWriter out) throws Exception { } -private static void getCallLogs(Context context, JsonWriter out, int offset, int limit) throws IOException { + private static void getCallLogs(Context context, JsonWriter out, int offset, int limit) throws IOException { ContentResolver cr = context.getContentResolver(); String sortOrder = "date DESC LIMIT + " + limit + " OFFSET " + offset;