aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-02-01 11:36:35 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2023-02-01 11:36:35 +0000
commit26c18610c337e9e08ab7ce8be074ab83b033f236 (patch)
tree413cfb5b7c4e97ef32a8f2a9716824ad5d9ba7a8
parentb2b02fdbdf3436b36706747ef00221f430af241d (diff)
parent2a2e865a52e0da07fae175c8b9a407dfc122451a (diff)
downloadDialer-26c18610c337e9e08ab7ce8be074ab83b033f236.tar.gz
Merge "Snap for 9550355 from 5aba2712c8c0007738549b0f1815484236f43c46 to sdk-release" into sdk-releaseplatform-tools-34.0.1platform-tools-34.0.0platform-tools-33.0.4
-rw-r--r--Android.mk370
-rw-r--r--AndroidManifest.xml3
-rw-r--r--java/com/android/contacts/common/model/ContactLoader.java5
-rw-r--r--java/com/android/contacts/common/model/account/GoogleAccountType.java23
-rw-r--r--java/com/android/contacts/common/model/dataitem/ImDataItem.java4
-rw-r--r--java/com/android/dialer/app/DevicePolicyResources.java54
-rw-r--r--java/com/android/dialer/app/calllog/LegacyVoicemailNotifier.java5
-rw-r--r--java/com/android/dialer/app/calllog/MissedCallNotifier.java22
-rw-r--r--java/com/android/dialer/callintent/CallIntent.java3
-rw-r--r--java/com/android/dialer/callintent/CallIntentBuilder.java3
-rw-r--r--java/com/android/dialer/commandline/impl/CallCommand.java4
-rw-r--r--java/com/android/dialer/contacts/hiresphoto/HighResolutionPhotoRequesterImpl.java9
-rw-r--r--java/com/android/dialer/notification/VoicemailChannelUtils.java36
-rw-r--r--java/com/android/incallui/StatusBarNotifier.java75
-rw-r--r--java/com/android/voicemail/impl/sms/StatusSmsFetcher.java2
15 files changed, 173 insertions, 445 deletions
diff --git a/Android.mk b/Android.mk
index c842c5e69..99e2272b1 100644
--- a/Android.mk
+++ b/Android.mk
@@ -77,6 +77,7 @@ LOCAL_FULL_LIBS_MANIFEST_FILES := \
LOCAL_SRC_FILES := $(call all-java-files-under, $(BASE_DIR))
LOCAL_SRC_FILES += $(call all-proto-files-under, $(BASE_DIR))
LOCAL_SRC_FILES += $(call all-Iaidl-files-under, $(BASE_DIR))
+LOCAL_AIDL_INCLUDES := $(LOCAL_PATH)/java/
LOCAL_SRC_FILES := $(filter-out $(EXCLUDE_FILES),$(LOCAL_SRC_FILES))
LOCAL_PROTOC_FLAGS := --proto_path=$(LOCAL_PATH)
@@ -102,35 +103,14 @@ LOCAL_STATIC_JAVA_LIBRARIES := \
android-common \
android-support-dynamic-animation \
com.android.vcard \
- dialer-animal-sniffer-annotations-target \
- dialer-commons-io-target \
- dialer-dagger2-target \
- dialer-disklrucache-target \
- dialer-gifdecoder-target \
- dialer-glide-target \
- dialer-grpc-all-target \
- dialer-grpc-context-target \
- dialer-grpc-core-target \
- dialer-grpc-okhttp-target \
- dialer-grpc-protobuf-lite-target \
- dialer-grpc-stub-target \
- dialer-j2objc-annotations-target \
- dialer-javax-annotation-api-target \
- dialer-javax-inject-target \
- dialer-libshortcutbadger-target \
- dialer-mime4j-core-target \
- dialer-mime4j-dom-target \
- dialer-okhttp-target \
- dialer-okio-target \
- dialer-guava-target \
- dialer-glide-target \
- dialer-glide-annotation-target \
- dialer-zxing-target \
+ dialer-common-m2-target-deps \
+ dialer-glide-target-deps \
error_prone_annotations \
jsr305 \
libbackup \
libphonenumber \
volley \
+ zxing-core-1.7 \
LOCAL_STATIC_ANDROID_LIBRARIES := \
android-support-core-ui \
@@ -148,15 +128,10 @@ LOCAL_JAVA_LIBRARIES := \
LOCAL_ANNOTATION_PROCESSORS := \
auto_value_plugin \
- javapoet-prebuilt-jar \
- dialer-dagger2 \
- dialer-dagger2-compiler \
- dialer-dagger2-producers \
- dialer-glide-annotation \
- dialer-glide-compiler \
- dialer-guava \
- dialer-javax-annotation-api \
- dialer-javax-inject \
+ javapoet \
+ dialer-common-m2-host-deps \
+ dialer-dagger2-compiler-deps \
+ dialer-glide-host-deps \
dialer-rootcomponentprocessor
LOCAL_ANNOTATION_PROCESSOR_CLASSES := \
@@ -191,328 +166,6 @@ DIALER_MANIFEST_FILES :=
EXCLUDE_MANIFESTS :=
EXCLUDE_EXTRA_PACKAGES :=
-# Create references to prebuilt libraries.
-include $(CLEAR_VARS)
-
-LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := \
- 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 \
- dialer-glide-annotation:../../../prebuilts/maven_repo/bumptech/com/github/bumptech/glide/annotation/SNAPSHOT/annotation-SNAPSHOT.jar \
- dialer-glide-compiler:../../../prebuilts/maven_repo/bumptech/com/github/bumptech/glide/compiler/SNAPSHOT/compiler-SNAPSHOT.jar \
- dialer-grpc-all:../../../prebuilts/tools/common/m2/repository/io/grpc/grpc-all/1.0.3/grpc-all-1.0.3.jar \
- dialer-grpc-core:../../../prebuilts/tools/common/m2/repository/io/grpc/grpc-core/1.0.3/grpc-core-1.0.3.jar \
- dialer-grpc-okhttp:../../../prebuilts/tools/common/m2/repository/io/grpc/grpc-okhttp/1.0.3/grpc-okhttp-1.0.3.jar \
- dialer-grpc-protobuf-lite:../../../prebuilts/tools/common/m2/repository/io/grpc/grpc-protobuf-lite/1.0.3/grpc-protobuf-lite-1.0.3.jar \
- dialer-grpc-stub:../../../prebuilts/tools/common/m2/repository/io/grpc/grpc-stub/1.0.3/grpc-stub-1.0.3.jar \
- 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 \
-
-include $(BUILD_HOST_PREBUILT)
-
-# Enumerate target prebuilts to avoid linker warnings like
-# Dialer (java:sdk) should not link to dialer-guava (java:platform)
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_CLASS := JAVA_LIBRARIES
-LOCAL_MODULE := dialer-guava-target
-LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
-LOCAL_LICENSE_CONDITIONS := notice
-LOCAL_NOTICE_FILE := $(LOCAL_PATH)/LICENSE
-LOCAL_SDK_VERSION := current
-LOCAL_SRC_FILES := ../../../prebuilts/tools/common/m2/repository/com/google/guava/guava/23.0/guava-23.0.jar
-LOCAL_UNINSTALLABLE_MODULE := true
-
-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
-
-include $(BUILD_PREBUILT)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_CLASS := JAVA_LIBRARIES
-LOCAL_MODULE := dialer-disklrucache-target
-LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
-LOCAL_LICENSE_CONDITIONS := notice
-LOCAL_NOTICE_FILE := $(LOCAL_PATH)/LICENSE
-LOCAL_SDK_VERSION := current
-LOCAL_SRC_FILES := ../../../prebuilts/maven_repo/bumptech/com/github/bumptech/glide/disklrucache/SNAPSHOT/disklrucache-SNAPSHOT.jar
-LOCAL_UNINSTALLABLE_MODULE := true
-
-include $(BUILD_PREBUILT)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_CLASS := JAVA_LIBRARIES
-LOCAL_MODULE := dialer-gifdecoder-target
-LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
-LOCAL_LICENSE_CONDITIONS := notice
-LOCAL_NOTICE_FILE := $(LOCAL_PATH)/LICENSE
-LOCAL_SDK_VERSION := current
-LOCAL_SRC_FILES := ../../../prebuilts/maven_repo/bumptech/com/github/bumptech/glide/gifdecoder/SNAPSHOT/gifdecoder-SNAPSHOT.jar
-LOCAL_UNINSTALLABLE_MODULE := true
-
-include $(BUILD_PREBUILT)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_CLASS := JAVA_LIBRARIES
-LOCAL_MODULE := dialer-glide-target
-LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
-LOCAL_LICENSE_CONDITIONS := notice
-LOCAL_NOTICE_FILE := $(LOCAL_PATH)/LICENSE
-LOCAL_SDK_VERSION := current
-LOCAL_SRC_FILES := ../../../prebuilts/maven_repo/bumptech/com/github/bumptech/glide/glide/SNAPSHOT/glide-SNAPSHOT.jar
-LOCAL_UNINSTALLABLE_MODULE := true
-
-include $(BUILD_PREBUILT)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_CLASS := JAVA_LIBRARIES
-LOCAL_MODULE := dialer-glide-annotation-target
-LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
-LOCAL_LICENSE_CONDITIONS := notice
-LOCAL_NOTICE_FILE := $(LOCAL_PATH)/LICENSE
-LOCAL_SDK_VERSION := current
-LOCAL_SRC_FILES := ../../../prebuilts/maven_repo/bumptech/com/github/bumptech/glide/annotation/SNAPSHOT/annotation-SNAPSHOT.jar
-LOCAL_UNINSTALLABLE_MODULE := true
-
-include $(BUILD_PREBUILT)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_CLASS := JAVA_LIBRARIES
-LOCAL_MODULE := dialer-javax-annotation-api-target
-LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
-LOCAL_LICENSE_CONDITIONS := notice
-LOCAL_NOTICE_FILE := $(LOCAL_PATH)/LICENSE
-LOCAL_SDK_VERSION := current
-LOCAL_SRC_FILES := ../../../prebuilts/tools/common/m2/repository/javax/annotation/javax.annotation-api/1.2/javax.annotation-api-1.2.jar
-LOCAL_UNINSTALLABLE_MODULE := true
-
-include $(BUILD_PREBUILT)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_CLASS := JAVA_LIBRARIES
-LOCAL_MODULE := dialer-libshortcutbadger-target
-LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
-LOCAL_LICENSE_CONDITIONS := notice
-LOCAL_NOTICE_FILE := $(LOCAL_PATH)/LICENSE
-LOCAL_SDK_VERSION := current
-LOCAL_SRC_FILES := ../../../prebuilts/tools/common/m2/repository/me/leolin/ShortcutBadger/1.1.13/ShortcutBadger-1.1.13.jar
-LOCAL_UNINSTALLABLE_MODULE := true
-
-include $(BUILD_PREBUILT)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_CLASS := JAVA_LIBRARIES
-LOCAL_MODULE := dialer-javax-inject-target
-LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
-LOCAL_LICENSE_CONDITIONS := notice
-LOCAL_NOTICE_FILE := $(LOCAL_PATH)/LICENSE
-LOCAL_SDK_VERSION := current
-LOCAL_SRC_FILES := ../../../prebuilts/tools/common/m2/repository/javax/inject/javax.inject/1/javax.inject-1.jar
-LOCAL_UNINSTALLABLE_MODULE := true
-
-include $(BUILD_PREBUILT)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_CLASS := JAVA_LIBRARIES
-LOCAL_MODULE := dialer-commons-io-target
-LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
-LOCAL_LICENSE_CONDITIONS := notice
-LOCAL_NOTICE_FILE := $(LOCAL_PATH)/LICENSE
-LOCAL_SDK_VERSION := current
-LOCAL_SRC_FILES := ../../../prebuilts/tools/common/m2/repository/commons-io/commons-io/2.4/commons-io-2.4.jar
-LOCAL_UNINSTALLABLE_MODULE := true
-
-include $(BUILD_PREBUILT)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_CLASS := JAVA_LIBRARIES
-LOCAL_MODULE := dialer-mime4j-core-target
-LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
-LOCAL_LICENSE_CONDITIONS := notice
-LOCAL_NOTICE_FILE := $(LOCAL_PATH)/LICENSE
-LOCAL_SDK_VERSION := current
-LOCAL_SRC_FILES := ../../../prebuilts/tools/common/m2/repository/org/apache/james/apache-mime4j-core/0.7.2/apache-mime4j-core-0.7.2.jar
-LOCAL_UNINSTALLABLE_MODULE := true
-
-include $(BUILD_PREBUILT)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_CLASS := JAVA_LIBRARIES
-LOCAL_MODULE := dialer-mime4j-dom-target
-LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
-LOCAL_LICENSE_CONDITIONS := notice
-LOCAL_NOTICE_FILE := $(LOCAL_PATH)/LICENSE
-LOCAL_SDK_VERSION := current
-LOCAL_SRC_FILES := ../../../prebuilts/tools/common/m2/repository/org/apache/james/apache-mime4j-dom/0.7.2/apache-mime4j-dom-0.7.2.jar
-LOCAL_UNINSTALLABLE_MODULE := true
-
-include $(BUILD_PREBUILT)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_CLASS := JAVA_LIBRARIES
-LOCAL_MODULE := dialer-grpc-core-target
-LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
-LOCAL_LICENSE_CONDITIONS := notice
-LOCAL_NOTICE_FILE := $(LOCAL_PATH)/LICENSE
-LOCAL_SDK_VERSION := current
-LOCAL_SRC_FILES := ../../../prebuilts/tools/common/m2/repository/io/grpc/grpc-core/1.0.3/grpc-core-1.0.3.jar
-LOCAL_UNINSTALLABLE_MODULE := true
-
-include $(BUILD_PREBUILT)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_CLASS := JAVA_LIBRARIES
-LOCAL_MODULE := dialer-grpc-okhttp-target
-LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
-LOCAL_LICENSE_CONDITIONS := notice
-LOCAL_NOTICE_FILE := $(LOCAL_PATH)/LICENSE
-LOCAL_SDK_VERSION := current
-LOCAL_SRC_FILES := ../../../prebuilts/tools/common/m2/repository/io/grpc/grpc-okhttp/1.0.3/grpc-okhttp-1.0.3.jar
-LOCAL_UNINSTALLABLE_MODULE := true
-
-include $(BUILD_PREBUILT)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_CLASS := JAVA_LIBRARIES
-LOCAL_MODULE := dialer-grpc-protobuf-lite-target
-LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
-LOCAL_LICENSE_CONDITIONS := notice
-LOCAL_NOTICE_FILE := $(LOCAL_PATH)/LICENSE
-LOCAL_SDK_VERSION := current
-LOCAL_SRC_FILES := ../../../prebuilts/tools/common/m2/repository/io/grpc/grpc-protobuf-lite/1.0.3/grpc-protobuf-lite-1.0.3.jar
-LOCAL_UNINSTALLABLE_MODULE := true
-
-include $(BUILD_PREBUILT)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_CLASS := JAVA_LIBRARIES
-LOCAL_MODULE := dialer-grpc-stub-target
-LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
-LOCAL_LICENSE_CONDITIONS := notice
-LOCAL_NOTICE_FILE := $(LOCAL_PATH)/LICENSE
-LOCAL_SDK_VERSION := current
-LOCAL_SRC_FILES := ../../../prebuilts/tools/common/m2/repository/io/grpc/grpc-stub/1.0.3/grpc-stub-1.0.3.jar
-LOCAL_UNINSTALLABLE_MODULE := true
-
-include $(BUILD_PREBUILT)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_CLASS := JAVA_LIBRARIES
-LOCAL_MODULE := dialer-grpc-all-target
-LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
-LOCAL_LICENSE_CONDITIONS := notice
-LOCAL_NOTICE_FILE := $(LOCAL_PATH)/LICENSE
-LOCAL_SDK_VERSION := current
-LOCAL_SRC_FILES := ../../../prebuilts/tools/common/m2/repository/io/grpc/grpc-all/1.0.3/grpc-all-1.0.3.jar
-LOCAL_UNINSTALLABLE_MODULE := true
-
-include $(BUILD_PREBUILT)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_CLASS := JAVA_LIBRARIES
-LOCAL_MODULE := dialer-grpc-context-target
-LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
-LOCAL_LICENSE_CONDITIONS := notice
-LOCAL_NOTICE_FILE := $(LOCAL_PATH)/LICENSE
-LOCAL_SDK_VERSION := current
-LOCAL_SRC_FILES := ../../../prebuilts/tools/common/m2/repository/io/grpc/grpc-context/1.0.3/grpc-context-1.0.3.jar
-LOCAL_UNINSTALLABLE_MODULE := true
-
-include $(BUILD_PREBUILT)
-
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_CLASS := JAVA_LIBRARIES
-LOCAL_MODULE := dialer-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
-
-include $(BUILD_PREBUILT)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_CLASS := JAVA_LIBRARIES
-LOCAL_MODULE := dialer-okhttp-target
-LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
-LOCAL_LICENSE_CONDITIONS := notice
-LOCAL_NOTICE_FILE := $(LOCAL_PATH)/LICENSE
-LOCAL_SDK_VERSION := current
-LOCAL_SRC_FILES := ../../../prebuilts/tools/common/m2/repository/com/squareup/okhttp/okhttp/2.7.4/okhttp-2.7.4.jar
-LOCAL_UNINSTALLABLE_MODULE := true
-
-include $(BUILD_PREBUILT)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_CLASS := JAVA_LIBRARIES
-LOCAL_MODULE := dialer-okio-target
-LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
-LOCAL_LICENSE_CONDITIONS := notice
-LOCAL_NOTICE_FILE := $(LOCAL_PATH)/LICENSE
-LOCAL_SDK_VERSION := current
-LOCAL_SRC_FILES := ../../../prebuilts/tools/common/m2/repository/com/squareup/okio/okio/1.9.0/okio-1.9.0.jar
-LOCAL_UNINSTALLABLE_MODULE := true
-
-include $(BUILD_PREBUILT)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_CLASS := JAVA_LIBRARIES
-LOCAL_MODULE := dialer-j2objc-annotations-target
-LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
-LOCAL_LICENSE_CONDITIONS := notice
-LOCAL_NOTICE_FILE := $(LOCAL_PATH)/LICENSE
-LOCAL_SDK_VERSION := current
-LOCAL_SRC_FILES := ../../../prebuilts/tools/common/m2/repository/com/google/j2objc/j2objc-annotations/1.1/j2objc-annotations-1.1.jar
-LOCAL_UNINSTALLABLE_MODULE := true
-
-include $(BUILD_PREBUILT)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_CLASS := JAVA_LIBRARIES
-LOCAL_MODULE := dialer-animal-sniffer-annotations-target
-LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
-LOCAL_LICENSE_CONDITIONS := notice
-LOCAL_NOTICE_FILE := $(LOCAL_PATH)/LICENSE
-LOCAL_SDK_VERSION := current
-LOCAL_SRC_FILES := ../../../prebuilts/tools/common/m2/repository/org/codehaus/mojo/animal-sniffer-annotations/1.14/animal-sniffer-annotations-1.14.jar
-LOCAL_UNINSTALLABLE_MODULE := true
-
-include $(BUILD_PREBUILT)
-
include $(CLEAR_VARS)
LOCAL_MODULE := dialer-rootcomponentprocessor
@@ -533,13 +186,10 @@ LOCAL_SRC_FILES := \
$(BASE_DIR)/dialer/inject/RootComponentGeneratorMetadata.java
LOCAL_STATIC_JAVA_LIBRARIES := \
- dialer-guava \
- dialer-dagger2 \
- javapoet-prebuilt-jar \
+ dialer-common-m2-host-deps \
+ javapoet \
auto_service_annotations \
auto_common \
- dialer-javax-annotation-api \
- dialer-javax-inject \
error_prone_annotations
LOCAL_JAVA_LANGUAGE_VERSION := 1.8
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index f48c425ca..a106e12c9 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -23,6 +23,8 @@
android:minSdkVersion="24"
android:targetSdkVersion="30"/>
+
+ <uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
<uses-permission android:name="android.permission.CALL_PHONE"/>
<uses-permission android:name="android.permission.READ_CONTACTS"/>
<uses-permission android:name="android.permission.WRITE_CONTACTS"/>
@@ -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
diff --git a/java/com/android/contacts/common/model/ContactLoader.java b/java/com/android/contacts/common/model/ContactLoader.java
index 12cca4f13..a3a3b9d7f 100644
--- a/java/com/android/contacts/common/model/ContactLoader.java
+++ b/java/com/android/contacts/common/model/ContactLoader.java
@@ -39,6 +39,7 @@ import android.text.TextUtils;
import com.android.contacts.common.GroupMetaData;
import com.android.contacts.common.model.account.AccountType;
import com.android.contacts.common.model.account.AccountTypeWithDataSet;
+import com.android.contacts.common.model.account.GoogleAccountType;
import com.android.contacts.common.model.dataitem.DataItem;
import com.android.contacts.common.model.dataitem.PhoneDataItem;
import com.android.contacts.common.model.dataitem.PhotoDataItem;
@@ -727,6 +728,10 @@ public class ContactLoader extends AsyncTaskLoader<Contact> {
final String servicePackageName = accountType.getViewContactNotifyServicePackageName();
if (!TextUtils.isEmpty(serviceName) && !TextUtils.isEmpty(servicePackageName)) {
final Uri uri = ContentUris.withAppendedId(RawContacts.CONTENT_URI, rawContactId);
+ if (accountType instanceof GoogleAccountType) {
+ ((GoogleAccountType) accountType).handleRawContactViewed(context, uri);
+ continue;
+ }
final Intent intent = new Intent();
intent.setClassName(servicePackageName, serviceName);
intent.setAction(Intent.ACTION_VIEW);
diff --git a/java/com/android/contacts/common/model/account/GoogleAccountType.java b/java/com/android/contacts/common/model/account/GoogleAccountType.java
index a25544bb9..e10ade479 100644
--- a/java/com/android/contacts/common/model/account/GoogleAccountType.java
+++ b/java/com/android/contacts/common/model/account/GoogleAccountType.java
@@ -18,6 +18,8 @@ package com.android.contacts.common.model.account;
import android.content.ContentValues;
import android.content.Context;
+import android.content.Intent;
+import android.net.Uri;
import android.provider.ContactsContract.CommonDataKinds.Email;
import android.provider.ContactsContract.CommonDataKinds.Event;
import android.provider.ContactsContract.CommonDataKinds.Phone;
@@ -196,11 +198,28 @@ public class GoogleAccountType extends BaseAccountType {
@Override
public String getViewContactNotifyServiceClassName() {
- return "com.google.android.syncadapters.contacts." + "SyncHighResPhotoIntentService";
+ return PLUS_EXTENSION_PACKAGE_NAME + ".people.sync.focus.SyncHighResPhotoIntentOperation";
}
@Override
public String getViewContactNotifyServicePackageName() {
- return "com.google.android.syncadapters.contacts";
+ return PLUS_EXTENSION_PACKAGE_NAME;
+ }
+
+ /**
+ * Sends a broadcast to the sync adapter to trigger a high res photo sync for the contact which
+ * was viewed
+ * @param context context to send broadcast in
+ * @param rawContactUri Uri of the raw contact viewed
+ */
+ public void handleRawContactViewed(Context context, Uri rawContactUri) {
+ final Intent intent = new Intent();
+ intent.setData(rawContactUri);
+ // New broadcast for syncing high res photo.
+ intent.setPackage(GoogleAccountType.PLUS_EXTENSION_PACKAGE_NAME);
+ intent.setAction(
+ "com.google.android.gms.people.sync.focus.SYNC_HIGH_RES_PHOTO");
+
+ context.sendBroadcast(intent);
}
}
diff --git a/java/com/android/contacts/common/model/dataitem/ImDataItem.java b/java/com/android/contacts/common/model/dataitem/ImDataItem.java
index 16b9fd094..b9902551b 100644
--- a/java/com/android/contacts/common/model/dataitem/ImDataItem.java
+++ b/java/com/android/contacts/common/model/dataitem/ImDataItem.java
@@ -22,6 +22,8 @@ import android.provider.ContactsContract.CommonDataKinds.Email;
import android.provider.ContactsContract.CommonDataKinds.Im;
import android.text.TextUtils;
+import java.util.Objects;
+
/**
* Represents an IM data item, wrapping the columns in {@link ContactsContract.CommonDataKinds.Im}.
*/
@@ -97,7 +99,7 @@ public class ImDataItem extends DataItem {
return that.getProtocol() == Im.PROTOCOL_CUSTOM;
}
return true;
- } else if (getProtocol() != that.getProtocol()) {
+ } else if (!Objects.equals(getProtocol(), that.getProtocol())) {
return false;
} else if (getProtocol() == Im.PROTOCOL_CUSTOM
&& !TextUtils.equals(getCustomProtocol(), that.getCustomProtocol())) {
diff --git a/java/com/android/dialer/app/DevicePolicyResources.java b/java/com/android/dialer/app/DevicePolicyResources.java
new file mode 100644
index 000000000..c783f0bb3
--- /dev/null
+++ b/java/com/android/dialer/app/DevicePolicyResources.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.dialer.app;
+
+import android.app.admin.DevicePolicyManager;
+
+/**
+ * Class containing the required identifiers to update device management resources.
+ *
+ * <p>See {@link DevicePolicyManager#getDrawable} and {@link DevicePolicyManager#getString}.
+ */
+public class DevicePolicyResources {
+
+ private static final String PREFIX = "Dialer.";
+
+ /**
+ * The title of the in-call notification for an incoming work call.
+ */
+ public static final String NOTIFICATION_INCOMING_WORK_CALL_TITLE =
+ PREFIX + "NOTIFICATION_INCOMING_WORK_CALL_TITLE";
+
+ /**
+ * The title of the in-call notification for an ongoing work call.
+ */
+ public static final String NOTIFICATION_ONGOING_WORK_CALL_TITLE =
+ PREFIX + "NOTIFICATION_ONGOING_WORK_CALL_TITLE";
+
+ /**
+ * Missed call notification label, used when there's exactly one missed call from work
+ * contact.
+ */
+ public static final String NOTIFICATION_MISSED_WORK_CALL_TITLE =
+ PREFIX + "NOTIFICATION_MISSED_WORK_CALL_TITLE";
+
+ /**
+ * Label for notification indicating that call is being made over wifi.
+ */
+ public static final String NOTIFICATION_WIFI_WORK_CALL_LABEL =
+ PREFIX + "NOTIFICATION_WIFI_WORK_CALL_LABEL";
+}
diff --git a/java/com/android/dialer/app/calllog/LegacyVoicemailNotifier.java b/java/com/android/dialer/app/calllog/LegacyVoicemailNotifier.java
index 1388f43a5..62ae748de 100644
--- a/java/com/android/dialer/app/calllog/LegacyVoicemailNotifier.java
+++ b/java/com/android/dialer/app/calllog/LegacyVoicemailNotifier.java
@@ -36,7 +36,6 @@ import com.android.dialer.common.LogUtil;
import com.android.dialer.location.GeoUtil;
import com.android.dialer.notification.DialerNotificationManager;
import com.android.dialer.notification.NotificationChannelManager;
-import com.android.dialer.notification.VoicemailChannelUtils;
import com.android.dialer.phonenumberutil.PhoneNumberHelper;
import com.android.dialer.telecom.TelecomUtil;
import com.android.dialer.theme.base.ThemeComponent;
@@ -182,8 +181,8 @@ public final class LegacyVoicemailNotifier {
if (context.getSystemService(TelephonyManager.class).getPhoneCount() <= 1) {
return NOTIFICATION_TAG;
}
- return NOTIFICATION_TAG_PREFIX
- + VoicemailChannelUtils.getHashedPhoneAccountId(phoneAccountHandle);
+
+ return NOTIFICATION_TAG_PREFIX + phoneAccountHandle.getId();
}
private LegacyVoicemailNotifier() {}
diff --git a/java/com/android/dialer/app/calllog/MissedCallNotifier.java b/java/com/android/dialer/app/calllog/MissedCallNotifier.java
index 4b5bfba8a..f2d2af834 100644
--- a/java/com/android/dialer/app/calllog/MissedCallNotifier.java
+++ b/java/com/android/dialer/app/calllog/MissedCallNotifier.java
@@ -15,9 +15,12 @@
*/
package com.android.dialer.app.calllog;
+import static com.android.dialer.app.DevicePolicyResources.NOTIFICATION_MISSED_WORK_CALL_TITLE;
+
import android.app.Notification;
import android.app.Notification.Builder;
import android.app.PendingIntent;
+import android.app.admin.DevicePolicyManager;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
@@ -107,7 +110,7 @@ public class MissedCallNotifier implements Worker<Pair<Integer, String>, Void> {
void updateMissedCallNotification(int count, @Nullable String number) {
LogUtil.enterBlock("MissedCallNotifier.updateMissedCallNotification");
- final int titleResId;
+ final String titleText;
CharSequence expandedText; // The text in the notification's line 1 and 2.
List<NewCall> newCalls = callLogNotificationsQueryHelper.getNewMissedCalls();
@@ -168,10 +171,13 @@ public class MissedCallNotifier implements Worker<Pair<Integer, String>, Void> {
ContactInfo contactInfo =
callLogNotificationsQueryHelper.getContactInfo(
call.number, call.numberPresentation, call.countryIso);
- titleResId =
- contactInfo.userType == ContactsUtils.USER_TYPE_WORK
- ? R.string.notification_missedWorkCallTitle
- : R.string.notification_missedCallTitle;
+ if (contactInfo.userType == ContactsUtils.USER_TYPE_WORK) {
+ titleText = context.getSystemService(DevicePolicyManager.class).getResources().getString(
+ NOTIFICATION_MISSED_WORK_CALL_TITLE,
+ () -> context.getString(R.string.notification_missedWorkCallTitle));
+ } else {
+ titleText = context.getString(R.string.notification_missedCallTitle);
+ }
if (TextUtils.equals(contactInfo.name, contactInfo.formattedNumber)
|| TextUtils.equals(contactInfo.name, contactInfo.number)) {
@@ -189,7 +195,7 @@ public class MissedCallNotifier implements Worker<Pair<Integer, String>, Void> {
groupSummary.setLargeIcon(photoIcon);
}
} else {
- titleResId = R.string.notification_missedCallsTitle;
+ titleText = context.getString(R.string.notification_missedCallsTitle);
expandedText = context.getString(R.string.notification_missedCallsMsg, count);
}
@@ -199,14 +205,14 @@ public class MissedCallNotifier implements Worker<Pair<Integer, String>, Void> {
// notification content is hidden.
Notification.Builder publicSummaryBuilder = createNotificationBuilder();
publicSummaryBuilder
- .setContentTitle(context.getText(titleResId))
+ .setContentTitle(titleText)
.setContentIntent(createCallLogPendingIntent())
.setDeleteIntent(
CallLogNotificationsService.createCancelAllMissedCallsPendingIntent(context));
// Create the notification summary suitable for display when sensitive information is showing.
groupSummary
- .setContentTitle(context.getText(titleResId))
+ .setContentTitle(titleText)
.setContentText(expandedText)
.setContentIntent(createCallLogPendingIntent())
.setDeleteIntent(
diff --git a/java/com/android/dialer/callintent/CallIntent.java b/java/com/android/dialer/callintent/CallIntent.java
index ef7aff672..183eb16e7 100644
--- a/java/com/android/dialer/callintent/CallIntent.java
+++ b/java/com/android/dialer/callintent/CallIntent.java
@@ -152,8 +152,7 @@ public abstract class CallIntent implements Parcelable {
.setTimeSinceFirstClick(PerformanceReport.getTimeSinceFirstClick())
.addAllUiActionsSinceAppLaunch(PerformanceReport.getActions())
.addAllUiActionTimestampsSinceAppLaunch(PerformanceReport.getActionTimestamps())
- .setStartingTabIndex(PerformanceReport.getStartingTabIndex())
- .build();
+ .setStartingTabIndex(PerformanceReport.getStartingTabIndex());
PerformanceReport.stopRecording();
}
diff --git a/java/com/android/dialer/callintent/CallIntentBuilder.java b/java/com/android/dialer/callintent/CallIntentBuilder.java
index 7cc589123..b7f7d76a9 100644
--- a/java/com/android/dialer/callintent/CallIntentBuilder.java
+++ b/java/com/android/dialer/callintent/CallIntentBuilder.java
@@ -77,8 +77,7 @@ public class CallIntentBuilder implements Parcelable {
.setTimeSinceFirstClick(PerformanceReport.getTimeSinceFirstClick())
.addAllUiActionsSinceAppLaunch(PerformanceReport.getActions())
.addAllUiActionTimestampsSinceAppLaunch(PerformanceReport.getActionTimestamps())
- .setStartingTabIndex(PerformanceReport.getStartingTabIndex())
- .build();
+ .setStartingTabIndex(PerformanceReport.getStartingTabIndex());
PerformanceReport.stopRecording();
}
diff --git a/java/com/android/dialer/commandline/impl/CallCommand.java b/java/com/android/dialer/commandline/impl/CallCommand.java
index 5bcf78548..d0008a321 100644
--- a/java/com/android/dialer/commandline/impl/CallCommand.java
+++ b/java/com/android/dialer/commandline/impl/CallCommand.java
@@ -19,8 +19,6 @@ package com.android.dialer.commandline.impl;
import android.content.Context;
import android.content.Intent;
import android.support.annotation.NonNull;
-import android.telecom.PhoneAccount;
-import android.telecom.PhoneAccountHandle;
import android.telecom.TelecomManager;
import com.android.dialer.buildtype.BuildType;
import com.android.dialer.buildtype.BuildType.Type;
@@ -67,8 +65,6 @@ public class CallCommand implements Command {
}
String number = args.expectPositional(0, "number");
TelecomManager telecomManager = appContext.getSystemService(TelecomManager.class);
- PhoneAccountHandle phoneAccountHandle =
- telecomManager.getDefaultOutgoingPhoneAccount(PhoneAccount.SCHEME_TEL);
CallIntentBuilder callIntentBuilder;
if ("voicemail".equals(number)) {
callIntentBuilder =
diff --git a/java/com/android/dialer/contacts/hiresphoto/HighResolutionPhotoRequesterImpl.java b/java/com/android/dialer/contacts/hiresphoto/HighResolutionPhotoRequesterImpl.java
index 9201604be..0c1461313 100644
--- a/java/com/android/dialer/contacts/hiresphoto/HighResolutionPhotoRequesterImpl.java
+++ b/java/com/android/dialer/contacts/hiresphoto/HighResolutionPhotoRequesterImpl.java
@@ -51,8 +51,8 @@ public class HighResolutionPhotoRequesterImpl implements HighResolutionPhotoRequ
@VisibleForTesting
static final ComponentName SYNC_HIGH_RESOLUTION_PHOTO_SERVICE =
new ComponentName(
- "com.google.android.syncadapters.contacts",
- "com.google.android.syncadapters.contacts.SyncHighResPhotoIntentService");
+ "com.google.android.gms",
+ "com.google.android.gms.people.sync.focus.SyncHighResPhotoIntentOperation");
private final Context appContext;
private final ListeningExecutorService backgroundExecutor;
@@ -81,7 +81,8 @@ public class HighResolutionPhotoRequesterImpl implements HighResolutionPhotoRequ
private void requestInternal(Uri contactUri) throws RequestFailedException {
for (Long rawContactId : getGoogleRawContactIds(getContactId(contactUri))) {
Uri rawContactUri = ContentUris.withAppendedId(RawContacts.CONTENT_URI, rawContactId);
- Intent intent = new Intent(Intent.ACTION_VIEW);
+ Intent intent = new Intent();
+ intent.setAction("com.google.android.gms.people.sync.focus.SYNC_HIGH_RES_PHOTO");
intent.setComponent(SYNC_HIGH_RESOLUTION_PHOTO_SERVICE);
intent.setDataAndType(rawContactUri, RawContacts.CONTENT_ITEM_TYPE);
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
@@ -89,7 +90,7 @@ public class HighResolutionPhotoRequesterImpl implements HighResolutionPhotoRequ
LogUtil.i(
"HighResolutionPhotoRequesterImpl.requestInternal",
"requesting photo for " + rawContactUri);
- appContext.startService(intent);
+ appContext.sendBroadcast(intent);
} catch (IllegalStateException | SecurityException e) {
throw new RequestFailedException("unable to start sync adapter", e);
}
diff --git a/java/com/android/dialer/notification/VoicemailChannelUtils.java b/java/com/android/dialer/notification/VoicemailChannelUtils.java
index 83bda0f18..ddc0f773c 100644
--- a/java/com/android/dialer/notification/VoicemailChannelUtils.java
+++ b/java/com/android/dialer/notification/VoicemailChannelUtils.java
@@ -16,8 +16,6 @@
package com.android.dialer.notification;
-import static java.nio.charset.StandardCharsets.UTF_8;
-
import android.Manifest.permission;
import android.annotation.TargetApi;
import android.app.NotificationChannel;
@@ -40,35 +38,15 @@ import android.util.ArraySet;
import com.android.dialer.common.Assert;
import com.android.dialer.common.LogUtil;
import com.android.dialer.util.PermissionsUtil;
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
/** Utilities for working with voicemail channels. */
@TargetApi(VERSION_CODES.O)
-public final class VoicemailChannelUtils {
+/* package */ final class VoicemailChannelUtils {
@VisibleForTesting static final String GLOBAL_VOICEMAIL_CHANNEL_ID = "phone_voicemail";
private static final String PER_ACCOUNT_VOICEMAIL_CHANNEL_ID_PREFIX = "phone_voicemail_account_";
- private static final char[] hexDigits = "0123456789abcdef".toCharArray();
-
- /**
- * Returns a String representation of the hashed value of the PhoneAccountHandle's id (the
- * Sim ICC ID).
- * In case it fails to hash the id it will return an empty string.
- */
- public static String getHashedPhoneAccountId(@NonNull PhoneAccountHandle handle) {
- byte[] handleBytes = handle.getId().getBytes(UTF_8);
- try {
- byte[] hashedBytes = MessageDigest.getInstance("SHA-256").digest(handleBytes);
- return byteArrayToHexString(hashedBytes);
- } catch (NoSuchAlgorithmException e) {
- LogUtil.e("VoicemailChannelUtils.getHashedPhoneAccountId",
- "NoSuchAlgorithmException throw! Returning empty string!");
- return "";
- }
- }
@SuppressWarnings("MissingPermission") // isSingleSimDevice() returns true if no permission
static Set<String> getAllChannelIds(@NonNull Context context) {
@@ -146,17 +124,7 @@ public final class VoicemailChannelUtils {
private static String getChannelIdForAccount(@NonNull PhoneAccountHandle handle) {
Assert.isNotNull(handle);
- return PER_ACCOUNT_VOICEMAIL_CHANNEL_ID_PREFIX
- + ":"
- + getHashedPhoneAccountId(handle);
- }
-
- private static String byteArrayToHexString(byte[] bytes) {
- StringBuilder sb = new StringBuilder(2 * bytes.length);
- for (byte b : bytes) {
- sb.append(hexDigits[(b >> 4) & 0xf]).append(hexDigits[b & 0xf]);
- }
- return sb.toString();
+ return PER_ACCOUNT_VOICEMAIL_CHANNEL_ID_PREFIX + ":" + handle.getId();
}
/**
diff --git a/java/com/android/incallui/StatusBarNotifier.java b/java/com/android/incallui/StatusBarNotifier.java
index 99ff7255e..39428512b 100644
--- a/java/com/android/incallui/StatusBarNotifier.java
+++ b/java/com/android/incallui/StatusBarNotifier.java
@@ -18,6 +18,9 @@ package com.android.incallui;
import static android.telecom.Call.Details.PROPERTY_HIGH_DEF_AUDIO;
import static com.android.contacts.common.compat.CallCompat.Details.PROPERTY_ENTERPRISE_CALL;
+import static com.android.dialer.app.DevicePolicyResources.NOTIFICATION_INCOMING_WORK_CALL_TITLE;
+import static com.android.dialer.app.DevicePolicyResources.NOTIFICATION_ONGOING_WORK_CALL_TITLE;
+import static com.android.dialer.app.DevicePolicyResources.NOTIFICATION_WIFI_WORK_CALL_LABEL;
import static com.android.incallui.NotificationBroadcastReceiver.ACTION_ACCEPT_VIDEO_UPGRADE_REQUEST;
import static com.android.incallui.NotificationBroadcastReceiver.ACTION_ANSWER_SPEAKEASY_CALL;
import static com.android.incallui.NotificationBroadcastReceiver.ACTION_ANSWER_VIDEO_INCOMING_CALL;
@@ -31,6 +34,7 @@ import static com.android.incallui.NotificationBroadcastReceiver.ACTION_TURN_ON_
import android.Manifest;
import android.app.Notification;
import android.app.PendingIntent;
+import android.app.admin.DevicePolicyManager;
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
@@ -677,6 +681,10 @@ public class StatusBarNotifier
call.getState() == DialerCallState.INCOMING
|| call.getState() == DialerCallState.CALL_WAITING;
+ // Is the call placed through work connection service.
+ boolean isWorkCall = call.hasProperty(PROPERTY_ENTERPRISE_CALL)
+ || userType == ContactsUtils.USER_TYPE_WORK;
+
if (isIncomingOrWaiting
&& call.getNumberPresentation() == TelecomManager.PRESENTATION_ALLOWED) {
@@ -687,54 +695,73 @@ public class StatusBarNotifier
}
}
- int resId = R.string.notification_ongoing_call;
- String wifiBrand = context.getString(R.string.notification_call_wifi_brand);
+
+ String message = getOngoingCallNotificationMessage(isWorkCall);
+ String wifiBrand = getWifiBrand(isWorkCall);
+
+ // TODO(a bug): Potentially apply this template logic everywhere.
if (call.hasProperty(Details.PROPERTY_WIFI)) {
- resId = R.string.notification_ongoing_call_wifi_template;
+ message = context.getString(R.string.notification_ongoing_call_wifi_template, wifiBrand);
}
if (isIncomingOrWaiting) {
if (call.isSpam()) {
- resId = R.string.notification_incoming_spam_call;
+ message = context.getString(R.string.notification_incoming_spam_call);
} else if (shouldShowEnrichedCallNotification(call.getEnrichedCallSession())) {
- resId = getECIncomingCallText(call.getEnrichedCallSession());
+ message = context.getString(getECIncomingCallText(call.getEnrichedCallSession()));
} else if (call.hasProperty(Details.PROPERTY_WIFI)) {
- resId = R.string.notification_incoming_call_wifi_template;
+ message = context.getString(R.string.notification_incoming_call_wifi_template, wifiBrand);
} else if (call.getAccountHandle() != null && hasMultiplePhoneAccounts(call)) {
return getMultiSimIncomingText(call);
} else if (call.isVideoCall()) {
- resId = R.string.notification_incoming_video_call;
+ message = context.getString(R.string.notification_incoming_video_call);
} else {
- resId = R.string.notification_incoming_call;
+ message = getIncomingCallNotificationMessage(isWorkCall);
}
} else if (call.getState() == DialerCallState.ONHOLD) {
- resId = R.string.notification_on_hold;
+ message = context.getString(R.string.notification_on_hold);
} else if (DialerCallState.isDialing(call.getState())) {
- resId = R.string.notification_dialing;
+ message = context.getString(R.string.notification_dialing);
} else if (call.isVideoCall()) {
- resId =
- call.getVideoTech().isPaused()
+ message = context.getString(call.getVideoTech().isPaused()
? R.string.notification_ongoing_paused_video_call
- : R.string.notification_ongoing_video_call;
+ : R.string.notification_ongoing_video_call);
} else if (call.getVideoTech().getSessionModificationState()
== SessionModificationState.RECEIVED_UPGRADE_TO_VIDEO_REQUEST) {
- resId = R.string.notification_requesting_video_call;
+ message = context.getString(R.string.notification_requesting_video_call);
}
- // Is the call placed through work connection service.
- boolean isWorkCall = call.hasProperty(PROPERTY_ENTERPRISE_CALL);
- if (userType == ContactsUtils.USER_TYPE_WORK || isWorkCall) {
- resId = getWorkStringFromPersonalString(resId);
- wifiBrand = context.getString(R.string.notification_call_wifi_work_brand);
+ return message;
+ }
+
+ private String getOngoingCallNotificationMessage(boolean isWorkCall) {
+ if (isWorkCall) {
+ DevicePolicyManager dpm = context.getSystemService(DevicePolicyManager.class);
+ return dpm.getResources().getString(NOTIFICATION_ONGOING_WORK_CALL_TITLE, () ->
+ context.getString(R.string.notification_ongoing_work_call));
+ } else {
+ return context.getString(R.string.notification_ongoing_call);
}
+ }
- if (resId == R.string.notification_incoming_call_wifi_template
- || resId == R.string.notification_ongoing_call_wifi_template) {
- // TODO(a bug): Potentially apply this template logic everywhere.
- return context.getString(resId, wifiBrand);
+ private String getIncomingCallNotificationMessage(boolean isWorkCall) {
+ if (isWorkCall) {
+ DevicePolicyManager dpm = context.getSystemService(DevicePolicyManager.class);
+ return dpm.getResources().getString(NOTIFICATION_INCOMING_WORK_CALL_TITLE, () ->
+ context.getString(R.string.notification_incoming_work_call));
+ } else {
+ return context.getString(R.string.notification_incoming_call);
}
+ }
- return context.getString(resId);
+ private String getWifiBrand(boolean isWorkCall) {
+ if (isWorkCall) {
+ DevicePolicyManager dpm = context.getSystemService(DevicePolicyManager.class);
+ return dpm.getResources().getString(NOTIFICATION_WIFI_WORK_CALL_LABEL, () ->
+ context.getString(R.string.notification_call_wifi_work_brand));
+ } else {
+ return context.getString(R.string.notification_call_wifi_brand);
+ }
}
private boolean shouldShowEnrichedCallNotification(Session session) {
diff --git a/java/com/android/voicemail/impl/sms/StatusSmsFetcher.java b/java/com/android/voicemail/impl/sms/StatusSmsFetcher.java
index 335ec3e03..dd945e9a0 100644
--- a/java/com/android/voicemail/impl/sms/StatusSmsFetcher.java
+++ b/java/com/android/voicemail/impl/sms/StatusSmsFetcher.java
@@ -54,7 +54,7 @@ public class StatusSmsFetcher extends BroadcastReceiver implements Closeable {
private static final long STATUS_SMS_TIMEOUT_MILLIS = 60_000;
private static final String PERMISSION_DIALER_ORIGIN =
- "com.android.dialer.permission.DIALER_ORIGIN";
+ "com.android.dialer.permission.DIALER_ORIGIN";
private static final String ACTION_REQUEST_SENT_INTENT =
"com.android.voicemailomtp.sms.REQUEST_SENT";