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

Commit fb156d07 authored by Joseph Pirozzo's avatar Joseph Pirozzo Committed by android-build-merger
Browse files

Merge "PBAP Client call-log cleanup"

am: 50b8cd2c

Change-Id: Id465a69838a112e06ab7406c4132bbe9a0f54228
parents b878a61c 50b8cd2c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -88,7 +88,7 @@ public class CallLogPullRequest extends PullRequest {
                ContentValues values = new ContentValues();

                values.put(CallLog.Calls.TYPE, type);
                values.put(Calls.PHONE_ACCOUNT_ID, mAccount.hashCode());
                values.put(Calls.PHONE_ACCOUNT_ID, mAccount.name);
                List<PhoneData> phones = vcard.getPhoneList();
                if (phones == null || phones.get(0).getNumber().equals(";")) {
                    values.put(CallLog.Calls.NUMBER, "");
+2 −2
Original line number Diff line number Diff line
@@ -411,8 +411,8 @@ class PbapClientConnectionHandler extends Handler {
                }
                return;
            }
            String where = Calls.PHONE_ACCOUNT_ID + "=" + account.hashCode();
            mContext.getContentResolver().delete(CallLog.Calls.CONTENT_URI, where, null);
            mContext.getContentResolver().delete(CallLog.Calls.CONTENT_URI,
                    Calls.PHONE_ACCOUNT_ID + "=?", new String[]{mAccount.name});
        } catch (IllegalArgumentException e) {
            Log.d(TAG, "Call Logs could not be deleted, they may not exist yet.");
        }
+6 −5
Original line number Diff line number Diff line
@@ -116,14 +116,15 @@ public class PbapClientService extends ProfileService {
        if (VDBG) Log.v(TAG, "Found " + accounts.length + " unclean accounts");
        for (Account acc : accounts) {
            Log.w(TAG, "Deleting " + acc);
            // The device ID is the name of the account.
            accountManager.removeAccountExplicitly(acc);
        }
            try {
            getContentResolver().delete(CallLog.Calls.CONTENT_URI, null, null);
                getContentResolver().delete(CallLog.Calls.CONTENT_URI,
                        CallLog.Calls.PHONE_ACCOUNT_ID + "=?", new String[]{acc.name});
            } catch (IllegalArgumentException e) {
                Log.w(TAG, "Call Logs could not be deleted, they may not exist yet.");
            }
            // The device ID is the name of the account.
            accountManager.removeAccountExplicitly(acc);
        }
    }

    private class PbapBroadcastReceiver extends BroadcastReceiver {