Loading AndroidManifest.xml +3 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,8 @@ android:minSdkVersion="24" android:targetSdkVersion="30"/> <uses-permission android:name="android.permission.POST_NOTIFICATIONS"/> <uses-permission android:name="android.permission.CALL_PHONE"/> <uses-permission android:name="android.permission.READ_CONTACTS"/> <uses-permission android:name="android.permission.WRITE_CONTACTS"/> Loading Loading @@ -60,6 +62,7 @@ <uses-permission android:name="android.permission.CONNECTIVITY_USE_RESTRICTED_NETWORKS"/> <uses-permission android:name="android.permission.USE_FULL_SCREEN_INTENT"/> <uses-permission android:name="android.permission.READ_PRIVILEGED_PHONE_STATE"/> <uses-permission android:name="android.permission.POST_NOTIFICATIONS" /> <uses-permission android:name="android.permission.CONTROL_INCALL_EXPERIENCE"/> <!-- We use this to disable the status bar buttons of home, back and recent Loading java/com/android/contacts/common/model/ContactLoader.java +5 −0 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ import android.text.TextUtils; import com.android.contacts.common.GroupMetaData; import com.android.contacts.common.model.account.AccountType; import com.android.contacts.common.model.account.AccountTypeWithDataSet; import com.android.contacts.common.model.account.GoogleAccountType; import com.android.contacts.common.model.dataitem.DataItem; import com.android.contacts.common.model.dataitem.PhoneDataItem; import com.android.contacts.common.model.dataitem.PhotoDataItem; Loading Loading @@ -727,6 +728,10 @@ public class ContactLoader extends AsyncTaskLoader<Contact> { final String servicePackageName = accountType.getViewContactNotifyServicePackageName(); if (!TextUtils.isEmpty(serviceName) && !TextUtils.isEmpty(servicePackageName)) { final Uri uri = ContentUris.withAppendedId(RawContacts.CONTENT_URI, rawContactId); if (accountType instanceof GoogleAccountType) { ((GoogleAccountType) accountType).handleRawContactViewed(context, uri); continue; } final Intent intent = new Intent(); intent.setClassName(servicePackageName, serviceName); intent.setAction(Intent.ACTION_VIEW); Loading java/com/android/contacts/common/model/account/GoogleAccountType.java +21 −2 Original line number Diff line number Diff line Loading @@ -18,6 +18,8 @@ package com.android.contacts.common.model.account; import android.content.ContentValues; import android.content.Context; import android.content.Intent; import android.net.Uri; import android.provider.ContactsContract.CommonDataKinds.Email; import android.provider.ContactsContract.CommonDataKinds.Event; import android.provider.ContactsContract.CommonDataKinds.Phone; Loading Loading @@ -196,11 +198,28 @@ public class GoogleAccountType extends BaseAccountType { @Override public String getViewContactNotifyServiceClassName() { return "com.google.android.syncadapters.contacts." + "SyncHighResPhotoIntentService"; return PLUS_EXTENSION_PACKAGE_NAME + ".people.sync.focus.SyncHighResPhotoIntentOperation"; } @Override public String getViewContactNotifyServicePackageName() { return "com.google.android.syncadapters.contacts"; return PLUS_EXTENSION_PACKAGE_NAME; } /** * Sends a broadcast to the sync adapter to trigger a high res photo sync for the contact which * was viewed * @param context context to send broadcast in * @param rawContactUri Uri of the raw contact viewed */ public void handleRawContactViewed(Context context, Uri rawContactUri) { final Intent intent = new Intent(); intent.setData(rawContactUri); // New broadcast for syncing high res photo. intent.setPackage(GoogleAccountType.PLUS_EXTENSION_PACKAGE_NAME); intent.setAction( "com.google.android.gms.people.sync.focus.SYNC_HIGH_RES_PHOTO"); context.sendBroadcast(intent); } } java/com/android/dialer/app/DevicePolicyResources.java 0 → 100644 +54 −0 Original line number Diff line number Diff line /* * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.dialer.app; import android.app.admin.DevicePolicyManager; /** * Class containing the required identifiers to update device management resources. * * <p>See {@link DevicePolicyManager#getDrawable} and {@link DevicePolicyManager#getString}. */ public class DevicePolicyResources { private static final String PREFIX = "Dialer."; /** * The title of the in-call notification for an incoming work call. */ public static final String NOTIFICATION_INCOMING_WORK_CALL_TITLE = PREFIX + "NOTIFICATION_INCOMING_WORK_CALL_TITLE"; /** * The title of the in-call notification for an ongoing work call. */ public static final String NOTIFICATION_ONGOING_WORK_CALL_TITLE = PREFIX + "NOTIFICATION_ONGOING_WORK_CALL_TITLE"; /** * Missed call notification label, used when there's exactly one missed call from work * contact. */ public static final String NOTIFICATION_MISSED_WORK_CALL_TITLE = PREFIX + "NOTIFICATION_MISSED_WORK_CALL_TITLE"; /** * Label for notification indicating that call is being made over wifi. */ public static final String NOTIFICATION_WIFI_WORK_CALL_LABEL = PREFIX + "NOTIFICATION_WIFI_WORK_CALL_LABEL"; } java/com/android/dialer/app/calllog/LegacyVoicemailNotifier.java +2 −3 Original line number Diff line number Diff line Loading @@ -36,7 +36,6 @@ import com.android.dialer.common.LogUtil; import com.android.dialer.location.GeoUtil; import com.android.dialer.notification.DialerNotificationManager; import com.android.dialer.notification.NotificationChannelManager; import com.android.dialer.notification.VoicemailChannelUtils; import com.android.dialer.phonenumberutil.PhoneNumberHelper; import com.android.dialer.telecom.TelecomUtil; import com.android.dialer.theme.base.ThemeComponent; Loading Loading @@ -182,8 +181,8 @@ public final class LegacyVoicemailNotifier { if (context.getSystemService(TelephonyManager.class).getPhoneCount() <= 1) { return NOTIFICATION_TAG; } return NOTIFICATION_TAG_PREFIX + VoicemailChannelUtils.getHashedPhoneAccountId(phoneAccountHandle); return NOTIFICATION_TAG_PREFIX + phoneAccountHandle.getId(); } private LegacyVoicemailNotifier() {} Loading Loading
AndroidManifest.xml +3 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,8 @@ android:minSdkVersion="24" android:targetSdkVersion="30"/> <uses-permission android:name="android.permission.POST_NOTIFICATIONS"/> <uses-permission android:name="android.permission.CALL_PHONE"/> <uses-permission android:name="android.permission.READ_CONTACTS"/> <uses-permission android:name="android.permission.WRITE_CONTACTS"/> Loading Loading @@ -60,6 +62,7 @@ <uses-permission android:name="android.permission.CONNECTIVITY_USE_RESTRICTED_NETWORKS"/> <uses-permission android:name="android.permission.USE_FULL_SCREEN_INTENT"/> <uses-permission android:name="android.permission.READ_PRIVILEGED_PHONE_STATE"/> <uses-permission android:name="android.permission.POST_NOTIFICATIONS" /> <uses-permission android:name="android.permission.CONTROL_INCALL_EXPERIENCE"/> <!-- We use this to disable the status bar buttons of home, back and recent Loading
java/com/android/contacts/common/model/ContactLoader.java +5 −0 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ import android.text.TextUtils; import com.android.contacts.common.GroupMetaData; import com.android.contacts.common.model.account.AccountType; import com.android.contacts.common.model.account.AccountTypeWithDataSet; import com.android.contacts.common.model.account.GoogleAccountType; import com.android.contacts.common.model.dataitem.DataItem; import com.android.contacts.common.model.dataitem.PhoneDataItem; import com.android.contacts.common.model.dataitem.PhotoDataItem; Loading Loading @@ -727,6 +728,10 @@ public class ContactLoader extends AsyncTaskLoader<Contact> { final String servicePackageName = accountType.getViewContactNotifyServicePackageName(); if (!TextUtils.isEmpty(serviceName) && !TextUtils.isEmpty(servicePackageName)) { final Uri uri = ContentUris.withAppendedId(RawContacts.CONTENT_URI, rawContactId); if (accountType instanceof GoogleAccountType) { ((GoogleAccountType) accountType).handleRawContactViewed(context, uri); continue; } final Intent intent = new Intent(); intent.setClassName(servicePackageName, serviceName); intent.setAction(Intent.ACTION_VIEW); Loading
java/com/android/contacts/common/model/account/GoogleAccountType.java +21 −2 Original line number Diff line number Diff line Loading @@ -18,6 +18,8 @@ package com.android.contacts.common.model.account; import android.content.ContentValues; import android.content.Context; import android.content.Intent; import android.net.Uri; import android.provider.ContactsContract.CommonDataKinds.Email; import android.provider.ContactsContract.CommonDataKinds.Event; import android.provider.ContactsContract.CommonDataKinds.Phone; Loading Loading @@ -196,11 +198,28 @@ public class GoogleAccountType extends BaseAccountType { @Override public String getViewContactNotifyServiceClassName() { return "com.google.android.syncadapters.contacts." + "SyncHighResPhotoIntentService"; return PLUS_EXTENSION_PACKAGE_NAME + ".people.sync.focus.SyncHighResPhotoIntentOperation"; } @Override public String getViewContactNotifyServicePackageName() { return "com.google.android.syncadapters.contacts"; return PLUS_EXTENSION_PACKAGE_NAME; } /** * Sends a broadcast to the sync adapter to trigger a high res photo sync for the contact which * was viewed * @param context context to send broadcast in * @param rawContactUri Uri of the raw contact viewed */ public void handleRawContactViewed(Context context, Uri rawContactUri) { final Intent intent = new Intent(); intent.setData(rawContactUri); // New broadcast for syncing high res photo. intent.setPackage(GoogleAccountType.PLUS_EXTENSION_PACKAGE_NAME); intent.setAction( "com.google.android.gms.people.sync.focus.SYNC_HIGH_RES_PHOTO"); context.sendBroadcast(intent); } }
java/com/android/dialer/app/DevicePolicyResources.java 0 → 100644 +54 −0 Original line number Diff line number Diff line /* * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.dialer.app; import android.app.admin.DevicePolicyManager; /** * Class containing the required identifiers to update device management resources. * * <p>See {@link DevicePolicyManager#getDrawable} and {@link DevicePolicyManager#getString}. */ public class DevicePolicyResources { private static final String PREFIX = "Dialer."; /** * The title of the in-call notification for an incoming work call. */ public static final String NOTIFICATION_INCOMING_WORK_CALL_TITLE = PREFIX + "NOTIFICATION_INCOMING_WORK_CALL_TITLE"; /** * The title of the in-call notification for an ongoing work call. */ public static final String NOTIFICATION_ONGOING_WORK_CALL_TITLE = PREFIX + "NOTIFICATION_ONGOING_WORK_CALL_TITLE"; /** * Missed call notification label, used when there's exactly one missed call from work * contact. */ public static final String NOTIFICATION_MISSED_WORK_CALL_TITLE = PREFIX + "NOTIFICATION_MISSED_WORK_CALL_TITLE"; /** * Label for notification indicating that call is being made over wifi. */ public static final String NOTIFICATION_WIFI_WORK_CALL_LABEL = PREFIX + "NOTIFICATION_WIFI_WORK_CALL_LABEL"; }
java/com/android/dialer/app/calllog/LegacyVoicemailNotifier.java +2 −3 Original line number Diff line number Diff line Loading @@ -36,7 +36,6 @@ import com.android.dialer.common.LogUtil; import com.android.dialer.location.GeoUtil; import com.android.dialer.notification.DialerNotificationManager; import com.android.dialer.notification.NotificationChannelManager; import com.android.dialer.notification.VoicemailChannelUtils; import com.android.dialer.phonenumberutil.PhoneNumberHelper; import com.android.dialer.telecom.TelecomUtil; import com.android.dialer.theme.base.ThemeComponent; Loading Loading @@ -182,8 +181,8 @@ public final class LegacyVoicemailNotifier { if (context.getSystemService(TelephonyManager.class).getPhoneCount() <= 1) { return NOTIFICATION_TAG; } return NOTIFICATION_TAG_PREFIX + VoicemailChannelUtils.getHashedPhoneAccountId(phoneAccountHandle); return NOTIFICATION_TAG_PREFIX + phoneAccountHandle.getId(); } private LegacyVoicemailNotifier() {} Loading