Loading java/com/android/contacts/common/widget/SelectPhoneAccountDialogOptionsUtil.java +23 −1 Original line number Diff line number Diff line Loading @@ -16,9 +16,15 @@ package com.android.contacts.common.widget; import android.os.Parcel; import android.os.UserHandle; import android.telecom.PhoneAccount; import android.telecom.PhoneAccountHandle; import com.android.dialer.common.Assert; import com.android.dialer.telecom.TelecomUtil; import com.google.protobuf.ByteString; import java.util.Collection; /** Provides common operation on a {@link SelectPhoneAccountDialogOptions} */ Loading @@ -27,9 +33,21 @@ public final class SelectPhoneAccountDialogOptionsUtil { public static PhoneAccountHandle getPhoneAccountHandle( SelectPhoneAccountDialogOptions.Entry entry) { UserHandle userHandle; Parcel parcel = Parcel.obtain(); try { byte[] marshalledUserHandle = entry.getUserHandle().toByteArray(); parcel.unmarshall(marshalledUserHandle, 0, marshalledUserHandle.length); parcel.setDataPosition(0); userHandle = parcel.readParcelable(UserHandle.class.getClassLoader()); } catch (NullPointerException e) { userHandle = null; } parcel.recycle(); return Assert.isNotNull( TelecomUtil.composePhoneAccountHandle( entry.getPhoneAccountHandleComponentName(), entry.getPhoneAccountHandleId())); entry.getPhoneAccountHandleComponentName(), entry.getPhoneAccountHandleId(), userHandle)); } public static SelectPhoneAccountDialogOptions.Entry.Builder setPhoneAccountHandle( Loading @@ -38,6 +56,10 @@ public final class SelectPhoneAccountDialogOptionsUtil { entryBuilder.setPhoneAccountHandleComponentName( phoneAccountHandle.getComponentName().flattenToString()); entryBuilder.setPhoneAccountHandleId(phoneAccountHandle.getId()); Parcel parcel = Parcel.obtain(); parcel.writeParcelable(phoneAccountHandle.getUserHandle(), 0); entryBuilder.setUserHandle(ByteString.copyFrom(parcel.marshall())); parcel.recycle(); return entryBuilder; } Loading java/com/android/contacts/common/widget/select_phone_account_dialog_options.proto +2 −0 Original line number Diff line number Diff line Loading @@ -49,5 +49,7 @@ message SelectPhoneAccountDialogOptions { // in a call so the other SIM cannot be used. Hint should also be set to // inform the user why the account is unavailable. optional bool enabled = 4 [default = true]; optional bytes user_handle = 5; } } No newline at end of file java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java +3 −0 Original line number Diff line number Diff line Loading @@ -1395,6 +1395,9 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder Calls.CONTENT_URI, CallLog.Calls._ID + " IN (" + callIdsStr + ")" /* where */, null /* selectionArgs */); context .getContentResolver() .notifyChange(Calls.CONTENT_URI, null); } return null; Loading java/com/android/dialer/app/calllog/ClearCallLogDialog.java +1 −0 Original line number Diff line number Diff line Loading @@ -101,6 +101,7 @@ public class ClearCallLogDialog extends DialogFragment { @Override public Void doInBackground(@Nullable Void unused) throws Throwable { appContext.getContentResolver().delete(Calls.CONTENT_URI, null, null); appContext.getContentResolver().notifyChange(Calls.CONTENT_URI, null); CachedNumberLookupService cachedNumberLookupService = PhoneNumberCache.get(appContext).getCachedNumberLookupService(); if (cachedNumberLookupService != null) { Loading java/com/android/dialer/calldetails/CallDetailsActivityCommon.java +3 −0 Original line number Diff line number Diff line Loading @@ -277,6 +277,9 @@ abstract class CallDetailsActivityCommon extends AppCompatActivity { context .getContentResolver() .delete(Calls.CONTENT_URI, selection.getSelection(), selection.getSelectionArgs()); context .getContentResolver() .notifyChange(Calls.CONTENT_URI, null); return null; } Loading Loading
java/com/android/contacts/common/widget/SelectPhoneAccountDialogOptionsUtil.java +23 −1 Original line number Diff line number Diff line Loading @@ -16,9 +16,15 @@ package com.android.contacts.common.widget; import android.os.Parcel; import android.os.UserHandle; import android.telecom.PhoneAccount; import android.telecom.PhoneAccountHandle; import com.android.dialer.common.Assert; import com.android.dialer.telecom.TelecomUtil; import com.google.protobuf.ByteString; import java.util.Collection; /** Provides common operation on a {@link SelectPhoneAccountDialogOptions} */ Loading @@ -27,9 +33,21 @@ public final class SelectPhoneAccountDialogOptionsUtil { public static PhoneAccountHandle getPhoneAccountHandle( SelectPhoneAccountDialogOptions.Entry entry) { UserHandle userHandle; Parcel parcel = Parcel.obtain(); try { byte[] marshalledUserHandle = entry.getUserHandle().toByteArray(); parcel.unmarshall(marshalledUserHandle, 0, marshalledUserHandle.length); parcel.setDataPosition(0); userHandle = parcel.readParcelable(UserHandle.class.getClassLoader()); } catch (NullPointerException e) { userHandle = null; } parcel.recycle(); return Assert.isNotNull( TelecomUtil.composePhoneAccountHandle( entry.getPhoneAccountHandleComponentName(), entry.getPhoneAccountHandleId())); entry.getPhoneAccountHandleComponentName(), entry.getPhoneAccountHandleId(), userHandle)); } public static SelectPhoneAccountDialogOptions.Entry.Builder setPhoneAccountHandle( Loading @@ -38,6 +56,10 @@ public final class SelectPhoneAccountDialogOptionsUtil { entryBuilder.setPhoneAccountHandleComponentName( phoneAccountHandle.getComponentName().flattenToString()); entryBuilder.setPhoneAccountHandleId(phoneAccountHandle.getId()); Parcel parcel = Parcel.obtain(); parcel.writeParcelable(phoneAccountHandle.getUserHandle(), 0); entryBuilder.setUserHandle(ByteString.copyFrom(parcel.marshall())); parcel.recycle(); return entryBuilder; } Loading
java/com/android/contacts/common/widget/select_phone_account_dialog_options.proto +2 −0 Original line number Diff line number Diff line Loading @@ -49,5 +49,7 @@ message SelectPhoneAccountDialogOptions { // in a call so the other SIM cannot be used. Hint should also be set to // inform the user why the account is unavailable. optional bool enabled = 4 [default = true]; optional bytes user_handle = 5; } } No newline at end of file
java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java +3 −0 Original line number Diff line number Diff line Loading @@ -1395,6 +1395,9 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder Calls.CONTENT_URI, CallLog.Calls._ID + " IN (" + callIdsStr + ")" /* where */, null /* selectionArgs */); context .getContentResolver() .notifyChange(Calls.CONTENT_URI, null); } return null; Loading
java/com/android/dialer/app/calllog/ClearCallLogDialog.java +1 −0 Original line number Diff line number Diff line Loading @@ -101,6 +101,7 @@ public class ClearCallLogDialog extends DialogFragment { @Override public Void doInBackground(@Nullable Void unused) throws Throwable { appContext.getContentResolver().delete(Calls.CONTENT_URI, null, null); appContext.getContentResolver().notifyChange(Calls.CONTENT_URI, null); CachedNumberLookupService cachedNumberLookupService = PhoneNumberCache.get(appContext).getCachedNumberLookupService(); if (cachedNumberLookupService != null) { Loading
java/com/android/dialer/calldetails/CallDetailsActivityCommon.java +3 −0 Original line number Diff line number Diff line Loading @@ -277,6 +277,9 @@ abstract class CallDetailsActivityCommon extends AppCompatActivity { context .getContentResolver() .delete(Calls.CONTENT_URI, selection.getSelection(), selection.getSelectionArgs()); context .getContentResolver() .notifyChange(Calls.CONTENT_URI, null); return null; } Loading