diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-05-10 07:08:18 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-05-10 07:08:18 +0000 |
commit | ce7a5d79d350793590faae4ab06f33768b8272cc (patch) | |
tree | 4499a21621c72a3c6f0c7d359f06aaef7609f0b7 | |
parent | eb5f9ca7b8d8ff768a322a851148bcc0d8617cec (diff) | |
parent | 633b5d26f4a9d9c9143ca67f8032e5a487028e91 (diff) | |
download | Dialer-ce7a5d79d350793590faae4ab06f33768b8272cc.tar.gz |
Snap for 8564071 from 633b5d26f4a9d9c9143ca67f8032e5a487028e91 to mainline-permission-releaseaml_per_331913010aml_per_331812030aml_per_331710050aml_per_331611010aml_per_331512020aml_per_331411000aml_per_331313010aml_per_331115020aml_per_331019040aml_per_330912010aml_per_330811030android13-mainline-permission-release
Change-Id: Ie1742c12488d07dca4c3abababdbb85900eb62aa
95 files changed, 433 insertions, 202 deletions
diff --git a/Android.mk b/Android.mk index b7a4a8ffe..c842c5e69 100644 --- a/Android.mk +++ b/Android.mk @@ -122,11 +122,11 @@ LOCAL_STATIC_JAVA_LIBRARIES := \ dialer-mime4j-dom-target \ dialer-okhttp-target \ dialer-okio-target \ - dialer-error-prone-target \ dialer-guava-target \ dialer-glide-target \ dialer-glide-annotation-target \ dialer-zxing-target \ + error_prone_annotations \ jsr305 \ libbackup \ libphonenumber \ @@ -143,11 +143,11 @@ LOCAL_STATIC_ANDROID_LIBRARIES := \ android-support-v7-recyclerview \ LOCAL_JAVA_LIBRARIES := \ - dialer-auto-value-target \ + auto_value_annotations \ org.apache.http.legacy \ LOCAL_ANNOTATION_PROCESSORS := \ - dialer-auto-value \ + auto_value_plugin \ javapoet-prebuilt-jar \ dialer-dagger2 \ dialer-dagger2-compiler \ @@ -176,7 +176,11 @@ LOCAL_PRIVILEGED_MODULE := true LOCAL_PRODUCT_MODULE := true LOCAL_USE_AAPT2 := true LOCAL_REQUIRED_MODULES := privapp_whitelist_com.android.dialer +LOCAL_USES_LIBRARIES := org.apache.http.legacy +LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 +LOCAL_LICENSE_CONDITIONS := notice +LOCAL_NOTICE_FILE := $(LOCAL_PATH)/LICENSE include $(BUILD_PACKAGE) # Cleanup local state @@ -191,7 +195,6 @@ EXCLUDE_EXTRA_PACKAGES := include $(CLEAR_VARS) LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := \ - dialer-auto-value:../../../prebuilts/tools/common/m2/repository/com/google/auto/value/auto-value/1.5.2/auto-value-1.5.2.jar \ dialer-dagger2-compiler:../../../prebuilts/tools/common/m2/repository/com/google/dagger/dagger-compiler/2.7/dagger-compiler-2.7.jar \ dialer-dagger2:../../../prebuilts/tools/common/m2/repository/com/google/dagger/dagger/2.7/dagger-2.7.jar \ dialer-dagger2-producers:../../../prebuilts/tools/common/m2/repository/com/google/dagger/dagger-producers/2.7/dagger-producers-2.7.jar \ @@ -205,8 +208,6 @@ LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := \ dialer-guava:../../../prebuilts/tools/common/m2/repository/com/google/guava/guava/23.0/guava-23.0.jar \ dialer-javax-annotation-api:../../../prebuilts/tools/common/m2/repository/javax/annotation/javax.annotation-api/1.2/javax.annotation-api-1.2.jar \ dialer-javax-inject:../../../prebuilts/tools/common/m2/repository/javax/inject/javax.inject/1/javax.inject-1.jar \ - dialer-auto-service:../../../prebuilts/tools/common/m2/repository/com/google/auto/service/auto-service/1.0-rc2/auto-service-1.0-rc2.jar \ - dialer-auto-common:../../../prebuilts/tools/common/m2/repository/com/google/auto/auto-common/0.9/auto-common-0.9.jar \ include $(BUILD_HOST_PREBUILT) @@ -216,6 +217,9 @@ include $(CLEAR_VARS) LOCAL_MODULE_CLASS := JAVA_LIBRARIES LOCAL_MODULE := dialer-guava-target +LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 +LOCAL_LICENSE_CONDITIONS := notice +LOCAL_NOTICE_FILE := $(LOCAL_PATH)/LICENSE LOCAL_SDK_VERSION := current LOCAL_SRC_FILES := ../../../prebuilts/tools/common/m2/repository/com/google/guava/guava/23.0/guava-23.0.jar LOCAL_UNINSTALLABLE_MODULE := true @@ -225,17 +229,10 @@ include $(BUILD_PREBUILT) include $(CLEAR_VARS) LOCAL_MODULE_CLASS := JAVA_LIBRARIES -LOCAL_MODULE := dialer-error-prone-target -LOCAL_SDK_VERSION := current -LOCAL_SRC_FILES := ../../../prebuilts/tools/common/m2/repository/com/google/errorprone/error_prone_annotations/2.0.18/error_prone_annotations-2.0.18.jar -LOCAL_UNINSTALLABLE_MODULE := true - -include $(BUILD_PREBUILT) - -include $(CLEAR_VARS) - -LOCAL_MODULE_CLASS := JAVA_LIBRARIES LOCAL_MODULE := dialer-dagger2-target +LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 +LOCAL_LICENSE_CONDITIONS := notice +LOCAL_NOTICE_FILE := $(LOCAL_PATH)/LICENSE LOCAL_SDK_VERSION := current LOCAL_SRC_FILES := ../../../prebuilts/tools/common/m2/repository/com/google/dagger/dagger/2.7/dagger-2.7.jar LOCAL_UNINSTALLABLE_MODULE := true @@ -246,6 +243,9 @@ include $(CLEAR_VARS) LOCAL_MODULE_CLASS := JAVA_LIBRARIES LOCAL_MODULE := dialer-disklrucache-target +LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 +LOCAL_LICENSE_CONDITIONS := notice +LOCAL_NOTICE_FILE := $(LOCAL_PATH)/LICENSE LOCAL_SDK_VERSION := current LOCAL_SRC_FILES := ../../../prebuilts/maven_repo/bumptech/com/github/bumptech/glide/disklrucache/SNAPSHOT/disklrucache-SNAPSHOT.jar LOCAL_UNINSTALLABLE_MODULE := true @@ -256,6 +256,9 @@ include $(CLEAR_VARS) LOCAL_MODULE_CLASS := JAVA_LIBRARIES LOCAL_MODULE := dialer-gifdecoder-target +LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 +LOCAL_LICENSE_CONDITIONS := notice +LOCAL_NOTICE_FILE := $(LOCAL_PATH)/LICENSE LOCAL_SDK_VERSION := current LOCAL_SRC_FILES := ../../../prebuilts/maven_repo/bumptech/com/github/bumptech/glide/gifdecoder/SNAPSHOT/gifdecoder-SNAPSHOT.jar LOCAL_UNINSTALLABLE_MODULE := true @@ -266,6 +269,9 @@ include $(CLEAR_VARS) LOCAL_MODULE_CLASS := JAVA_LIBRARIES LOCAL_MODULE := dialer-glide-target +LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 +LOCAL_LICENSE_CONDITIONS := notice +LOCAL_NOTICE_FILE := $(LOCAL_PATH)/LICENSE LOCAL_SDK_VERSION := current LOCAL_SRC_FILES := ../../../prebuilts/maven_repo/bumptech/com/github/bumptech/glide/glide/SNAPSHOT/glide-SNAPSHOT.jar LOCAL_UNINSTALLABLE_MODULE := true @@ -276,6 +282,9 @@ include $(CLEAR_VARS) LOCAL_MODULE_CLASS := JAVA_LIBRARIES LOCAL_MODULE := dialer-glide-annotation-target +LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 +LOCAL_LICENSE_CONDITIONS := notice +LOCAL_NOTICE_FILE := $(LOCAL_PATH)/LICENSE LOCAL_SDK_VERSION := current LOCAL_SRC_FILES := ../../../prebuilts/maven_repo/bumptech/com/github/bumptech/glide/annotation/SNAPSHOT/annotation-SNAPSHOT.jar LOCAL_UNINSTALLABLE_MODULE := true @@ -286,6 +295,9 @@ include $(CLEAR_VARS) LOCAL_MODULE_CLASS := JAVA_LIBRARIES LOCAL_MODULE := dialer-javax-annotation-api-target +LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 +LOCAL_LICENSE_CONDITIONS := notice +LOCAL_NOTICE_FILE := $(LOCAL_PATH)/LICENSE LOCAL_SDK_VERSION := current LOCAL_SRC_FILES := ../../../prebuilts/tools/common/m2/repository/javax/annotation/javax.annotation-api/1.2/javax.annotation-api-1.2.jar LOCAL_UNINSTALLABLE_MODULE := true @@ -296,6 +308,9 @@ include $(CLEAR_VARS) LOCAL_MODULE_CLASS := JAVA_LIBRARIES LOCAL_MODULE := dialer-libshortcutbadger-target +LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 +LOCAL_LICENSE_CONDITIONS := notice +LOCAL_NOTICE_FILE := $(LOCAL_PATH)/LICENSE LOCAL_SDK_VERSION := current LOCAL_SRC_FILES := ../../../prebuilts/tools/common/m2/repository/me/leolin/ShortcutBadger/1.1.13/ShortcutBadger-1.1.13.jar LOCAL_UNINSTALLABLE_MODULE := true @@ -306,6 +321,9 @@ include $(CLEAR_VARS) LOCAL_MODULE_CLASS := JAVA_LIBRARIES LOCAL_MODULE := dialer-javax-inject-target +LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 +LOCAL_LICENSE_CONDITIONS := notice +LOCAL_NOTICE_FILE := $(LOCAL_PATH)/LICENSE LOCAL_SDK_VERSION := current LOCAL_SRC_FILES := ../../../prebuilts/tools/common/m2/repository/javax/inject/javax.inject/1/javax.inject-1.jar LOCAL_UNINSTALLABLE_MODULE := true @@ -316,6 +334,9 @@ include $(CLEAR_VARS) LOCAL_MODULE_CLASS := JAVA_LIBRARIES LOCAL_MODULE := dialer-commons-io-target +LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 +LOCAL_LICENSE_CONDITIONS := notice +LOCAL_NOTICE_FILE := $(LOCAL_PATH)/LICENSE LOCAL_SDK_VERSION := current LOCAL_SRC_FILES := ../../../prebuilts/tools/common/m2/repository/commons-io/commons-io/2.4/commons-io-2.4.jar LOCAL_UNINSTALLABLE_MODULE := true @@ -326,6 +347,9 @@ include $(CLEAR_VARS) LOCAL_MODULE_CLASS := JAVA_LIBRARIES LOCAL_MODULE := dialer-mime4j-core-target +LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 +LOCAL_LICENSE_CONDITIONS := notice +LOCAL_NOTICE_FILE := $(LOCAL_PATH)/LICENSE LOCAL_SDK_VERSION := current LOCAL_SRC_FILES := ../../../prebuilts/tools/common/m2/repository/org/apache/james/apache-mime4j-core/0.7.2/apache-mime4j-core-0.7.2.jar LOCAL_UNINSTALLABLE_MODULE := true @@ -336,6 +360,9 @@ include $(CLEAR_VARS) LOCAL_MODULE_CLASS := JAVA_LIBRARIES LOCAL_MODULE := dialer-mime4j-dom-target +LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 +LOCAL_LICENSE_CONDITIONS := notice +LOCAL_NOTICE_FILE := $(LOCAL_PATH)/LICENSE LOCAL_SDK_VERSION := current LOCAL_SRC_FILES := ../../../prebuilts/tools/common/m2/repository/org/apache/james/apache-mime4j-dom/0.7.2/apache-mime4j-dom-0.7.2.jar LOCAL_UNINSTALLABLE_MODULE := true @@ -346,6 +373,9 @@ include $(CLEAR_VARS) LOCAL_MODULE_CLASS := JAVA_LIBRARIES LOCAL_MODULE := dialer-grpc-core-target +LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 +LOCAL_LICENSE_CONDITIONS := notice +LOCAL_NOTICE_FILE := $(LOCAL_PATH)/LICENSE LOCAL_SDK_VERSION := current LOCAL_SRC_FILES := ../../../prebuilts/tools/common/m2/repository/io/grpc/grpc-core/1.0.3/grpc-core-1.0.3.jar LOCAL_UNINSTALLABLE_MODULE := true @@ -356,6 +386,9 @@ include $(CLEAR_VARS) LOCAL_MODULE_CLASS := JAVA_LIBRARIES LOCAL_MODULE := dialer-grpc-okhttp-target +LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 +LOCAL_LICENSE_CONDITIONS := notice +LOCAL_NOTICE_FILE := $(LOCAL_PATH)/LICENSE LOCAL_SDK_VERSION := current LOCAL_SRC_FILES := ../../../prebuilts/tools/common/m2/repository/io/grpc/grpc-okhttp/1.0.3/grpc-okhttp-1.0.3.jar LOCAL_UNINSTALLABLE_MODULE := true @@ -366,6 +399,9 @@ include $(CLEAR_VARS) LOCAL_MODULE_CLASS := JAVA_LIBRARIES LOCAL_MODULE := dialer-grpc-protobuf-lite-target +LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 +LOCAL_LICENSE_CONDITIONS := notice +LOCAL_NOTICE_FILE := $(LOCAL_PATH)/LICENSE LOCAL_SDK_VERSION := current LOCAL_SRC_FILES := ../../../prebuilts/tools/common/m2/repository/io/grpc/grpc-protobuf-lite/1.0.3/grpc-protobuf-lite-1.0.3.jar LOCAL_UNINSTALLABLE_MODULE := true @@ -376,6 +412,9 @@ include $(CLEAR_VARS) LOCAL_MODULE_CLASS := JAVA_LIBRARIES LOCAL_MODULE := dialer-grpc-stub-target +LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 +LOCAL_LICENSE_CONDITIONS := notice +LOCAL_NOTICE_FILE := $(LOCAL_PATH)/LICENSE LOCAL_SDK_VERSION := current LOCAL_SRC_FILES := ../../../prebuilts/tools/common/m2/repository/io/grpc/grpc-stub/1.0.3/grpc-stub-1.0.3.jar LOCAL_UNINSTALLABLE_MODULE := true @@ -386,6 +425,9 @@ include $(CLEAR_VARS) LOCAL_MODULE_CLASS := JAVA_LIBRARIES LOCAL_MODULE := dialer-grpc-all-target +LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 +LOCAL_LICENSE_CONDITIONS := notice +LOCAL_NOTICE_FILE := $(LOCAL_PATH)/LICENSE LOCAL_SDK_VERSION := current LOCAL_SRC_FILES := ../../../prebuilts/tools/common/m2/repository/io/grpc/grpc-all/1.0.3/grpc-all-1.0.3.jar LOCAL_UNINSTALLABLE_MODULE := true @@ -396,26 +438,23 @@ include $(CLEAR_VARS) LOCAL_MODULE_CLASS := JAVA_LIBRARIES LOCAL_MODULE := dialer-grpc-context-target +LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 +LOCAL_LICENSE_CONDITIONS := notice +LOCAL_NOTICE_FILE := $(LOCAL_PATH)/LICENSE LOCAL_SDK_VERSION := current LOCAL_SRC_FILES := ../../../prebuilts/tools/common/m2/repository/io/grpc/grpc-context/1.0.3/grpc-context-1.0.3.jar LOCAL_UNINSTALLABLE_MODULE := true include $(BUILD_PREBUILT) -include $(CLEAR_VARS) - -LOCAL_MODULE_CLASS := JAVA_LIBRARIES -LOCAL_MODULE := dialer-auto-value-target -LOCAL_SDK_VERSION := current -LOCAL_SRC_FILES := ../../../prebuilts/tools/common/m2/repository/com/google/auto/value/auto-value/1.5.2/auto-value-1.5.2.jar -LOCAL_UNINSTALLABLE_MODULE := true - -include $(BUILD_PREBUILT) include $(CLEAR_VARS) LOCAL_MODULE_CLASS := JAVA_LIBRARIES LOCAL_MODULE := dialer-zxing-target +LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 +LOCAL_LICENSE_CONDITIONS := notice +LOCAL_NOTICE_FILE := $(LOCAL_PATH)/LICENSE LOCAL_SDK_VERSION := current LOCAL_SRC_FILES := ../../../external/zxing/core/core.jar LOCAL_UNINSTALLABLE_MODULE := true @@ -426,6 +465,9 @@ include $(CLEAR_VARS) LOCAL_MODULE_CLASS := JAVA_LIBRARIES LOCAL_MODULE := dialer-okhttp-target +LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 +LOCAL_LICENSE_CONDITIONS := notice +LOCAL_NOTICE_FILE := $(LOCAL_PATH)/LICENSE LOCAL_SDK_VERSION := current LOCAL_SRC_FILES := ../../../prebuilts/tools/common/m2/repository/com/squareup/okhttp/okhttp/2.7.4/okhttp-2.7.4.jar LOCAL_UNINSTALLABLE_MODULE := true @@ -436,6 +478,9 @@ include $(CLEAR_VARS) LOCAL_MODULE_CLASS := JAVA_LIBRARIES LOCAL_MODULE := dialer-okio-target +LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 +LOCAL_LICENSE_CONDITIONS := notice +LOCAL_NOTICE_FILE := $(LOCAL_PATH)/LICENSE LOCAL_SDK_VERSION := current LOCAL_SRC_FILES := ../../../prebuilts/tools/common/m2/repository/com/squareup/okio/okio/1.9.0/okio-1.9.0.jar LOCAL_UNINSTALLABLE_MODULE := true @@ -446,6 +491,9 @@ include $(CLEAR_VARS) LOCAL_MODULE_CLASS := JAVA_LIBRARIES LOCAL_MODULE := dialer-j2objc-annotations-target +LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 +LOCAL_LICENSE_CONDITIONS := notice +LOCAL_NOTICE_FILE := $(LOCAL_PATH)/LICENSE LOCAL_SDK_VERSION := current LOCAL_SRC_FILES := ../../../prebuilts/tools/common/m2/repository/com/google/j2objc/j2objc-annotations/1.1/j2objc-annotations-1.1.jar LOCAL_UNINSTALLABLE_MODULE := true @@ -456,6 +504,9 @@ include $(CLEAR_VARS) LOCAL_MODULE_CLASS := JAVA_LIBRARIES LOCAL_MODULE := dialer-animal-sniffer-annotations-target +LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 +LOCAL_LICENSE_CONDITIONS := notice +LOCAL_NOTICE_FILE := $(LOCAL_PATH)/LICENSE LOCAL_SDK_VERSION := current LOCAL_SRC_FILES := ../../../prebuilts/tools/common/m2/repository/org/codehaus/mojo/animal-sniffer-annotations/1.14/animal-sniffer-annotations-1.14.jar LOCAL_UNINSTALLABLE_MODULE := true @@ -465,6 +516,9 @@ include $(BUILD_PREBUILT) include $(CLEAR_VARS) LOCAL_MODULE := dialer-rootcomponentprocessor +LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 +LOCAL_LICENSE_CONDITIONS := notice +LOCAL_NOTICE_FILE := $(LOCAL_PATH)/LICENSE LOCAL_MODULE_CLASS := JAVA_LIBRARIES LOCAL_IS_HOST_MODULE := true BASE_DIR := java/com/android @@ -482,10 +536,11 @@ LOCAL_STATIC_JAVA_LIBRARIES := \ dialer-guava \ dialer-dagger2 \ javapoet-prebuilt-jar \ - dialer-auto-service \ - dialer-auto-common \ + auto_service_annotations \ + auto_common \ dialer-javax-annotation-api \ - dialer-javax-inject + dialer-javax-inject \ + error_prone_annotations LOCAL_JAVA_LANGUAGE_VERSION := 1.8 diff --git a/AndroidManifest.xml b/AndroidManifest.xml index fe8147f07..a106e12c9 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -21,8 +21,10 @@ <uses-sdk android:minSdkVersion="24" - android:targetSdkVersion="28"/> + 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"/> @@ -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 @@ -74,6 +77,10 @@ presses home. --> <uses-permission android:name="android.permission.STOP_APP_SWITCHES"/> + <!-- Used for sending PendingIntents to dynamically registered receivers --> + <uses-permission android:name="com.android.dialer.permission.DIALER_ORIGIN" + android:protectionLevel="signature" /> + <!-- Permissions needed for badger count showing on launch icon. --> <!--for Samsung--> diff --git a/assets/quantum/AndroidManifest.xml b/assets/quantum/AndroidManifest.xml index f57466507..28f8eec97 100644 --- a/assets/quantum/AndroidManifest.xml +++ b/assets/quantum/AndroidManifest.xml @@ -16,6 +16,6 @@ --> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.google.android.assets.quantum"> - <uses-sdk android:targetSdkVersion="28" /> + <uses-sdk android:targetSdkVersion="30" /> <application/> </manifest> diff --git a/java/com/android/contacts/common/AndroidManifest.xml b/java/com/android/contacts/common/AndroidManifest.xml index e97221549..84ac96fdb 100644 --- a/java/com/android/contacts/common/AndroidManifest.xml +++ b/java/com/android/contacts/common/AndroidManifest.xml @@ -21,6 +21,7 @@ <activity android:name="com.android.contacts.common.dialog.CallSubjectDialog" android:theme="@style/Theme.CallSubjectDialogTheme" + android:exported="false" android:windowSoftInputMode="stateVisible|adjustResize"> <intent-filter> <action android:name="android.intent.action.VIEW"/> diff --git a/java/com/android/contacts/common/compat/telecom/TelecomManagerCompat.java b/java/com/android/contacts/common/compat/telecom/TelecomManagerCompat.java index ca8ed29ec..a1dc89d75 100644 --- a/java/com/android/contacts/common/compat/telecom/TelecomManagerCompat.java +++ b/java/com/android/contacts/common/compat/telecom/TelecomManagerCompat.java @@ -15,6 +15,8 @@ */ package com.android.contacts.common.compat.telecom; +import android.os.Build.VERSION; +import android.os.Build.VERSION_CODES; import android.support.annotation.Nullable; import android.telecom.PhoneAccountHandle; import android.telecom.TelecomManager; @@ -50,13 +52,16 @@ public class TelecomManagerCompat { return null; } - /** - * Handovers are supported from Android O-DR onward. Since there is no API bump from O to O-DR, we - * need to use reflection to check the existence of TelecomManager.EXTRA_IS_HANDOVER in - * http://cs/android/frameworks/base/telecomm/java/android/telecom/TelecomManager.java. - */ + /** Returns true if the Android version supports Handover. */ public static boolean supportsHandover() { - // + // Starting with Android P, handover is supported via a public API. + if (VERSION.SDK_INT >= VERSION_CODES.P) { + return true; + } + // Handovers are supported from Android O-DR onward. Since there is no API + // bump from O to O-DR, we need to use reflection to check the existence + // of TelecomManager.EXTRA_IS_HANDOVER in + // http://cs/android/frameworks/base/telecomm/java/android/telecom/TelecomManager.java. try { Field field = TelecomManager.class.getDeclaredField("EXTRA_IS_HANDOVER"); return "android.telecom.extra.IS_HANDOVER".equals(field.get(null /* obj (static field) */)); diff --git a/java/com/android/contacts/common/model/ContactLoader.java b/java/com/android/contacts/common/model/ContactLoader.java index 12cca4f13..a3a3b9d7f 100644 --- a/java/com/android/contacts/common/model/ContactLoader.java +++ b/java/com/android/contacts/common/model/ContactLoader.java @@ -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; @@ -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); diff --git a/java/com/android/contacts/common/model/account/GoogleAccountType.java b/java/com/android/contacts/common/model/account/GoogleAccountType.java index a25544bb9..e10ade479 100644 --- a/java/com/android/contacts/common/model/account/GoogleAccountType.java +++ b/java/com/android/contacts/common/model/account/GoogleAccountType.java @@ -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; @@ -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); } } diff --git a/java/com/android/contacts/common/widget/SelectPhoneAccountDialogOptionsUtil.java b/java/com/android/contacts/common/widget/SelectPhoneAccountDialogOptionsUtil.java index 5a44ae7f8..1880d6538 100644 --- a/java/com/android/contacts/common/widget/SelectPhoneAccountDialogOptionsUtil.java +++ b/java/com/android/contacts/common/widget/SelectPhoneAccountDialogOptionsUtil.java @@ -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} */ @@ -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( @@ -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; } diff --git a/java/com/android/contacts/common/widget/select_phone_account_dialog_options.proto b/java/com/android/contacts/common/widget/select_phone_account_dialog_options.proto index cc40c64b4..fc443f0cd 100644 --- a/java/com/android/contacts/common/widget/select_phone_account_dialog_options.proto +++ b/java/com/android/contacts/common/widget/select_phone_account_dialog_options.proto @@ -16,7 +16,6 @@ syntax = "proto2"; option java_package = "com.android.contacts.common.widget"; option java_multiple_files = true; -option optimize_for = LITE_RUNTIME; package com.android.contacts.common.widget; @@ -50,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 diff --git a/java/com/android/dialer/app/AndroidManifest.xml b/java/com/android/dialer/app/AndroidManifest.xml index 190f098a5..ade5bd447 100644 --- a/java/com/android/dialer/app/AndroidManifest.xml +++ b/java/com/android/dialer/app/AndroidManifest.xml @@ -56,7 +56,7 @@ <uses-sdk android:minSdkVersion="24" - android:targetSdkVersion="28"/> + android:targetSdkVersion="30"/> <application> @@ -78,7 +78,8 @@ android:theme="@style/DialtactsTheme"> </activity> - <receiver android:name="com.android.dialer.app.calllog.CallLogReceiver"> + <receiver android:name="com.android.dialer.app.calllog.CallLogReceiver" + android:exported="true"> <intent-filter> <action android:name="android.intent.action.NEW_VOICEMAIL"/> <data @@ -115,6 +116,7 @@ <receiver android:directBootAware="true" + android:exported="true" android:name="com.android.dialer.app.calllog.MissedCallNotificationReceiver"> <intent-filter> <action android:name="android.telecom.action.SHOW_MISSED_CALLS_NOTIFICATION"/> @@ -122,6 +124,7 @@ </receiver> <!-- Handles voicemail notifications from telephony. Requires O --> <receiver android:name=".voicemail.LegacyVoicemailNotificationReceiver" + android:exported="true" android:directBootAware="true"> <intent-filter> <action android:name="android.telephony.action.SHOW_VOICEMAIL_NOTIFICATION"/> diff --git a/java/com/android/dialer/app/DevicePolicyResources.java b/java/com/android/dialer/app/DevicePolicyResources.java new file mode 100644 index 000000000..c783f0bb3 --- /dev/null +++ b/java/com/android/dialer/app/DevicePolicyResources.java @@ -0,0 +1,54 @@ +/* + * 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"; +} diff --git a/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java b/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java index e044460c5..05011d102 100644 --- a/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java +++ b/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java @@ -560,7 +560,7 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder case CallbackAction.VOICE: if (callLogCache.isVoicemailNumber(accountHandle, number)) { // Call to generic voicemail number, in case there are multiple accounts - primaryActionButtonView.setTag(IntentProvider.getReturnVoicemailCallIntentProvider(null)); + primaryActionButtonView.setTag(IntentProvider.getReturnVoicemailCallIntentProvider()); } else if (canSupportAssistedDialing()) { primaryActionButtonView.setTag( IntentProvider.getAssistedDialIntentProvider( diff --git a/java/com/android/dialer/app/calllog/IntentProvider.java b/java/com/android/dialer/app/calllog/IntentProvider.java index 21f341815..423b49c22 100644 --- a/java/com/android/dialer/app/calllog/IntentProvider.java +++ b/java/com/android/dialer/app/calllog/IntentProvider.java @@ -161,14 +161,13 @@ public abstract class IntentProvider { }; } - public static IntentProvider getReturnVoicemailCallIntentProvider( - @Nullable PhoneAccountHandle phoneAccountHandle) { + public static IntentProvider getReturnVoicemailCallIntentProvider() { return new IntentProvider() { @Override public Intent getIntent(Context context) { return PreCall.getIntent( context, - CallIntentBuilder.forVoicemail(phoneAccountHandle, CallInitiationType.Type.CALL_LOG)); + CallIntentBuilder.forVoicemail(CallInitiationType.Type.CALL_LOG)); } }; } diff --git a/java/com/android/dialer/app/calllog/LegacyVoicemailNotifier.java b/java/com/android/dialer/app/calllog/LegacyVoicemailNotifier.java index 31e9edc6a..62ae748de 100644 --- a/java/com/android/dialer/app/calllog/LegacyVoicemailNotifier.java +++ b/java/com/android/dialer/app/calllog/LegacyVoicemailNotifier.java @@ -181,6 +181,7 @@ public final class LegacyVoicemailNotifier { if (context.getSystemService(TelephonyManager.class).getPhoneCount() <= 1) { return NOTIFICATION_TAG; } + return NOTIFICATION_TAG_PREFIX + phoneAccountHandle.getId(); } diff --git a/java/com/android/dialer/app/calllog/MissedCallNotifier.java b/java/com/android/dialer/app/calllog/MissedCallNotifier.java index 4b5bfba8a..f2d2af834 100644 --- a/java/com/android/dialer/app/calllog/MissedCallNotifier.java +++ b/java/com/android/dialer/app/calllog/MissedCallNotifier.java @@ -15,9 +15,12 @@ */ package com.android.dialer.app.calllog; +import static com.android.dialer.app.DevicePolicyResources.NOTIFICATION_MISSED_WORK_CALL_TITLE; + import android.app.Notification; import android.app.Notification.Builder; import android.app.PendingIntent; +import android.app.admin.DevicePolicyManager; import android.content.ComponentName; import android.content.Context; import android.content.Intent; @@ -107,7 +110,7 @@ public class MissedCallNotifier implements Worker<Pair<Integer, String>, Void> { void updateMissedCallNotification(int count, @Nullable String number) { LogUtil.enterBlock("MissedCallNotifier.updateMissedCallNotification"); - final int titleResId; + final String titleText; CharSequence expandedText; // The text in the notification's line 1 and 2. List<NewCall> newCalls = callLogNotificationsQueryHelper.getNewMissedCalls(); @@ -168,10 +171,13 @@ public class MissedCallNotifier implements Worker<Pair<Integer, String>, Void> { ContactInfo contactInfo = callLogNotificationsQueryHelper.getContactInfo( call.number, call.numberPresentation, call.countryIso); - titleResId = - contactInfo.userType == ContactsUtils.USER_TYPE_WORK - ? R.string.notification_missedWorkCallTitle - : R.string.notification_missedCallTitle; + if (contactInfo.userType == ContactsUtils.USER_TYPE_WORK) { + titleText = context.getSystemService(DevicePolicyManager.class).getResources().getString( + NOTIFICATION_MISSED_WORK_CALL_TITLE, + () -> context.getString(R.string.notification_missedWorkCallTitle)); + } else { + titleText = context.getString(R.string.notification_missedCallTitle); + } if (TextUtils.equals(contactInfo.name, contactInfo.formattedNumber) || TextUtils.equals(contactInfo.name, contactInfo.number)) { @@ -189,7 +195,7 @@ public class MissedCallNotifier implements Worker<Pair<Integer, String>, Void> { groupSummary.setLargeIcon(photoIcon); } } else { - titleResId = R.string.notification_missedCallsTitle; + titleText = context.getString(R.string.notification_missedCallsTitle); expandedText = context.getString(R.string.notification_missedCallsMsg, count); } @@ -199,14 +205,14 @@ public class MissedCallNotifier implements Worker<Pair<Integer, String>, Void> { // notification content is hidden. Notification.Builder publicSummaryBuilder = createNotificationBuilder(); publicSummaryBuilder - .setContentTitle(context.getText(titleResId)) + .setContentTitle(titleText) .setContentIntent(createCallLogPendingIntent()) .setDeleteIntent( CallLogNotificationsService.createCancelAllMissedCallsPendingIntent(context)); // Create the notification summary suitable for display when sensitive information is showing. groupSummary - .setContentTitle(context.getText(titleResId)) + .setContentTitle(titleText) .setContentText(expandedText) .setContentIntent(createCallLogPendingIntent()) .setDeleteIntent( diff --git a/java/com/android/dialer/app/list/PhoneFavoriteTileView.java b/java/com/android/dialer/app/list/PhoneFavoriteTileView.java index f9f8e0e5e..7f0a6bcd5 100644 --- a/java/com/android/dialer/app/list/PhoneFavoriteTileView.java +++ b/java/com/android/dialer/app/list/PhoneFavoriteTileView.java @@ -57,7 +57,7 @@ public abstract class PhoneFavoriteTileView extends ContactTileView { // make room for the contact name and number label at the bottom of the image. private static final float DEFAULT_IMAGE_LETTER_OFFSET = -0.12f; private static final float DEFAULT_IMAGE_LETTER_SCALE = 0.70f; - // Dummy clip data object that is attached to drag shadows so that text views + // Placeholder clip data object that is attached to drag shadows so that text views // don't crash with an NPE if the drag shadow is released in their bounds private static final ClipData EMPTY_CLIP_DATA = ClipData.newPlainText("", ""); /** View that contains the transparent shadow that is overlaid on top of the contact image. */ diff --git a/java/com/android/dialer/assisteddialing/AndroidManifest.xml b/java/com/android/dialer/assisteddialing/AndroidManifest.xml index 3825c507d..6b44f1b1a 100644 --- a/java/com/android/dialer/assisteddialing/AndroidManifest.xml +++ b/java/com/android/dialer/assisteddialing/AndroidManifest.xml @@ -17,6 +17,6 @@ <uses-sdk android:minSdkVersion="24" - android:targetSdkVersion="28"/> + android:targetSdkVersion="30"/> </manifest> diff --git a/java/com/android/dialer/assisteddialing/ui/AndroidManifest.xml b/java/com/android/dialer/assisteddialing/ui/AndroidManifest.xml index b0a1011d1..fb6e30510 100644 --- a/java/com/android/dialer/assisteddialing/ui/AndroidManifest.xml +++ b/java/com/android/dialer/assisteddialing/ui/AndroidManifest.xml @@ -17,13 +17,14 @@ <uses-sdk android:minSdkVersion="24" - android:targetSdkVersion="28"/> + android:targetSdkVersion="30"/> <application> <activity android:label="@string/assisted_dialing_setting_title" android:name=".AssistedDialingSettingActivity" android:parentActivityName="com.android.dialer.app.settings.DialerSettingsActivity" + android:exported="true" android:theme="@style/SettingsStyle"> <intent-filter> <action android:name="com.android.dialer.app.settings.SHOW_ASSISTED_DIALING_SETTINGS"/> diff --git a/java/com/android/dialer/binary/google/AndroidManifest.xml b/java/com/android/dialer/binary/google/AndroidManifest.xml index 051556b27..8555ff6e0 100644 --- a/java/com/android/dialer/binary/google/AndroidManifest.xml +++ b/java/com/android/dialer/binary/google/AndroidManifest.xml @@ -21,7 +21,7 @@ <uses-sdk android:minSdkVersion="24" - android:targetSdkVersion="28"/> + android:targetSdkVersion="30"/> <uses-permission android:name="android.permission.CALL_PHONE"/> <uses-permission android:name="android.permission.READ_CONTACTS"/> diff --git a/java/com/android/dialer/blockreportspam/block_report_spam_dialog_info.proto b/java/com/android/dialer/blockreportspam/block_report_spam_dialog_info.proto index 70872c7e0..a9a7c2aeb 100644 --- a/java/com/android/dialer/blockreportspam/block_report_spam_dialog_info.proto +++ b/java/com/android/dialer/blockreportspam/block_report_spam_dialog_info.proto @@ -2,7 +2,6 @@ syntax = "proto2"; option java_package = "com.android.dialer.blockreportspam"; option java_multiple_files = true; -option optimize_for = LITE_RUNTIME; package com.android.dialer.blockreportspam; diff --git a/java/com/android/dialer/callcomposer/camera/CameraManager.java b/java/com/android/dialer/callcomposer/camera/CameraManager.java index c61f57050..e802cc2ad 100644 --- a/java/com/android/dialer/callcomposer/camera/CameraManager.java +++ b/java/com/android/dialer/callcomposer/camera/CameraManager.java @@ -85,7 +85,7 @@ public class CameraManager implements FocusOverlayManager.Listener { private static final int NO_CAMERA_SELECTED = -1; - private static final Camera.ShutterCallback DUMMY_SHUTTER_CALLBACK = + private static final Camera.ShutterCallback NOOP_SHUTTER_CALLBACK = new Camera.ShutterCallback() { @Override public void onShutter() { @@ -493,7 +493,7 @@ public class CameraManager implements FocusOverlayManager.Listener { try { this.camera.takePicture( // A shutter callback is required to enable shutter sound - DUMMY_SHUTTER_CALLBACK, null /* raw */, null /* postView */, jpegCallback); + NOOP_SHUTTER_CALLBACK, null /* raw */, null /* postView */, jpegCallback); } catch (final RuntimeException e) { LogUtil.e("CameraManager.takePicture", "RuntimeException in CameraManager.takePicture", e); takingPicture = false; diff --git a/java/com/android/dialer/calldetails/proto/call_details_entries.proto b/java/com/android/dialer/calldetails/proto/call_details_entries.proto index 0f11b537e..1ab3af657 100644 --- a/java/com/android/dialer/calldetails/proto/call_details_entries.proto +++ b/java/com/android/dialer/calldetails/proto/call_details_entries.proto @@ -2,7 +2,6 @@ syntax = "proto2"; option java_package = "com.android.dialer.calldetails"; option java_multiple_files = true; -option optimize_for = LITE_RUNTIME; import "java/com/android/dialer/enrichedcall/historyquery/proto/history_result.proto"; diff --git a/java/com/android/dialer/calldetails/proto/call_details_header_info.proto b/java/com/android/dialer/calldetails/proto/call_details_header_info.proto index e2532d504..d650a406f 100644 --- a/java/com/android/dialer/calldetails/proto/call_details_header_info.proto +++ b/java/com/android/dialer/calldetails/proto/call_details_header_info.proto @@ -2,7 +2,6 @@ syntax = "proto2"; option java_package = "com.android.dialer.calldetails"; option java_multiple_files = true; -option optimize_for = LITE_RUNTIME; import "java/com/android/dialer/phonenumberproto/dialer_phone_number.proto"; diff --git a/java/com/android/dialer/callintent/CallIntentBuilder.java b/java/com/android/dialer/callintent/CallIntentBuilder.java index 613fdf6a3..7cc589123 100644 --- a/java/com/android/dialer/callintent/CallIntentBuilder.java +++ b/java/com/android/dialer/callintent/CallIntentBuilder.java @@ -117,10 +117,10 @@ public class CallIntentBuilder implements Parcelable { } public static CallIntentBuilder forVoicemail( - @Nullable PhoneAccountHandle phoneAccountHandle, CallInitiationType.Type callInitiationType) { + CallInitiationType.Type callInitiationType) { return new CallIntentBuilder( Uri.fromParts(PhoneAccount.SCHEME_VOICEMAIL, "", null), callInitiationType) - .setPhoneAccountHandle(phoneAccountHandle); + .setPhoneAccountHandle(null); } public void setUri(@NonNull Uri uri) { diff --git a/java/com/android/dialer/callintent/call_initiation_type.proto b/java/com/android/dialer/callintent/call_initiation_type.proto index 3823e49fb..0f74f07af 100644 --- a/java/com/android/dialer/callintent/call_initiation_type.proto +++ b/java/com/android/dialer/callintent/call_initiation_type.proto @@ -2,7 +2,6 @@ syntax = "proto2"; option java_package = "com.android.dialer.callintent"; option java_multiple_files = true; -option optimize_for = LITE_RUNTIME; package com.android.dialer.callintent; diff --git a/java/com/android/dialer/callintent/call_specific_app_data.proto b/java/com/android/dialer/callintent/call_specific_app_data.proto index 065a7aba7..2ec903094 100644 --- a/java/com/android/dialer/callintent/call_specific_app_data.proto +++ b/java/com/android/dialer/callintent/call_specific_app_data.proto @@ -2,7 +2,6 @@ syntax = "proto2"; option java_package = "com.android.dialer.callintent"; option java_multiple_files = true; -option optimize_for = LITE_RUNTIME; package com.android.dialer.callintent; diff --git a/java/com/android/dialer/callintent/speed_dial_contact_type.proto b/java/com/android/dialer/callintent/speed_dial_contact_type.proto index ecb1c3f28..df14f41aa 100644 --- a/java/com/android/dialer/callintent/speed_dial_contact_type.proto +++ b/java/com/android/dialer/callintent/speed_dial_contact_type.proto @@ -2,7 +2,6 @@ syntax = "proto2"; option java_package = "com.android.dialer.callintent"; option java_multiple_files = true; -option optimize_for = LITE_RUNTIME; package com.android.dialer.callintent; diff --git a/java/com/android/dialer/calllog/AndroidManifest.xml b/java/com/android/dialer/calllog/AndroidManifest.xml index 27e11a0f9..35a798ec2 100644 --- a/java/com/android/dialer/calllog/AndroidManifest.xml +++ b/java/com/android/dialer/calllog/AndroidManifest.xml @@ -18,7 +18,7 @@ <uses-sdk android:minSdkVersion="24" - android:targetSdkVersion="28"/> + android:targetSdkVersion="30"/> <application> diff --git a/java/com/android/dialer/calllog/config/AndroidManifest.xml b/java/com/android/dialer/calllog/config/AndroidManifest.xml index 2d447af03..80ba1d5c3 100644 --- a/java/com/android/dialer/calllog/config/AndroidManifest.xml +++ b/java/com/android/dialer/calllog/config/AndroidManifest.xml @@ -18,7 +18,7 @@ <uses-sdk android:minSdkVersion="24" - android:targetSdkVersion="28"/> + android:targetSdkVersion="30"/> <application> diff --git a/java/com/android/dialer/calllog/database/contract/coalesced_ids.proto b/java/com/android/dialer/calllog/database/contract/coalesced_ids.proto index 059f95782..c34e01b6b 100644 --- a/java/com/android/dialer/calllog/database/contract/coalesced_ids.proto +++ b/java/com/android/dialer/calllog/database/contract/coalesced_ids.proto @@ -16,7 +16,6 @@ syntax = "proto2"; option java_package = "com.android.dialer"; option java_multiple_files = true; -option optimize_for = LITE_RUNTIME; package com.android.dialer; diff --git a/java/com/android/dialer/calllog/database/contract/number_attributes.proto b/java/com/android/dialer/calllog/database/contract/number_attributes.proto index 2c46d1b12..97d69d784 100644 --- a/java/com/android/dialer/calllog/database/contract/number_attributes.proto +++ b/java/com/android/dialer/calllog/database/contract/number_attributes.proto @@ -16,7 +16,6 @@ syntax = "proto2"; option java_package = "com.android.dialer"; option java_multiple_files = true; -option optimize_for = LITE_RUNTIME; package com.android.dialer; diff --git a/java/com/android/dialer/calllog/model/coalesced_row.proto b/java/com/android/dialer/calllog/model/coalesced_row.proto index 913f07298..cfa42c8df 100644 --- a/java/com/android/dialer/calllog/model/coalesced_row.proto +++ b/java/com/android/dialer/calllog/model/coalesced_row.proto @@ -2,7 +2,6 @@ syntax = "proto2"; option java_package = "com.android.dialer.calllog.model"; option java_multiple_files = true; -option optimize_for = LITE_RUNTIME; package com.android.dialer.calllog.model; diff --git a/java/com/android/dialer/commandline/impl/CallCommand.java b/java/com/android/dialer/commandline/impl/CallCommand.java index b3ea8601f..d0008a321 100644 --- a/java/com/android/dialer/commandline/impl/CallCommand.java +++ b/java/com/android/dialer/commandline/impl/CallCommand.java @@ -19,8 +19,6 @@ package com.android.dialer.commandline.impl; import android.content.Context; import android.content.Intent; import android.support.annotation.NonNull; -import android.telecom.PhoneAccount; -import android.telecom.PhoneAccountHandle; import android.telecom.TelecomManager; import com.android.dialer.buildtype.BuildType; import com.android.dialer.buildtype.BuildType.Type; @@ -67,12 +65,10 @@ public class CallCommand implements Command { } String number = args.expectPositional(0, "number"); TelecomManager telecomManager = appContext.getSystemService(TelecomManager.class); - PhoneAccountHandle phoneAccountHandle = - telecomManager.getDefaultOutgoingPhoneAccount(PhoneAccount.SCHEME_TEL); CallIntentBuilder callIntentBuilder; if ("voicemail".equals(number)) { callIntentBuilder = - CallIntentBuilder.forVoicemail(phoneAccountHandle, CallInitiationType.Type.DIALPAD); + CallIntentBuilder.forVoicemail(CallInitiationType.Type.DIALPAD); } else { callIntentBuilder = new CallIntentBuilder(number, CallInitiationType.Type.DIALPAD); } diff --git a/java/com/android/dialer/contactphoto/ContactPhotoManagerImpl.java b/java/com/android/dialer/contactphoto/ContactPhotoManagerImpl.java index cf42606a6..f7f79e17f 100644 --- a/java/com/android/dialer/contactphoto/ContactPhotoManagerImpl.java +++ b/java/com/android/dialer/contactphoto/ContactPhotoManagerImpl.java @@ -92,7 +92,8 @@ class ContactPhotoManagerImpl extends ContactPhotoManager implements Callback { private static final String[] COLUMNS = new String[] {Photo._ID, Photo.PHOTO}; /** - * Dummy object used to indicate that a bitmap for a given key could not be stored in the cache. + * Placeholder object used to indicate that a bitmap for a given key could not be stored in the + * cache. */ private static final BitmapHolder BITMAP_UNAVAILABLE; /** Cache size for {@link #bitmapHolderCache} for devices with "large" RAM. */ diff --git a/java/com/android/dialer/contacts/hiresphoto/HighResolutionPhotoRequesterImpl.java b/java/com/android/dialer/contacts/hiresphoto/HighResolutionPhotoRequesterImpl.java index 9201604be..0c1461313 100644 --- a/java/com/android/dialer/contacts/hiresphoto/HighResolutionPhotoRequesterImpl.java +++ b/java/com/android/dialer/contacts/hiresphoto/HighResolutionPhotoRequesterImpl.java @@ -51,8 +51,8 @@ public class HighResolutionPhotoRequesterImpl implements HighResolutionPhotoRequ @VisibleForTesting static final ComponentName SYNC_HIGH_RESOLUTION_PHOTO_SERVICE = new ComponentName( - "com.google.android.syncadapters.contacts", - "com.google.android.syncadapters.contacts.SyncHighResPhotoIntentService"); + "com.google.android.gms", + "com.google.android.gms.people.sync.focus.SyncHighResPhotoIntentOperation"); private final Context appContext; private final ListeningExecutorService backgroundExecutor; @@ -81,7 +81,8 @@ public class HighResolutionPhotoRequesterImpl implements HighResolutionPhotoRequ private void requestInternal(Uri contactUri) throws RequestFailedException { for (Long rawContactId : getGoogleRawContactIds(getContactId(contactUri))) { Uri rawContactUri = ContentUris.withAppendedId(RawContacts.CONTENT_URI, rawContactId); - Intent intent = new Intent(Intent.ACTION_VIEW); + Intent intent = new Intent(); + intent.setAction("com.google.android.gms.people.sync.focus.SYNC_HIGH_RES_PHOTO"); intent.setComponent(SYNC_HIGH_RESOLUTION_PHOTO_SERVICE); intent.setDataAndType(rawContactUri, RawContacts.CONTENT_ITEM_TYPE); intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); @@ -89,7 +90,7 @@ public class HighResolutionPhotoRequesterImpl implements HighResolutionPhotoRequ LogUtil.i( "HighResolutionPhotoRequesterImpl.requestInternal", "requesting photo for " + rawContactUri); - appContext.startService(intent); + appContext.sendBroadcast(intent); } catch (IllegalStateException | SecurityException e) { throw new RequestFailedException("unable to start sync adapter", e); } diff --git a/java/com/android/dialer/database/FilteredNumberContract.java b/java/com/android/dialer/database/FilteredNumberContract.java index 3efbaafb1..5a7153ed3 100644 --- a/java/com/android/dialer/database/FilteredNumberContract.java +++ b/java/com/android/dialer/database/FilteredNumberContract.java @@ -30,7 +30,7 @@ public final class FilteredNumberContract { public static final Uri AUTHORITY_URI = Uri.parse("content://" + AUTHORITY); - /** The type of filtering to be applied, e.g. block the number or whitelist the number. */ + /** The type of filtering to be applied, e.g. block the number or allow the number. */ public interface FilteredNumberTypes { int UNDEFINED = 0; diff --git a/java/com/android/dialer/dialercontact/dialer_contact.proto b/java/com/android/dialer/dialercontact/dialer_contact.proto index 2d1dfbd3c..fe108a0b6 100644 --- a/java/com/android/dialer/dialercontact/dialer_contact.proto +++ b/java/com/android/dialer/dialercontact/dialer_contact.proto @@ -2,7 +2,6 @@ syntax = "proto2"; option java_package = "com.android.dialer.dialercontact"; option java_multiple_files = true; -option optimize_for = LITE_RUNTIME; package com.android.dialer.dialercontact; diff --git a/java/com/android/dialer/dialpadview/DialpadFragment.java b/java/com/android/dialer/dialpadview/DialpadFragment.java index 2d0eff543..12c82c98f 100644 --- a/java/com/android/dialer/dialpadview/DialpadFragment.java +++ b/java/com/android/dialer/dialpadview/DialpadFragment.java @@ -1136,7 +1136,7 @@ public class DialpadFragment extends Fragment public void callVoicemail() { PreCall.start( - getContext(), CallIntentBuilder.forVoicemail(null, CallInitiationType.Type.DIALPAD)); + getContext(), CallIntentBuilder.forVoicemail(CallInitiationType.Type.DIALPAD)); hideAndClearDialpad(); } diff --git a/java/com/android/dialer/enrichedcall/historyquery/proto/history_result.proto b/java/com/android/dialer/enrichedcall/historyquery/proto/history_result.proto index 8efb35cc1..6aed395c6 100644 --- a/java/com/android/dialer/enrichedcall/historyquery/proto/history_result.proto +++ b/java/com/android/dialer/enrichedcall/historyquery/proto/history_result.proto @@ -2,7 +2,6 @@ syntax = "proto2"; option java_package = "com.android.dialer.enrichedcall.historyquery.proto"; option java_multiple_files = true; -option optimize_for = LITE_RUNTIME; package com.android.dialer.enrichedcall.historyquery.proto; diff --git a/java/com/android/dialer/glidephotomanager/photo_info.proto b/java/com/android/dialer/glidephotomanager/photo_info.proto index 07908d807..4e18e033e 100644 --- a/java/com/android/dialer/glidephotomanager/photo_info.proto +++ b/java/com/android/dialer/glidephotomanager/photo_info.proto @@ -2,7 +2,6 @@ syntax = "proto2"; option java_package = "com.android.dialer.glidephotomanager"; option java_multiple_files = true; -option optimize_for = LITE_RUNTIME; package com.android.dialer.glidephotomanager; diff --git a/java/com/android/dialer/historyitemactions/history_item_action_module_info.proto b/java/com/android/dialer/historyitemactions/history_item_action_module_info.proto index f7022c28c..2e8d2a050 100644 --- a/java/com/android/dialer/historyitemactions/history_item_action_module_info.proto +++ b/java/com/android/dialer/historyitemactions/history_item_action_module_info.proto @@ -2,7 +2,6 @@ syntax = "proto2"; option java_package = "com.android.dialer.historyitemactions"; option java_multiple_files = true; -option optimize_for = LITE_RUNTIME; package com.android.dialer.historyitemactions; diff --git a/java/com/android/dialer/historyitemactions/history_item_bottom_sheet_header_info.proto b/java/com/android/dialer/historyitemactions/history_item_bottom_sheet_header_info.proto index 04d9f2259..c36c50f1f 100644 --- a/java/com/android/dialer/historyitemactions/history_item_bottom_sheet_header_info.proto +++ b/java/com/android/dialer/historyitemactions/history_item_bottom_sheet_header_info.proto @@ -2,7 +2,6 @@ syntax = "proto2"; option java_package = "com.android.dialer.historyitemactions"; option java_multiple_files = true; -option optimize_for = LITE_RUNTIME; package com.android.dialer.historyitemactions; diff --git a/java/com/android/dialer/interactions/AndroidManifest.xml b/java/com/android/dialer/interactions/AndroidManifest.xml index 4571a6965..a4b09786b 100644 --- a/java/com/android/dialer/interactions/AndroidManifest.xml +++ b/java/com/android/dialer/interactions/AndroidManifest.xml @@ -8,7 +8,8 @@ android:exported="false" android:name="com.android.dialer.interactions.ContactUpdateService"/> - <receiver android:name="com.android.dialer.interactions.UndemoteOutgoingCallReceiver"> + <receiver android:name="com.android.dialer.interactions.UndemoteOutgoingCallReceiver" + android:exported="true"> <intent-filter> <action android:name="android.intent.action.NEW_OUTGOING_CALL"/> </intent-filter> diff --git a/java/com/android/dialer/logging/contact_lookup_result.proto b/java/com/android/dialer/logging/contact_lookup_result.proto index 6dda2a6d8..437215869 100644 --- a/java/com/android/dialer/logging/contact_lookup_result.proto +++ b/java/com/android/dialer/logging/contact_lookup_result.proto @@ -3,7 +3,6 @@ syntax = "proto2"; package com.android.dialer.logging; option java_package = "com.android.dialer.logging"; option java_multiple_files = true; -option optimize_for = LITE_RUNTIME; diff --git a/java/com/android/dialer/logging/contact_source.proto b/java/com/android/dialer/logging/contact_source.proto index fbff642b2..0c0199603 100644 --- a/java/com/android/dialer/logging/contact_source.proto +++ b/java/com/android/dialer/logging/contact_source.proto @@ -3,7 +3,6 @@ syntax = "proto2"; package com.android.dialer.logging; option java_package = "com.android.dialer.logging"; option java_multiple_files = true; -option optimize_for = LITE_RUNTIME; diff --git a/java/com/android/dialer/logging/dialer_impression.proto b/java/com/android/dialer/logging/dialer_impression.proto index f3173f82e..0f362d9bc 100644 --- a/java/com/android/dialer/logging/dialer_impression.proto +++ b/java/com/android/dialer/logging/dialer_impression.proto @@ -3,7 +3,6 @@ syntax = "proto2"; package com.android.dialer.logging; option java_package = "com.android.dialer.logging"; option java_multiple_files = true; -option optimize_for = LITE_RUNTIME; diff --git a/java/com/android/dialer/logging/interaction_event.proto b/java/com/android/dialer/logging/interaction_event.proto index 47ea53461..d7a09bdfb 100644 --- a/java/com/android/dialer/logging/interaction_event.proto +++ b/java/com/android/dialer/logging/interaction_event.proto @@ -3,7 +3,6 @@ syntax = "proto2"; package com.android.dialer.logging; option java_package = "com.android.dialer.logging"; option java_multiple_files = true; -option optimize_for = LITE_RUNTIME; diff --git a/java/com/android/dialer/logging/people_api_lookup_error.proto b/java/com/android/dialer/logging/people_api_lookup_error.proto index e37d10aee..450641621 100644 --- a/java/com/android/dialer/logging/people_api_lookup_error.proto +++ b/java/com/android/dialer/logging/people_api_lookup_error.proto @@ -3,7 +3,6 @@ syntax = "proto2"; package com.android.dialer.logging; option java_package = "com.android.dialer.logging"; option java_multiple_files = true; -option optimize_for = LITE_RUNTIME; diff --git a/java/com/android/dialer/logging/reporting_location.proto b/java/com/android/dialer/logging/reporting_location.proto index 1d6ba4752..d2fd6dd97 100644 --- a/java/com/android/dialer/logging/reporting_location.proto +++ b/java/com/android/dialer/logging/reporting_location.proto @@ -3,7 +3,6 @@ syntax = "proto2"; package com.android.dialer.logging; option java_package = "com.android.dialer.logging"; option java_multiple_files = true; -option optimize_for = LITE_RUNTIME; diff --git a/java/com/android/dialer/logging/screen_event.proto b/java/com/android/dialer/logging/screen_event.proto index f4d073579..8081f6e45 100644 --- a/java/com/android/dialer/logging/screen_event.proto +++ b/java/com/android/dialer/logging/screen_event.proto @@ -3,7 +3,6 @@ syntax = "proto2"; package com.android.dialer.logging; option java_package = "com.android.dialer.logging"; option java_multiple_files = true; -option optimize_for = LITE_RUNTIME; diff --git a/java/com/android/dialer/logging/ui_action.proto b/java/com/android/dialer/logging/ui_action.proto index 886fe04eb..d14bfbbc8 100644 --- a/java/com/android/dialer/logging/ui_action.proto +++ b/java/com/android/dialer/logging/ui_action.proto @@ -3,7 +3,6 @@ syntax = "proto2"; package com.android.dialer.logging; option java_package = "com.android.dialer.logging"; option java_multiple_files = true; -option optimize_for = LITE_RUNTIME; diff --git a/java/com/android/dialer/logging/video_tech.proto b/java/com/android/dialer/logging/video_tech.proto index b5cd35145..1f274be83 100644 --- a/java/com/android/dialer/logging/video_tech.proto +++ b/java/com/android/dialer/logging/video_tech.proto @@ -3,7 +3,6 @@ syntax = "proto2"; package com.android.dialer.logging; option java_package = "com.android.dialer.logging"; option java_multiple_files = true; -option optimize_for = LITE_RUNTIME; diff --git a/java/com/android/dialer/main/impl/toolbar/res/layout/expanded_search_bar.xml b/java/com/android/dialer/main/impl/toolbar/res/layout/expanded_search_bar.xml index e5b72f233..a7b3aebd2 100644 --- a/java/com/android/dialer/main/impl/toolbar/res/layout/expanded_search_bar.xml +++ b/java/com/android/dialer/main/impl/toolbar/res/layout/expanded_search_bar.xml @@ -17,7 +17,7 @@ xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/search_box_expanded" android:layout_width="match_parent" - android:layout_height="@dimen/expanded_search_bar_height" + android:layout_height="@dimen/collapsed_search_bar_height" android:visibility="invisible"> <ImageButton diff --git a/java/com/android/dialer/phonelookup/phone_lookup_info.proto b/java/com/android/dialer/phonelookup/phone_lookup_info.proto index f5ab5f0a9..c0fa31d57 100644 --- a/java/com/android/dialer/phonelookup/phone_lookup_info.proto +++ b/java/com/android/dialer/phonelookup/phone_lookup_info.proto @@ -2,7 +2,6 @@ syntax = "proto2"; option java_package = "com.android.dialer.phonelookup"; option java_multiple_files = true; -option optimize_for = LITE_RUNTIME; package com.android.dialer.phonelookup; @@ -141,7 +140,7 @@ message PhoneLookupInfo { } optional PeopleApiInfo people_api_info = 3; - // Whether a number is blocked or not. Used by both the system blacklist and + // Whether a number is blocked or not. Used by both the system block list and // dialer fallback enum BlockedState { UNKNOWN = 0; diff --git a/java/com/android/dialer/phonenumberproto/dialer_phone_number.proto b/java/com/android/dialer/phonenumberproto/dialer_phone_number.proto index ad8a8f9fa..143e2c824 100644 --- a/java/com/android/dialer/phonenumberproto/dialer_phone_number.proto +++ b/java/com/android/dialer/phonenumberproto/dialer_phone_number.proto @@ -16,7 +16,6 @@ syntax = "proto2"; option java_package = "com.android.dialer"; option java_multiple_files = true; -option optimize_for = LITE_RUNTIME; package com.android.dialer; diff --git a/java/com/android/dialer/phonenumberutil/PhoneNumberHelper.java b/java/com/android/dialer/phonenumberutil/PhoneNumberHelper.java index df7716cfd..9e3039461 100644 --- a/java/com/android/dialer/phonenumberutil/PhoneNumberHelper.java +++ b/java/com/android/dialer/phonenumberutil/PhoneNumberHelper.java @@ -202,6 +202,9 @@ public class PhoneNumberHelper { if (presentation == CallLog.Calls.PRESENTATION_RESTRICTED) { return false; } + if (presentation == CallLog.Calls.PRESENTATION_UNAVAILABLE) { + return false; + } if (presentation == CallLog.Calls.PRESENTATION_PAYPHONE) { return false; } diff --git a/java/com/android/dialer/postcall/AndroidManifest.xml b/java/com/android/dialer/postcall/AndroidManifest.xml index ca7fb710a..82101a0b3 100644 --- a/java/com/android/dialer/postcall/AndroidManifest.xml +++ b/java/com/android/dialer/postcall/AndroidManifest.xml @@ -21,7 +21,7 @@ <activity android:name="com.android.dialer.postcall.PostCallActivity" android:exported="false" - android:theme="@style/Theme.AppCompat.Light" + android:theme="@style/Dialer.ThemeBase.NoActionBar" android:windowSoftInputMode="adjustResize"/> </application> </manifest> diff --git a/java/com/android/dialer/postcall/PostCall.java b/java/com/android/dialer/postcall/PostCall.java index 542b8d09c..376cb456b 100644 --- a/java/com/android/dialer/postcall/PostCall.java +++ b/java/com/android/dialer/postcall/PostCall.java @@ -72,13 +72,14 @@ public class PostCall { private static void promptUserToSendMessage(Activity activity, View rootView) { LogUtil.i("PostCall.promptUserToSendMessage", "returned from call, showing post call SnackBar"); + String number = Assert.isNotNull(getPhoneNumber(activity)); String message = activity.getString(R.string.post_call_message); EnrichedCallManager manager = EnrichedCallComponent.get(activity).getEnrichedCallManager(); - EnrichedCallCapabilities capabilities = manager.getCapabilities(getPhoneNumber(activity)); + EnrichedCallCapabilities capabilities = manager.getCapabilities(number); LogUtil.i( "PostCall.promptUserToSendMessage", "number: %s, capabilities: %s", - LogUtil.sanitizePhoneNumber(getPhoneNumber(activity)), + LogUtil.sanitizePhoneNumber(number), capabilities); boolean isRcsPostCall = capabilities != null && capabilities.isPostCallCapable(); @@ -87,7 +88,6 @@ public class PostCall { ? activity.getString(R.string.post_call_add_message) : activity.getString(R.string.post_call_send_message); - String number = Assert.isNotNull(getPhoneNumber(activity)); OnClickListener onClickListener = v -> { Logger.get(activity) diff --git a/java/com/android/dialer/promotion/impl/AndroidManifest.xml b/java/com/android/dialer/promotion/impl/AndroidManifest.xml index c938b9a37..55a165765 100644 --- a/java/com/android/dialer/promotion/impl/AndroidManifest.xml +++ b/java/com/android/dialer/promotion/impl/AndroidManifest.xml @@ -18,6 +18,6 @@ <uses-sdk android:minSdkVersion="24" - android:targetSdkVersion="28"/> + android:targetSdkVersion="30"/> </manifest> diff --git a/java/com/android/dialer/rtt/rtt_transcript.proto b/java/com/android/dialer/rtt/rtt_transcript.proto index a580b0d2f..c674ba69f 100644 --- a/java/com/android/dialer/rtt/rtt_transcript.proto +++ b/java/com/android/dialer/rtt/rtt_transcript.proto @@ -2,7 +2,6 @@ syntax = "proto2"; option java_package = "com.android.dialer.rtt"; option java_multiple_files = true; -option optimize_for = LITE_RUNTIME; package com.android.dialer.rtt; diff --git a/java/com/android/dialer/shortcuts/AndroidManifest.xml b/java/com/android/dialer/shortcuts/AndroidManifest.xml index c0f07bf01..e54b659ca 100644 --- a/java/com/android/dialer/shortcuts/AndroidManifest.xml +++ b/java/com/android/dialer/shortcuts/AndroidManifest.xml @@ -18,7 +18,7 @@ <uses-sdk android:minSdkVersion="24" - android:targetSdkVersion="28"/> + android:targetSdkVersion="30"/> <application> diff --git a/java/com/android/dialer/simulator/impl/SimulatorDialogFragment.java b/java/com/android/dialer/simulator/impl/SimulatorDialogFragment.java index 96ea62739..dcf803250 100644 --- a/java/com/android/dialer/simulator/impl/SimulatorDialogFragment.java +++ b/java/com/android/dialer/simulator/impl/SimulatorDialogFragment.java @@ -27,7 +27,7 @@ import android.widget.EditText; public final class SimulatorDialogFragment extends DialogFragment { private final String[] callerIdPresentationItems = { - "ALLOWED", "PAYPHONE", "RESTRICTED", "UNKNOWN" + "ALLOWED", "PAYPHONE", "RESTRICTED", "UNKNOWN", "UNAVAILABLE" }; private int callerIdPresentationChoice = 1; @@ -68,6 +68,9 @@ public final class SimulatorDialogFragment extends DialogFragment { case 3: callerIdPresentationChoice = TelecomManager.PRESENTATION_UNKNOWN; break; + case 4: + callerIdPresentationChoice = TelecomManager.PRESENTATION_UNAVAILABLE; + break; default: throw new IllegalStateException("Unknown presentation choice selected!"); } diff --git a/java/com/android/dialer/spannable/AndroidManifest.xml b/java/com/android/dialer/spannable/AndroidManifest.xml index 0b0514477..e768daccd 100644 --- a/java/com/android/dialer/spannable/AndroidManifest.xml +++ b/java/com/android/dialer/spannable/AndroidManifest.xml @@ -18,5 +18,5 @@ <uses-sdk android:minSdkVersion="24" - android:targetSdkVersion="28"/> + android:targetSdkVersion="30"/> </manifest> diff --git a/java/com/android/dialer/speeddial/database/SpeedDialEntryDatabaseHelper.java b/java/com/android/dialer/speeddial/database/SpeedDialEntryDatabaseHelper.java index 211af86ad..caba77f12 100644 --- a/java/com/android/dialer/speeddial/database/SpeedDialEntryDatabaseHelper.java +++ b/java/com/android/dialer/speeddial/database/SpeedDialEntryDatabaseHelper.java @@ -125,7 +125,7 @@ public final class SpeedDialEntryDatabaseHelper extends SQLiteOpenHelper Channel.builder() .setNumber(number) .setPhoneType(cursor.getInt(POSITION_PHONE_TYPE)) - .setLabel(Optional.of(cursor.getString(POSITION_PHONE_LABEL)).or("")) + .setLabel(Optional.fromNullable(cursor.getString(POSITION_PHONE_LABEL)).or("")) .setTechnology(cursor.getInt(POSITION_PHONE_TECHNOLOGY)) .build(); } diff --git a/java/com/android/dialer/telecom/TelecomUtil.java b/java/com/android/dialer/telecom/TelecomUtil.java index c08814688..633a53e8b 100644 --- a/java/com/android/dialer/telecom/TelecomUtil.java +++ b/java/com/android/dialer/telecom/TelecomUtil.java @@ -25,6 +25,7 @@ import android.content.pm.PackageManager; import android.net.Uri; import android.os.Build.VERSION; import android.os.Build.VERSION_CODES; +import android.os.UserHandle; import android.provider.CallLog.Calls; import android.support.annotation.NonNull; import android.support.annotation.Nullable; @@ -169,6 +170,14 @@ public abstract class TelecomUtil { @Nullable public static PhoneAccountHandle composePhoneAccountHandle( @Nullable String componentString, @Nullable String accountId) { + return composePhoneAccountHandle(componentString, accountId, null); + } + + /** Compose {@link PhoneAccountHandle} object from component name, account id and user handle. */ + @Nullable + public static PhoneAccountHandle composePhoneAccountHandle( + @Nullable String componentString, @Nullable String accountId, + @Nullable UserHandle userHandle) { if (TextUtils.isEmpty(componentString) || TextUtils.isEmpty(accountId)) { return null; } @@ -176,7 +185,11 @@ public abstract class TelecomUtil { if (componentName == null) { return null; } - return new PhoneAccountHandle(componentName, accountId); + if (userHandle == null) { + return new PhoneAccountHandle(componentName, accountId); + } else { + return new PhoneAccountHandle(componentName, accountId, userHandle); + } } /** diff --git a/java/com/android/dialer/voicemail/listui/error/OmtpVoicemailMessageCreator.java b/java/com/android/dialer/voicemail/listui/error/OmtpVoicemailMessageCreator.java index 29b698942..850b93895 100644 --- a/java/com/android/dialer/voicemail/listui/error/OmtpVoicemailMessageCreator.java +++ b/java/com/android/dialer/voicemail/listui/error/OmtpVoicemailMessageCreator.java @@ -66,7 +66,7 @@ public class OmtpVoicemailMessageCreator { return new VoicemailErrorMessage( context.getString(R.string.voicemail_error_activating_title), context.getString(R.string.voicemail_error_activating_message), - VoicemailErrorMessage.createCallVoicemailAction(context, status.getPhoneAccountHandle())); + VoicemailErrorMessage.createCallVoicemailAction(context)); } if (Status.NOTIFICATION_CHANNEL_STATE_NO_CONNECTION == status.notificationChannelState) { @@ -77,7 +77,7 @@ public class OmtpVoicemailMessageCreator { return new VoicemailErrorMessage( context.getString(R.string.voicemail_error_activation_failed_title), context.getString(R.string.voicemail_error_activation_failed_message), - VoicemailErrorMessage.createCallVoicemailAction(context, status.getPhoneAccountHandle()), + VoicemailErrorMessage.createCallVoicemailAction(context), VoicemailErrorMessage.createRetryAction(context, status)); } @@ -85,7 +85,7 @@ public class OmtpVoicemailMessageCreator { return new VoicemailErrorMessage( context.getString(R.string.voicemail_error_no_data_title), context.getString(R.string.voicemail_error_no_data_message), - VoicemailErrorMessage.createCallVoicemailAction(context, status.getPhoneAccountHandle()), + VoicemailErrorMessage.createCallVoicemailAction(context), VoicemailErrorMessage.createRetryAction(context, status)); } @@ -93,7 +93,7 @@ public class OmtpVoicemailMessageCreator { return new VoicemailErrorMessage( context.getString(R.string.voicemail_error_no_data_title), context.getString(R.string.voicemail_error_no_data_cellular_required_message), - VoicemailErrorMessage.createCallVoicemailAction(context, status.getPhoneAccountHandle()), + VoicemailErrorMessage.createCallVoicemailAction(context), VoicemailErrorMessage.createRetryAction(context, status)); } @@ -101,7 +101,7 @@ public class OmtpVoicemailMessageCreator { return new VoicemailErrorMessage( context.getString(R.string.voicemail_error_bad_config_title), context.getString(R.string.voicemail_error_bad_config_message), - VoicemailErrorMessage.createCallVoicemailAction(context, status.getPhoneAccountHandle()), + VoicemailErrorMessage.createCallVoicemailAction(context), VoicemailErrorMessage.createRetryAction(context, status)); } @@ -109,7 +109,7 @@ public class OmtpVoicemailMessageCreator { return new VoicemailErrorMessage( context.getString(R.string.voicemail_error_communication_title), context.getString(R.string.voicemail_error_communication_message), - VoicemailErrorMessage.createCallVoicemailAction(context, status.getPhoneAccountHandle()), + VoicemailErrorMessage.createCallVoicemailAction(context), VoicemailErrorMessage.createRetryAction(context, status)); } @@ -117,7 +117,7 @@ public class OmtpVoicemailMessageCreator { return new VoicemailErrorMessage( context.getString(R.string.voicemail_error_server_title), context.getString(R.string.voicemail_error_server_message), - VoicemailErrorMessage.createCallVoicemailAction(context, status.getPhoneAccountHandle()), + VoicemailErrorMessage.createCallVoicemailAction(context), VoicemailErrorMessage.createRetryAction(context, status)); } @@ -125,7 +125,7 @@ public class OmtpVoicemailMessageCreator { return new VoicemailErrorMessage( context.getString(R.string.voicemail_error_server_connection_title), context.getString(R.string.voicemail_error_server_connection_message), - VoicemailErrorMessage.createCallVoicemailAction(context, status.getPhoneAccountHandle()), + VoicemailErrorMessage.createCallVoicemailAction(context), VoicemailErrorMessage.createRetryAction(context, status)); } diff --git a/java/com/android/dialer/voicemail/listui/error/VoicemailErrorMessage.java b/java/com/android/dialer/voicemail/listui/error/VoicemailErrorMessage.java index 14d6cffdc..e22f30656 100644 --- a/java/com/android/dialer/voicemail/listui/error/VoicemailErrorMessage.java +++ b/java/com/android/dialer/voicemail/listui/error/VoicemailErrorMessage.java @@ -150,7 +150,7 @@ public class VoicemailErrorMessage { public void onClick(View v) { Logger.get(context) .logImpression(DialerImpression.Type.VOICEMAIL_ALERT_SET_PIN_CLICKED); - Intent intent = new Intent(VoicemailChangePinActivity.ACTION_CHANGE_PIN); + Intent intent = new Intent(context, VoicemailChangePinActivity.class); intent.putExtra(VoicemailClient.PARAM_PHONE_ACCOUNT_HANDLE, phoneAccountHandle); context.startActivity(intent); } @@ -159,7 +159,7 @@ public class VoicemailErrorMessage { @NonNull public static Action createCallVoicemailAction( - final Context context, final PhoneAccountHandle phoneAccountHandle) { + final Context context) { return new Action( context.getString(R.string.voicemail_action_call_voicemail), new OnClickListener() { @@ -169,7 +169,7 @@ public class VoicemailErrorMessage { PreCall.start( context, CallIntentBuilder.forVoicemail( - phoneAccountHandle, CallInitiationType.Type.VOICEMAIL_ERROR_MESSAGE)); + CallInitiationType.Type.VOICEMAIL_ERROR_MESSAGE)); } }); } diff --git a/java/com/android/dialer/voicemail/listui/error/Vvm3VoicemailMessageCreator.java b/java/com/android/dialer/voicemail/listui/error/Vvm3VoicemailMessageCreator.java index 17173d82b..863c586b1 100644 --- a/java/com/android/dialer/voicemail/listui/error/Vvm3VoicemailMessageCreator.java +++ b/java/com/android/dialer/voicemail/listui/error/Vvm3VoicemailMessageCreator.java @@ -167,7 +167,7 @@ public class Vvm3VoicemailMessageCreator { return new VoicemailErrorMessage( context.getString(R.string.vvm3_error_unknown_user_title), getCustomerSupportString(context, R.string.vvm3_error_unknown_user_message), - VoicemailErrorMessage.createCallVoicemailAction(context, status.getPhoneAccountHandle()), + VoicemailErrorMessage.createCallVoicemailAction(context), createCallCustomerSupportAction(context)); } @@ -175,7 +175,7 @@ public class Vvm3VoicemailMessageCreator { return new VoicemailErrorMessage( context.getString(R.string.vvm3_error_unknown_device_title), getCustomerSupportString(context, R.string.vvm3_error_unknown_device_message), - VoicemailErrorMessage.createCallVoicemailAction(context, status.getPhoneAccountHandle()), + VoicemailErrorMessage.createCallVoicemailAction(context), createCallCustomerSupportAction(context)); } @@ -183,7 +183,7 @@ public class Vvm3VoicemailMessageCreator { return new VoicemailErrorMessage( context.getString(R.string.vvm3_error_invalid_password_title), getCustomerSupportString(context, R.string.vvm3_error_invalid_password_message), - VoicemailErrorMessage.createCallVoicemailAction(context, status.getPhoneAccountHandle()), + VoicemailErrorMessage.createCallVoicemailAction(context), createCallCustomerSupportAction(context)); } @@ -219,7 +219,7 @@ public class Vvm3VoicemailMessageCreator { return new VoicemailErrorMessage( context.getString(R.string.vvm3_error_subscriber_unknown_title), getCustomerSupportString(context, R.string.vvm3_error_subscriber_unknown_message), - VoicemailErrorMessage.createCallVoicemailAction(context, status.getPhoneAccountHandle()), + VoicemailErrorMessage.createCallVoicemailAction(context), createCallCustomerSupportAction(context)); } @@ -227,7 +227,7 @@ public class Vvm3VoicemailMessageCreator { return new VoicemailErrorMessage( context.getString(R.string.vvm3_error_imap_getquota_error_title), getCustomerSupportString(context, R.string.vvm3_error_imap_getquota_error_message), - VoicemailErrorMessage.createCallVoicemailAction(context, status.getPhoneAccountHandle()), + VoicemailErrorMessage.createCallVoicemailAction(context), createCallCustomerSupportAction(context)); } @@ -235,7 +235,7 @@ public class Vvm3VoicemailMessageCreator { return new VoicemailErrorMessage( context.getString(R.string.vvm3_error_imap_select_error_title), getCustomerSupportString(context, R.string.vvm3_error_imap_select_error_message), - VoicemailErrorMessage.createCallVoicemailAction(context, status.getPhoneAccountHandle()), + VoicemailErrorMessage.createCallVoicemailAction(context), createCallCustomerSupportAction(context)); } @@ -243,7 +243,7 @@ public class Vvm3VoicemailMessageCreator { return new VoicemailErrorMessage( context.getString(R.string.vvm3_error_imap_error_title), getCustomerSupportString(context, R.string.vvm3_error_imap_error_message), - VoicemailErrorMessage.createCallVoicemailAction(context, status.getPhoneAccountHandle()), + VoicemailErrorMessage.createCallVoicemailAction(context), createCallCustomerSupportAction(context)); } diff --git a/java/com/android/dialer/voicemail/model/voicemail_entry.proto b/java/com/android/dialer/voicemail/model/voicemail_entry.proto index c9ca35212..c954f9603 100644 --- a/java/com/android/dialer/voicemail/model/voicemail_entry.proto +++ b/java/com/android/dialer/voicemail/model/voicemail_entry.proto @@ -2,7 +2,6 @@ syntax = "proto2"; option java_package = "com.android.dialer.voicemail.model"; option java_multiple_files = true; -option optimize_for = LITE_RUNTIME; package com.android.dialer.voicemail.model; diff --git a/java/com/android/dialer/voicemail/settings/AndroidManifest.xml b/java/com/android/dialer/voicemail/settings/AndroidManifest.xml index 8506ddd41..f25858e9d 100644 --- a/java/com/android/dialer/voicemail/settings/AndroidManifest.xml +++ b/java/com/android/dialer/voicemail/settings/AndroidManifest.xml @@ -29,10 +29,6 @@ android:parentActivityName="com.android.dialer.app.settings.DialerSettingsActivity" android:theme="@style/SettingsStyle" android:windowSoftInputMode="stateVisible|adjustResize"> - <intent-filter> - <action android:name="com.android.dialer.action.CHANGE_PIN"/> - <category android:name="android.intent.category.DEFAULT"/> - </intent-filter> </activity> <activity android:name=".RecordVoicemailGreetingActivity" diff --git a/java/com/android/dialer/voicemail/settings/VoicemailChangePinActivity.java b/java/com/android/dialer/voicemail/settings/VoicemailChangePinActivity.java index 4e22fb335..ebebdf7d4 100644 --- a/java/com/android/dialer/voicemail/settings/VoicemailChangePinActivity.java +++ b/java/com/android/dialer/voicemail/settings/VoicemailChangePinActivity.java @@ -67,7 +67,6 @@ public class VoicemailChangePinActivity extends Activity implements OnClickListener, OnEditorActionListener, TextWatcher { private static final String TAG = "VmChangePinActivity"; - public static final String ACTION_CHANGE_PIN = "com.android.dialer.action.CHANGE_PIN"; private static final int MESSAGE_HANDLE_RESULT = 1; diff --git a/java/com/android/incallui/AndroidManifest.xml b/java/com/android/incallui/AndroidManifest.xml index 4cb600190..7283702fa 100644 --- a/java/com/android/incallui/AndroidManifest.xml +++ b/java/com/android/incallui/AndroidManifest.xml @@ -19,7 +19,7 @@ <uses-sdk android:minSdkVersion="24" - android:targetSdkVersion="28"/> + android:targetSdkVersion="30"/> <uses-permission android:name="android.permission.CONTROL_INCALL_EXPERIENCE"/> <!-- We use this to disable the status bar buttons of home, back and recent diff --git a/java/com/android/incallui/CallButtonPresenter.java b/java/com/android/incallui/CallButtonPresenter.java index 2a9600a2b..f2f7a405d 100644 --- a/java/com/android/incallui/CallButtonPresenter.java +++ b/java/com/android/incallui/CallButtonPresenter.java @@ -208,18 +208,22 @@ public class CallButtonPresenter int newRoute; if (audioState.getRoute() == CallAudioState.ROUTE_SPEAKER) { newRoute = CallAudioState.ROUTE_WIRED_OR_EARPIECE; - Logger.get(context) - .logCallImpression( - DialerImpression.Type.IN_CALL_SCREEN_TURN_ON_WIRED_OR_EARPIECE, - call.getUniqueCallId(), - call.getTimeAddedMs()); + if (call != null) { + Logger.get(context) + .logCallImpression( + DialerImpression.Type.IN_CALL_SCREEN_TURN_ON_WIRED_OR_EARPIECE, + call.getUniqueCallId(), + call.getTimeAddedMs()); + } } else { newRoute = CallAudioState.ROUTE_SPEAKER; - Logger.get(context) - .logCallImpression( - DialerImpression.Type.IN_CALL_SCREEN_TURN_ON_SPEAKERPHONE, - call.getUniqueCallId(), - call.getTimeAddedMs()); + if (call != null) { + Logger.get(context) + .logCallImpression( + DialerImpression.Type.IN_CALL_SCREEN_TURN_ON_SPEAKERPHONE, + call.getUniqueCallId(), + call.getTimeAddedMs()); + } } setAudioRoute(newRoute); diff --git a/java/com/android/incallui/DtmfKeyListener.java b/java/com/android/incallui/DtmfKeyListener.java index a2a0de09e..330630ae1 100644 --- a/java/com/android/incallui/DtmfKeyListener.java +++ b/java/com/android/incallui/DtmfKeyListener.java @@ -55,8 +55,8 @@ final class DtmfKeyListener extends DialerKeyListener { * necessary to copy the implementation. * * <p>The Spannable is only used to determine which meta keys are pressed, e.g. shift, alt, see - * {@link android.text.method.MetaKeyKeyListener#getMetaState(CharSequence)}, so using a dummy - * value is fine here. + * {@link android.text.method.MetaKeyKeyListener#getMetaState(CharSequence)}, so using a + * placeholder value is fine here. */ private static final Spannable EMPTY_SPANNABLE = new SpannableString(""); diff --git a/java/com/android/incallui/StatusBarNotifier.java b/java/com/android/incallui/StatusBarNotifier.java index 99ff7255e..39428512b 100644 --- a/java/com/android/incallui/StatusBarNotifier.java +++ b/java/com/android/incallui/StatusBarNotifier.java @@ -18,6 +18,9 @@ package com.android.incallui; import static android.telecom.Call.Details.PROPERTY_HIGH_DEF_AUDIO; import static com.android.contacts.common.compat.CallCompat.Details.PROPERTY_ENTERPRISE_CALL; +import static com.android.dialer.app.DevicePolicyResources.NOTIFICATION_INCOMING_WORK_CALL_TITLE; +import static com.android.dialer.app.DevicePolicyResources.NOTIFICATION_ONGOING_WORK_CALL_TITLE; +import static com.android.dialer.app.DevicePolicyResources.NOTIFICATION_WIFI_WORK_CALL_LABEL; import static com.android.incallui.NotificationBroadcastReceiver.ACTION_ACCEPT_VIDEO_UPGRADE_REQUEST; import static com.android.incallui.NotificationBroadcastReceiver.ACTION_ANSWER_SPEAKEASY_CALL; import static com.android.incallui.NotificationBroadcastReceiver.ACTION_ANSWER_VIDEO_INCOMING_CALL; @@ -31,6 +34,7 @@ import static com.android.incallui.NotificationBroadcastReceiver.ACTION_TURN_ON_ import android.Manifest; import android.app.Notification; import android.app.PendingIntent; +import android.app.admin.DevicePolicyManager; import android.content.Context; import android.content.Intent; import android.content.res.Resources; @@ -677,6 +681,10 @@ public class StatusBarNotifier call.getState() == DialerCallState.INCOMING || call.getState() == DialerCallState.CALL_WAITING; + // Is the call placed through work connection service. + boolean isWorkCall = call.hasProperty(PROPERTY_ENTERPRISE_CALL) + || userType == ContactsUtils.USER_TYPE_WORK; + if (isIncomingOrWaiting && call.getNumberPresentation() == TelecomManager.PRESENTATION_ALLOWED) { @@ -687,54 +695,73 @@ public class StatusBarNotifier } } - int resId = R.string.notification_ongoing_call; - String wifiBrand = context.getString(R.string.notification_call_wifi_brand); + + String message = getOngoingCallNotificationMessage(isWorkCall); + String wifiBrand = getWifiBrand(isWorkCall); + + // TODO(a bug): Potentially apply this template logic everywhere. if (call.hasProperty(Details.PROPERTY_WIFI)) { - resId = R.string.notification_ongoing_call_wifi_template; + message = context.getString(R.string.notification_ongoing_call_wifi_template, wifiBrand); } if (isIncomingOrWaiting) { if (call.isSpam()) { - resId = R.string.notification_incoming_spam_call; + message = context.getString(R.string.notification_incoming_spam_call); } else if (shouldShowEnrichedCallNotification(call.getEnrichedCallSession())) { - resId = getECIncomingCallText(call.getEnrichedCallSession()); + message = context.getString(getECIncomingCallText(call.getEnrichedCallSession())); } else if (call.hasProperty(Details.PROPERTY_WIFI)) { - resId = R.string.notification_incoming_call_wifi_template; + message = context.getString(R.string.notification_incoming_call_wifi_template, wifiBrand); } else if (call.getAccountHandle() != null && hasMultiplePhoneAccounts(call)) { return getMultiSimIncomingText(call); } else if (call.isVideoCall()) { - resId = R.string.notification_incoming_video_call; + message = context.getString(R.string.notification_incoming_video_call); } else { - resId = R.string.notification_incoming_call; + message = getIncomingCallNotificationMessage(isWorkCall); } } else if (call.getState() == DialerCallState.ONHOLD) { - resId = R.string.notification_on_hold; + message = context.getString(R.string.notification_on_hold); } else if (DialerCallState.isDialing(call.getState())) { - resId = R.string.notification_dialing; + message = context.getString(R.string.notification_dialing); } else if (call.isVideoCall()) { - resId = - call.getVideoTech().isPaused() + message = context.getString(call.getVideoTech().isPaused() ? R.string.notification_ongoing_paused_video_call - : R.string.notification_ongoing_video_call; + : R.string.notification_ongoing_video_call); } else if (call.getVideoTech().getSessionModificationState() == SessionModificationState.RECEIVED_UPGRADE_TO_VIDEO_REQUEST) { - resId = R.string.notification_requesting_video_call; + message = context.getString(R.string.notification_requesting_video_call); } - // Is the call placed through work connection service. - boolean isWorkCall = call.hasProperty(PROPERTY_ENTERPRISE_CALL); - if (userType == ContactsUtils.USER_TYPE_WORK || isWorkCall) { - resId = getWorkStringFromPersonalString(resId); - wifiBrand = context.getString(R.string.notification_call_wifi_work_brand); + return message; + } + + private String getOngoingCallNotificationMessage(boolean isWorkCall) { + if (isWorkCall) { + DevicePolicyManager dpm = context.getSystemService(DevicePolicyManager.class); + return dpm.getResources().getString(NOTIFICATION_ONGOING_WORK_CALL_TITLE, () -> + context.getString(R.string.notification_ongoing_work_call)); + } else { + return context.getString(R.string.notification_ongoing_call); } + } - if (resId == R.string.notification_incoming_call_wifi_template - || resId == R.string.notification_ongoing_call_wifi_template) { - // TODO(a bug): Potentially apply this template logic everywhere. - return context.getString(resId, wifiBrand); + private String getIncomingCallNotificationMessage(boolean isWorkCall) { + if (isWorkCall) { + DevicePolicyManager dpm = context.getSystemService(DevicePolicyManager.class); + return dpm.getResources().getString(NOTIFICATION_INCOMING_WORK_CALL_TITLE, () -> + context.getString(R.string.notification_incoming_work_call)); + } else { + return context.getString(R.string.notification_incoming_call); } + } - return context.getString(resId); + private String getWifiBrand(boolean isWorkCall) { + if (isWorkCall) { + DevicePolicyManager dpm = context.getSystemService(DevicePolicyManager.class); + return dpm.getResources().getString(NOTIFICATION_WIFI_WORK_CALL_LABEL, () -> + context.getString(R.string.notification_call_wifi_work_brand)); + } else { + return context.getString(R.string.notification_call_wifi_brand); + } } private boolean shouldShowEnrichedCallNotification(Session session) { diff --git a/java/com/android/incallui/answer/impl/hint/AndroidManifest.xml b/java/com/android/incallui/answer/impl/hint/AndroidManifest.xml index dfbba1cbf..f0d0fef42 100644 --- a/java/com/android/incallui/answer/impl/hint/AndroidManifest.xml +++ b/java/com/android/incallui/answer/impl/hint/AndroidManifest.xml @@ -3,7 +3,8 @@ xmlns:android="http://schemas.android.com/apk/res/android"> <application> - <receiver android:name=".PawSecretCodeListener"> + <receiver android:name=".PawSecretCodeListener" + android:exported="true"> <intent-filter> <action android:name="android.provider.Telephony.SECRET_CODE" /> <data android:scheme="android_secret_code" /> diff --git a/java/com/android/incallui/answer/impl/utils/FlingAnimationUtils.java b/java/com/android/incallui/answer/impl/utils/FlingAnimationUtils.java index baec30819..b30afa0f6 100644 --- a/java/com/android/incallui/answer/impl/utils/FlingAnimationUtils.java +++ b/java/com/android/incallui/answer/impl/utils/FlingAnimationUtils.java @@ -32,7 +32,7 @@ public class FlingAnimationUtils { private static final float MIN_VELOCITY_DP_PER_SECOND = 250; private static final float HIGH_VELOCITY_DP_PER_SECOND = 3000; - /** Crazy math. http://en.wikipedia.org/wiki/B%C3%A9zier_curve */ + /** Fancy math. http://en.wikipedia.org/wiki/B%C3%A9zier_curve */ private static final float LINEAR_OUT_SLOW_IN_START_GRADIENT = 1.0f / LINEAR_OUT_SLOW_IN_X2; private Interpolator linearOutSlowIn; diff --git a/java/com/android/incallui/audiomode/AudioModeProvider.java b/java/com/android/incallui/audiomode/AudioModeProvider.java index 6bdd23968..47b021ef8 100644 --- a/java/com/android/incallui/audiomode/AudioModeProvider.java +++ b/java/com/android/incallui/audiomode/AudioModeProvider.java @@ -85,6 +85,7 @@ public class AudioModeProvider { switch (info.getType()) { case AudioDeviceInfo.TYPE_BLUETOOTH_A2DP: case AudioDeviceInfo.TYPE_BLUETOOTH_SCO: + case AudioDeviceInfo.TYPE_BLE_HEADSET: hasBluetooth = true; continue; case AudioDeviceInfo.TYPE_WIRED_HEADSET: diff --git a/java/com/android/incallui/autoresizetext/AndroidManifest.xml b/java/com/android/incallui/autoresizetext/AndroidManifest.xml index f6eb34b9e..f66ee5709 100644 --- a/java/com/android/incallui/autoresizetext/AndroidManifest.xml +++ b/java/com/android/incallui/autoresizetext/AndroidManifest.xml @@ -19,7 +19,7 @@ <uses-sdk android:minSdkVersion="24" - android:targetSdkVersion="28"/> + android:targetSdkVersion="30"/> <application /> </manifest> diff --git a/java/com/android/incallui/call/DialerCall.java b/java/com/android/incallui/call/DialerCall.java index f9afd2d54..76d3e8b53 100644 --- a/java/com/android/incallui/call/DialerCall.java +++ b/java/com/android/incallui/call/DialerCall.java @@ -344,6 +344,7 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa // now update the UI to possibly re-enable the Merge button based on the number of // currently conferenceable calls available or Connection Capabilities. case android.telecom.Connection.EVENT_CALL_MERGE_FAILED: + isMergeInProcess = false; update(); break; case TelephonyManagerCompat.EVENT_HANDOVER_VIDEO_FROM_WIFI_TO_LTE: diff --git a/java/com/android/incallui/callconfiguration/call_configuration.proto b/java/com/android/incallui/callconfiguration/call_configuration.proto index 2cf3c065c..3ff3922a8 100644 --- a/java/com/android/incallui/callconfiguration/call_configuration.proto +++ b/java/com/android/incallui/callconfiguration/call_configuration.proto @@ -16,7 +16,6 @@ syntax = "proto2"; option java_package = "com.android.dialer"; option java_multiple_files = true; -option optimize_for = LITE_RUNTIME; package com.android.dialer; diff --git a/java/com/android/incallui/rtt/protocol/AndroidManifest.xml b/java/com/android/incallui/rtt/protocol/AndroidManifest.xml index c0d39b091..05f475725 100644 --- a/java/com/android/incallui/rtt/protocol/AndroidManifest.xml +++ b/java/com/android/incallui/rtt/protocol/AndroidManifest.xml @@ -18,5 +18,5 @@ package="com.android.incallui.rtt.protocol"> <uses-sdk android:minSdkVersion="24" - android:targetSdkVersion="26"/> + android:targetSdkVersion="30"/> </manifest>
\ No newline at end of file diff --git a/java/com/android/incallui/video/protocol/AndroidManifest.xml b/java/com/android/incallui/video/protocol/AndroidManifest.xml index f58284eb1..8548e9954 100644 --- a/java/com/android/incallui/video/protocol/AndroidManifest.xml +++ b/java/com/android/incallui/video/protocol/AndroidManifest.xml @@ -18,5 +18,5 @@ package="com.android.incallui.video.protocol"> <uses-sdk android:minSdkVersion="24" - android:targetSdkVersion="28"/> + android:targetSdkVersion="30"/> </manifest> diff --git a/java/com/android/voicemail/AndroidManifest.xml b/java/com/android/voicemail/AndroidManifest.xml index d39dfee83..d5c9a2d1d 100644 --- a/java/com/android/voicemail/AndroidManifest.xml +++ b/java/com/android/voicemail/AndroidManifest.xml @@ -18,7 +18,7 @@ <uses-sdk android:minSdkVersion="24" - android:targetSdkVersion="28"/> + android:targetSdkVersion="30"/> <!-- Applications using this module should merge these permissions using android_manifest_merge --> diff --git a/java/com/android/voicemail/impl/fetch/FetchVoicemailReceiver.java b/java/com/android/voicemail/impl/fetch/FetchVoicemailReceiver.java index 9fda37343..7be22e45d 100644 --- a/java/com/android/voicemail/impl/fetch/FetchVoicemailReceiver.java +++ b/java/com/android/voicemail/impl/fetch/FetchVoicemailReceiver.java @@ -202,6 +202,9 @@ public class FetchVoicemailReceiver extends BroadcastReceiver { new Runnable() { @Override public void run() { + if (networkCallback != null) { + networkCallback.waitForIpv4(); + } try { while (retryCount > 0) { VvmLog.i(TAG, "fetching voicemail, retry count=" + retryCount); diff --git a/java/com/android/voicemail/impl/mail/FetchProfile.java b/java/com/android/voicemail/impl/mail/FetchProfile.java index 28a7080e6..5b83fd8fe 100644 --- a/java/com/android/voicemail/impl/mail/FetchProfile.java +++ b/java/com/android/voicemail/impl/mail/FetchProfile.java @@ -56,10 +56,10 @@ public class FetchProfile extends ArrayList<Fetchable> { STRUCTURE, /** - * A sane portion of the entire message, cut off at a provider determined limit. This should - * generally be around 50kB. + * A truncated portion of the entire message, cut off at a provider determined limit. This + * should generally be around 50kB. */ - BODY_SANE, + BODY_TRUNCATED, /** The entire message. */ BODY, diff --git a/java/com/android/voicemail/impl/mail/store/ImapFolder.java b/java/com/android/voicemail/impl/mail/store/ImapFolder.java index 3c76ec33d..cd3803d92 100644 --- a/java/com/android/voicemail/impl/mail/store/ImapFolder.java +++ b/java/com/android/voicemail/impl/mail/store/ImapFolder.java @@ -257,7 +257,7 @@ public class ImapFolder { * ENVELOPE - UID FETCH (INTERNALDATE UID RFC822.SIZE FLAGS BODY.PEEK[ * HEADER.FIELDS (date subject from content-type to cc)]) * STRUCTURE - UID FETCH (BODYSTRUCTURE) - * BODY_SANE - UID FETCH (BODY.PEEK[]<0.N>) where N = max bytes returned + * BODY_TRUNCATED - UID FETCH (BODY.PEEK[]<0.N>) where N = max bytes returned * BODY - UID FETCH (BODY.PEEK[]) * Part - UID FETCH (BODY.PEEK[ID]) where ID = mime part ID */ @@ -277,8 +277,8 @@ public class ImapFolder { fetchFields.add(ImapConstants.BODYSTRUCTURE); } - if (fp.contains(FetchProfile.Item.BODY_SANE)) { - fetchFields.add(ImapConstants.FETCH_FIELD_BODY_PEEK_SANE); + if (fp.contains(FetchProfile.Item.BODY_TRUNCATED)) { + fetchFields.add(ImapConstants.FETCH_FIELD_BODY_PEEK_TRUNCATED); } if (fp.contains(FetchProfile.Item.BODY)) { fetchFields.add(ImapConstants.FETCH_FIELD_BODY_PEEK); @@ -363,7 +363,8 @@ public class ImapFolder { } } } - if (fp.contains(FetchProfile.Item.BODY) || fp.contains(FetchProfile.Item.BODY_SANE)) { + if (fp.contains(FetchProfile.Item.BODY) + || fp.contains(FetchProfile.Item.BODY_TRUNCATED)) { // Body is keyed by "BODY[]...". // Previously used "BODY[..." but this can be confused with "BODY[HEADER..." // TODO Should we accept "RFC822" as well?? diff --git a/java/com/android/voicemail/impl/mail/store/ImapStore.java b/java/com/android/voicemail/impl/mail/store/ImapStore.java index 6b88080fe..44b78be44 100644 --- a/java/com/android/voicemail/impl/mail/store/ImapStore.java +++ b/java/com/android/voicemail/impl/mail/store/ImapStore.java @@ -30,9 +30,9 @@ import org.apache.james.mime4j.MimeException; public class ImapStore { /** * A global suggestion to Store implementors on how much of the body should be returned on - * FetchProfile.Item.BODY_SANE requests. We'll use 125k now. + * FetchProfile.Item.BODY_TRUNCATED requests. We'll use 125k now. */ - public static final int FETCH_BODY_SANE_SUGGESTED_SIZE = (125 * 1024); + public static final int FETCH_BODY_TRUNCATED_SUGGESTED_SIZE = (125 * 1024); private final Context context; private final ImapHelper helper; diff --git a/java/com/android/voicemail/impl/mail/store/imap/ImapConstants.java b/java/com/android/voicemail/impl/mail/store/imap/ImapConstants.java index fd56952d7..2dc2254ae 100644 --- a/java/com/android/voicemail/impl/mail/store/imap/ImapConstants.java +++ b/java/com/android/voicemail/impl/mail/store/imap/ImapConstants.java @@ -24,8 +24,8 @@ public final class ImapConstants { public static final String FETCH_FIELD_BODY_PEEK_BARE = "BODY.PEEK"; public static final String FETCH_FIELD_BODY_PEEK = FETCH_FIELD_BODY_PEEK_BARE + "[]"; - public static final String FETCH_FIELD_BODY_PEEK_SANE = - String.format(Locale.US, "BODY.PEEK[]<0.%d>", ImapStore.FETCH_BODY_SANE_SUGGESTED_SIZE); + public static final String FETCH_FIELD_BODY_PEEK_TRUNCATED = + String.format(Locale.US, "BODY.PEEK[]<0.%d>", ImapStore.FETCH_BODY_TRUNCATED_SUGGESTED_SIZE); public static final String FETCH_FIELD_HEADERS = "BODY.PEEK[HEADER.FIELDS (date subject from content-type to cc message-id content-duration)]"; diff --git a/java/com/android/voicemail/impl/mail/store/imap/ImapTempFileLiteral.java b/java/com/android/voicemail/impl/mail/store/imap/ImapTempFileLiteral.java index 417adcc02..f452c9deb 100644 --- a/java/com/android/voicemail/impl/mail/store/imap/ImapTempFileLiteral.java +++ b/java/com/android/voicemail/impl/mail/store/imap/ImapTempFileLiteral.java @@ -74,7 +74,7 @@ public class ImapTempFileLiteral extends ImapString { // It's probably possible if we're low on storage and the system clears the cache dir. LogUtils.w(TAG, "ImapTempFileLiteral: Temp file not found"); - // Return 0 byte stream as a dummy... + // Return 0 byte stream as a placeholder... return new ByteArrayInputStream(new byte[0]); } } diff --git a/java/com/android/voicemail/impl/sms/LegacyModeSmsHandler.java b/java/com/android/voicemail/impl/sms/LegacyModeSmsHandler.java index 29d376b35..5a16f8671 100644 --- a/java/com/android/voicemail/impl/sms/LegacyModeSmsHandler.java +++ b/java/com/android/voicemail/impl/sms/LegacyModeSmsHandler.java @@ -108,8 +108,8 @@ public class LegacyModeSmsHandler { PreCall.getIntent( context, CallIntentBuilder.forVoicemail( - phoneAccountHandle, CallInitiationType.Type.LEGACY_VOICEMAIL_NOTIFICATION)), - PendingIntent.FLAG_UPDATE_CURRENT); + CallInitiationType.Type.LEGACY_VOICEMAIL_NOTIFICATION)), + PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE); } else { Intent launchVoicemailSettingsIntent = new Intent(TelephonyManager.ACTION_CONFIGURE_VOICEMAIL); @@ -122,7 +122,7 @@ public class LegacyModeSmsHandler { context, LAUNCH_VOICEMAIL_SETTINGS_REQUEST_CODE, launchVoicemailSettingsIntent, - PendingIntent.FLAG_UPDATE_CURRENT); + PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE); } intent.putExtra(TelephonyManager.EXTRA_VOICEMAIL_NUMBER, voicemailNumber); diff --git a/java/com/android/voicemail/impl/sms/StatusSmsFetcher.java b/java/com/android/voicemail/impl/sms/StatusSmsFetcher.java index 7ddf64607..dd945e9a0 100644 --- a/java/com/android/voicemail/impl/sms/StatusSmsFetcher.java +++ b/java/com/android/voicemail/impl/sms/StatusSmsFetcher.java @@ -53,8 +53,12 @@ public class StatusSmsFetcher extends BroadcastReceiver implements Closeable { private static final long STATUS_SMS_TIMEOUT_MILLIS = 60_000; + private static final String PERMISSION_DIALER_ORIGIN = + "com.android.dialer.permission.DIALER_ORIGIN"; + private static final String ACTION_REQUEST_SENT_INTENT = "com.android.voicemailomtp.sms.REQUEST_SENT"; + private static final int ACTION_REQUEST_SENT_REQUEST_CODE = 0; private CompletableFuture<Bundle> future = new CompletableFuture<>(); @@ -67,7 +71,7 @@ public class StatusSmsFetcher extends BroadcastReceiver implements Closeable { this.phoneAccountHandle = phoneAccountHandle; IntentFilter filter = new IntentFilter(ACTION_REQUEST_SENT_INTENT); filter.addAction(OmtpService.ACTION_SMS_RECEIVED); - context.registerReceiver(this, filter); + context.registerReceiver(this, filter, PERMISSION_DIALER_ORIGIN, /* scheduler= */ null); } @Override @@ -89,7 +93,10 @@ public class StatusSmsFetcher extends BroadcastReceiver implements Closeable { // Because the receiver is registered dynamically, implicit intent must be used. // There should only be a single status SMS request at a time. return PendingIntent.getBroadcast( - context, ACTION_REQUEST_SENT_REQUEST_CODE, intent, PendingIntent.FLAG_CANCEL_CURRENT); + context, + ACTION_REQUEST_SENT_REQUEST_CODE, + intent, + PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_IMMUTABLE); } @Override diff --git a/java/com/android/voicemail/impl/sync/VvmNetworkRequest.java b/java/com/android/voicemail/impl/sync/VvmNetworkRequest.java index 86d645215..a7d578d98 100644 --- a/java/com/android/voicemail/impl/sync/VvmNetworkRequest.java +++ b/java/com/android/voicemail/impl/sync/VvmNetworkRequest.java @@ -77,7 +77,11 @@ public class VvmNetworkRequest { new FutureNetworkRequestCallback(config, handle, status); callback.requestNetwork(); try { - return callback.getFuture().get(); + NetworkWrapper ret = callback.getFuture().get(); + if (ret != null) { + callback.waitForIpv4(); + } + return ret; } catch (InterruptedException | ExecutionException e) { callback.releaseNetwork(); VvmLog.e(TAG, "can't get future network", e); diff --git a/java/com/android/voicemail/impl/sync/VvmNetworkRequestCallback.java b/java/com/android/voicemail/impl/sync/VvmNetworkRequestCallback.java index c0ab6788e..5762a09d0 100644 --- a/java/com/android/voicemail/impl/sync/VvmNetworkRequestCallback.java +++ b/java/com/android/voicemail/impl/sync/VvmNetworkRequestCallback.java @@ -18,9 +18,12 @@ package com.android.voicemail.impl.sync; import android.annotation.TargetApi; import android.content.Context; import android.net.ConnectivityManager; +import android.net.InetAddresses; +import android.net.LinkProperties; import android.net.Network; import android.net.NetworkCapabilities; import android.net.NetworkRequest; +import android.os.ConditionVariable; import android.os.Build.VERSION_CODES; import android.os.Handler; import android.os.Looper; @@ -125,6 +128,22 @@ public abstract class VvmNetworkRequestCallback extends ConnectivityManager.Netw resultReceived = true; } + private static final int DEFAULT_IPV4_WAIT_DELAY_MS = 500; // in milliseconds + private final ConditionVariable mWaitV4Cv = new ConditionVariable(); + @Override + @CallSuper + public void onLinkPropertiesChanged(Network network, LinkProperties lp) { + boolean hasIPv4 = (lp != null) && + (lp.isReachable(InetAddresses.parseNumericAddress("8.8.8.8"))); + if(hasIPv4) { + mWaitV4Cv.open(); + } + } + public void waitForIpv4() { + VvmLog.w(TAG, "Waiting for IPV4 address..."); + mWaitV4Cv.block(DEFAULT_IPV4_WAIT_DELAY_MS); + } + @CallSuper public void onUnavailable() { VvmLog.i(TAG, "onUnavailable"); diff --git a/java/com/android/voicemail/impl/transcribe/grpc/voicemail_transcription.proto b/java/com/android/voicemail/impl/transcribe/grpc/voicemail_transcription.proto index 8248b02a7..117efaeb8 100644 --- a/java/com/android/voicemail/impl/transcribe/grpc/voicemail_transcription.proto +++ b/java/com/android/voicemail/impl/transcribe/grpc/voicemail_transcription.proto @@ -5,7 +5,6 @@ syntax = "proto2"; package google.internal.communications.voicemailtranscription.v1; option java_multiple_files = true; -option optimize_for = LITE_RUNTIME; option java_package = "com.google.internal.communications.voicemailtranscription.v1"; |