Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 17af8ba0 authored by Aishwarya Mallampati's avatar Aishwarya Mallampati
Browse files

Modified ICCID strings in SQLite Query

Double-Quoted strings are printed in SQLite Logs by default.
Double-Quoted ICCID strings are modified to Single-Quotes to avoid
printing of ICCID strings in SQLite logs.

Bug: 195964247
Test: Manual
Change-Id: I8e49a4253aab8f43f854e039784d3d87dded2382
parent 5f373ebc
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -1267,7 +1267,7 @@ public class SubscriptionController extends ISub.Stub {
            if (i > 0) {
                whereClause.append(",");
            }
            whereClause.append("\"").append(embeddedIccids[i]).append("\"");
            whereClause.append("'").append(embeddedIccids[i]).append("'");
        }
        whereClause.append(")");

@@ -3928,9 +3928,9 @@ public class SubscriptionController extends ISub.Stub {
        selection.append(SubscriptionManager.ICC_ID);
        selection.append(" IN (");
        for (int i = 0; i < iccIds.length - 1; i++) {
            selection.append("\"" + iccIds[i] + "\", ");
            selection.append("'" + iccIds[i] + "', ");
        }
        selection.append("\"" + iccIds[iccIds.length - 1] + "\"");
        selection.append("'" + iccIds[iccIds.length - 1] + "'");
        selection.append(")");

        return selection.toString();
+2 −2
Original line number Diff line number Diff line
@@ -1075,7 +1075,7 @@ public class SubscriptionInfoUpdater extends Handler {
            }
            hasChanges = true;
            contentResolver.update(SubscriptionManager.CONTENT_URI, values,
                    SubscriptionManager.ICC_ID + "=\"" + embeddedProfile.getIccid() + "\"", null);
                    SubscriptionManager.ICC_ID + "='" + embeddedProfile.getIccid() + "'", null);

            // refresh Cached Active Subscription Info List
            mSubscriptionController.refreshCachedActiveSubscriptionInfoList();
@@ -1095,7 +1095,7 @@ public class SubscriptionInfoUpdater extends Handler {
                SubscriptionInfo info = existingSubscriptions.get(i);
                if (info.isEmbedded()) {
                    if (DBG) logd("Removing embedded subscription of IccId " + info.getIccId());
                    iccidsToRemove.add("\"" + info.getIccId() + "\"");
                    iccidsToRemove.add("'" + info.getIccId() + "'");
                }
            }
            String whereClause = SubscriptionManager.ICC_ID + " IN ("
+3 −3
Original line number Diff line number Diff line
@@ -625,12 +625,12 @@ public class SubscriptionInfoUpdaterTest extends TelephonyTest {
        // Info for 1 and 3 should be updated as active embedded subscriptions.
        ArgumentCaptor<ContentValues> iccid1Values = ArgumentCaptor.forClass(ContentValues.class);
        verify(mContentProvider).update(eq(SubscriptionManager.CONTENT_URI), iccid1Values.capture(),
                eq(SubscriptionManager.ICC_ID + "=\"1\""), isNull());
                eq(SubscriptionManager.ICC_ID + "='1'"), isNull());
        assertEquals(1,
                iccid1Values.getValue().getAsInteger(SubscriptionManager.IS_EMBEDDED).intValue());
        ArgumentCaptor<ContentValues> iccid3Values = ArgumentCaptor.forClass(ContentValues.class);
        verify(mContentProvider).update(eq(SubscriptionManager.CONTENT_URI), iccid3Values.capture(),
                eq(SubscriptionManager.ICC_ID + "=\"3\""), isNull());
                eq(SubscriptionManager.ICC_ID + "='3'"), isNull());
        assertEquals(1,
                iccid3Values.getValue().getAsInteger(SubscriptionManager.IS_EMBEDDED).intValue());

@@ -638,7 +638,7 @@ public class SubscriptionInfoUpdaterTest extends TelephonyTest {
        // in the list provided by the LPA.
        ArgumentCaptor<ContentValues> iccid2Values = ArgumentCaptor.forClass(ContentValues.class);
        verify(mContentProvider).update(eq(SubscriptionManager.CONTENT_URI), iccid2Values.capture(),
                eq(SubscriptionManager.ICC_ID + " IN (\"2\")"), isNull());
                eq(SubscriptionManager.ICC_ID + " IN ('2')"), isNull());
        assertEquals(0,
                iccid2Values.getValue().getAsInteger(SubscriptionManager.IS_EMBEDDED).intValue());
    }