Snap for 8564071 from 633b5d26f4a9d9c9143ca67f8032e5a487028e91 to mainline-cellbroadcast-release
Change-Id: I3dd69807459fd80e02398ffbb22851b66beef323
diff --git a/Android.mk b/Android.mk
index b7a4a8f..c842c5e 100644
--- a/Android.mk
+++ b/Android.mk
@@ -122,11 +122,11 @@
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 @@
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_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 @@
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 @@
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 @@
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 $(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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 $(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 @@
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 fe8147f..a106e12 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 f574665..28f8eec 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 e972215..84ac96f 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 ca8ed29..a1dc89d 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 @@
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 12cca4f..a3a3b9d 100644
--- a/java/com/android/contacts/common/model/ContactLoader.java
+++ b/java/com/android/contacts/common/model/ContactLoader.java
@@ -39,6 +39,7 @@
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 @@
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 a25544b..e10ade4 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 @@
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 @@
@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 5a44ae7..1880d65 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 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 @@
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 cc40c64..fc443f0 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 @@
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 @@
// 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 190f098..ade5bd4 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 0000000..c783f0b
--- /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 e044460..05011d1 100644
--- a/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java
+++ b/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java
@@ -560,7 +560,7 @@
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 21f3418..423b49c 100644
--- a/java/com/android/dialer/app/calllog/IntentProvider.java
+++ b/java/com/android/dialer/app/calllog/IntentProvider.java
@@ -161,14 +161,13 @@
};
}
- 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 31e9edc..62ae748 100644
--- a/java/com/android/dialer/app/calllog/LegacyVoicemailNotifier.java
+++ b/java/com/android/dialer/app/calllog/LegacyVoicemailNotifier.java
@@ -181,6 +181,7 @@
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 4b5bfba..f2d2af8 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 @@
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 @@
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 @@
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 @@
// 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 f9f8e0e..7f0a6bc 100644
--- a/java/com/android/dialer/app/list/PhoneFavoriteTileView.java
+++ b/java/com/android/dialer/app/list/PhoneFavoriteTileView.java
@@ -57,7 +57,7 @@
// 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 3825c50..6b44f1b 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 b0a1011..fb6e305 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 051556b..8555ff6 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 70872c7..a9a7c2a 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 @@
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 c61f570..e802cc2 100644
--- a/java/com/android/dialer/callcomposer/camera/CameraManager.java
+++ b/java/com/android/dialer/callcomposer/camera/CameraManager.java
@@ -85,7 +85,7 @@
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 @@
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 0f11b53..1ab3af6 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 @@
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 e2532d5..d650a40 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 @@
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 613fdf6..7cc5891 100644
--- a/java/com/android/dialer/callintent/CallIntentBuilder.java
+++ b/java/com/android/dialer/callintent/CallIntentBuilder.java
@@ -117,10 +117,10 @@
}
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 3823e49..0f74f07 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 @@
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 065a7ab..2ec9030 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 @@
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 ecb1c3f..df14f41 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 @@
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 27e11a0..35a798e 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 2d447af..80ba1d5 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 059f957..c34e01b 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 @@
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 2c46d1b..97d69d7 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 @@
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 913f072..cfa42c8 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 @@
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 b3ea860..d0008a3 100644
--- a/java/com/android/dialer/commandline/impl/CallCommand.java
+++ b/java/com/android/dialer/commandline/impl/CallCommand.java
@@ -19,8 +19,6 @@
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 @@
}
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 cf42606..f7f79e1 100644
--- a/java/com/android/dialer/contactphoto/ContactPhotoManagerImpl.java
+++ b/java/com/android/dialer/contactphoto/ContactPhotoManagerImpl.java
@@ -92,7 +92,8 @@
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 9201604..0c14613 100644
--- a/java/com/android/dialer/contacts/hiresphoto/HighResolutionPhotoRequesterImpl.java
+++ b/java/com/android/dialer/contacts/hiresphoto/HighResolutionPhotoRequesterImpl.java
@@ -51,8 +51,8 @@
@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 @@
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 @@
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 3efbaaf..5a7153e 100644
--- a/java/com/android/dialer/database/FilteredNumberContract.java
+++ b/java/com/android/dialer/database/FilteredNumberContract.java
@@ -30,7 +30,7 @@
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 2d1dfbd..fe108a0 100644
--- a/java/com/android/dialer/dialercontact/dialer_contact.proto
+++ b/java/com/android/dialer/dialercontact/dialer_contact.proto
@@ -2,7 +2,6 @@
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 2d0eff5..12c82c9 100644
--- a/java/com/android/dialer/dialpadview/DialpadFragment.java
+++ b/java/com/android/dialer/dialpadview/DialpadFragment.java
@@ -1136,7 +1136,7 @@
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 8efb35c..6aed395 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 @@
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 07908d8..4e18e03 100644
--- a/java/com/android/dialer/glidephotomanager/photo_info.proto
+++ b/java/com/android/dialer/glidephotomanager/photo_info.proto
@@ -2,7 +2,6 @@
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 f7022c2..2e8d2a0 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 @@
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 04d9f22..c36c50f 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 @@
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 4571a69..a4b0978 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 6dda2a6..4372158 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 @@
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 fbff642..0c01996 100644
--- a/java/com/android/dialer/logging/contact_source.proto
+++ b/java/com/android/dialer/logging/contact_source.proto
@@ -3,7 +3,6 @@
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 f3173f8..0f362d9 100644
--- a/java/com/android/dialer/logging/dialer_impression.proto
+++ b/java/com/android/dialer/logging/dialer_impression.proto
@@ -3,7 +3,6 @@
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 47ea534..d7a09bd 100644
--- a/java/com/android/dialer/logging/interaction_event.proto
+++ b/java/com/android/dialer/logging/interaction_event.proto
@@ -3,7 +3,6 @@
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 e37d10a..4506416 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 @@
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 1d6ba47..d2fd6dd 100644
--- a/java/com/android/dialer/logging/reporting_location.proto
+++ b/java/com/android/dialer/logging/reporting_location.proto
@@ -3,7 +3,6 @@
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 f4d0735..8081f6e 100644
--- a/java/com/android/dialer/logging/screen_event.proto
+++ b/java/com/android/dialer/logging/screen_event.proto
@@ -3,7 +3,6 @@
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 886fe04..d14bfbb 100644
--- a/java/com/android/dialer/logging/ui_action.proto
+++ b/java/com/android/dialer/logging/ui_action.proto
@@ -3,7 +3,6 @@
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 b5cd351..1f274be 100644
--- a/java/com/android/dialer/logging/video_tech.proto
+++ b/java/com/android/dialer/logging/video_tech.proto
@@ -3,7 +3,6 @@
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 e5b72f2..a7b3aeb 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 f5ab5f0..c0fa31d 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 @@
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 @@
}
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 ad8a8f9..143e2c8 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 @@
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 df7716c..9e30394 100644
--- a/java/com/android/dialer/phonenumberutil/PhoneNumberHelper.java
+++ b/java/com/android/dialer/phonenumberutil/PhoneNumberHelper.java
@@ -202,6 +202,9 @@
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 ca7fb71..82101a0 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 542b8d0..376cb45 100644
--- a/java/com/android/dialer/postcall/PostCall.java
+++ b/java/com/android/dialer/postcall/PostCall.java
@@ -72,13 +72,14 @@
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 @@
? 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 c938b9a..55a1657 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 a580b0d..c674ba6 100644
--- a/java/com/android/dialer/rtt/rtt_transcript.proto
+++ b/java/com/android/dialer/rtt/rtt_transcript.proto
@@ -2,7 +2,6 @@
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 c0f07bf..e54b659 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 96ea627..dcf8032 100644
--- a/java/com/android/dialer/simulator/impl/SimulatorDialogFragment.java
+++ b/java/com/android/dialer/simulator/impl/SimulatorDialogFragment.java
@@ -27,7 +27,7 @@
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 @@
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 0b05144..e768dac 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 211af86..caba77f 100644
--- a/java/com/android/dialer/speeddial/database/SpeedDialEntryDatabaseHelper.java
+++ b/java/com/android/dialer/speeddial/database/SpeedDialEntryDatabaseHelper.java
@@ -125,7 +125,7 @@
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 c088146..633a53e 100644
--- a/java/com/android/dialer/telecom/TelecomUtil.java
+++ b/java/com/android/dialer/telecom/TelecomUtil.java
@@ -25,6 +25,7 @@
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 @@
@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 @@
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 29b6989..850b938 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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 14d6cff..e22f306 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 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 @@
@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 @@
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 17173d8..863c586 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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 c9ca352..c954f96 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 @@
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 8506ddd..f25858e 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 4e22fb3..ebebdf7 100644
--- a/java/com/android/dialer/voicemail/settings/VoicemailChangePinActivity.java
+++ b/java/com/android/dialer/voicemail/settings/VoicemailChangePinActivity.java
@@ -67,7 +67,6 @@
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 4cb6001..7283702 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 2a9600a..f2f7a40 100644
--- a/java/com/android/incallui/CallButtonPresenter.java
+++ b/java/com/android/incallui/CallButtonPresenter.java
@@ -208,18 +208,22 @@
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 a2a0de0..330630a 100644
--- a/java/com/android/incallui/DtmfKeyListener.java
+++ b/java/com/android/incallui/DtmfKeyListener.java
@@ -55,8 +55,8 @@
* 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 99ff725..3942851 100644
--- a/java/com/android/incallui/StatusBarNotifier.java
+++ b/java/com/android/incallui/StatusBarNotifier.java
@@ -18,6 +18,9 @@
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 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 @@
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 @@
}
}
- 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;
+ }
- 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 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);
}
+ }
- return context.getString(resId);
+ 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);
+ }
+ }
+
+ 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 dfbba1c..f0d0fef 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 baec308..b30afa0 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 @@
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 6bdd239..47b021e 100644
--- a/java/com/android/incallui/audiomode/AudioModeProvider.java
+++ b/java/com/android/incallui/audiomode/AudioModeProvider.java
@@ -85,6 +85,7 @@
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 f6eb34b..f66ee57 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 f9afd2d..76d3e8b 100644
--- a/java/com/android/incallui/call/DialerCall.java
+++ b/java/com/android/incallui/call/DialerCall.java
@@ -344,6 +344,7 @@
// 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 2cf3c06..3ff3922 100644
--- a/java/com/android/incallui/callconfiguration/call_configuration.proto
+++ b/java/com/android/incallui/callconfiguration/call_configuration.proto
@@ -16,7 +16,6 @@
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 c0d39b0..05f4757 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 f58284e..8548e99 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 d39dfee..d5c9a2d 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 9fda373..7be22e4 100644
--- a/java/com/android/voicemail/impl/fetch/FetchVoicemailReceiver.java
+++ b/java/com/android/voicemail/impl/fetch/FetchVoicemailReceiver.java
@@ -202,6 +202,9 @@
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 28a7080..5b83fd8 100644
--- a/java/com/android/voicemail/impl/mail/FetchProfile.java
+++ b/java/com/android/voicemail/impl/mail/FetchProfile.java
@@ -56,10 +56,10 @@
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 3c76ec3..cd3803d 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 @@
* 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 @@
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 @@
}
}
}
- 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 6b88080..44b78be 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 @@
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 fd56952..2dc2254 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 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 417adcc..f452c9d 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 @@
// 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 29d376b..5a16f86 100644
--- a/java/com/android/voicemail/impl/sms/LegacyModeSmsHandler.java
+++ b/java/com/android/voicemail/impl/sms/LegacyModeSmsHandler.java
@@ -108,8 +108,8 @@
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 @@
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 7ddf646..dd945e9 100644
--- a/java/com/android/voicemail/impl/sms/StatusSmsFetcher.java
+++ b/java/com/android/voicemail/impl/sms/StatusSmsFetcher.java
@@ -53,8 +53,12 @@
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 @@
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 @@
// 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 86d6452..a7d578d 100644
--- a/java/com/android/voicemail/impl/sync/VvmNetworkRequest.java
+++ b/java/com/android/voicemail/impl/sync/VvmNetworkRequest.java
@@ -77,7 +77,11 @@
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 c0ab678..5762a09 100644
--- a/java/com/android/voicemail/impl/sync/VvmNetworkRequestCallback.java
+++ b/java/com/android/voicemail/impl/sync/VvmNetworkRequestCallback.java
@@ -18,9 +18,12 @@
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 @@
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 8248b02..117efae 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 @@
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";