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

Commit 0fdbeeff authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Merge cherrypicks of [16010620, 16011373, 16011377, 16011394, 16011395,...

Merge cherrypicks of [16010620, 16011373, 16011377, 16011394, 16011395, 16011396, 16011398, 16011400, 16011402, 16012407, 16010623, 16011574, 16011575, 16010923, 16011434, 16011691, 16011382, 16011383, 16011303, 16011385, 16011579] into security-aosp-rvc-release

Change-Id: I1e3c212c5d7843096cb8134a809ea282ca6c5963
parents 6119be1a be272dcf
Loading
Loading
Loading
Loading
+13 −5
Original line number Diff line number Diff line
@@ -425,21 +425,29 @@ public class AtPhonebook {
        }

        if (ancillaryPhonebook) {
            pbr.cursor = mContentResolver.query(Calls.CONTENT_URI, CALLS_PROJECTION, where, null,
                    Calls.DEFAULT_SORT_ORDER + " LIMIT " + MAX_PHONEBOOK_SIZE);
            Bundle queryArgs = new Bundle();
            queryArgs.putString(ContentResolver.QUERY_ARG_SQL_SELECTION, where);
            queryArgs.putString(ContentResolver.QUERY_ARG_SQL_SORT_ORDER, Calls.DEFAULT_SORT_ORDER);
            queryArgs.putInt(ContentResolver.QUERY_ARG_LIMIT, MAX_PHONEBOOK_SIZE);
            pbr.cursor = mContentResolver.query(Calls.CONTENT_URI, CALLS_PROJECTION,
                    queryArgs, null);

            if (pbr.cursor == null) {
                return false;
            }

            pbr.numberColumn = pbr.cursor.getColumnIndexOrThrow(Calls.NUMBER);
            pbr.numberPresentationColumn =
                    pbr.cursor.getColumnIndexOrThrow(Calls.NUMBER_PRESENTATION);
            pbr.typeColumn = -1;
            pbr.nameColumn = -1;
        } else {
            Bundle queryArgs = new Bundle();
            queryArgs.putString(ContentResolver.QUERY_ARG_SQL_SELECTION, where);
            queryArgs.putInt(ContentResolver.QUERY_ARG_LIMIT, MAX_PHONEBOOK_SIZE);
            final Uri phoneContentUri = DevicePolicyUtils.getEnterprisePhoneUri(mContext);
            pbr.cursor = mContentResolver.query(phoneContentUri, PHONES_PROJECTION, where, null,
                    Phone.NUMBER + " LIMIT " + MAX_PHONEBOOK_SIZE);
            pbr.cursor = mContentResolver.query(phoneContentUri, PHONES_PROJECTION,
                    queryArgs, null);

            if (pbr.cursor == null) {
                return false;
            }