summaryrefslogtreecommitdiffstats
path: root/java/com/android/dialer/oem
diff options
context:
space:
mode:
authorEric Erfanian <erfanian@google.com>2017-03-24 09:31:16 -0700
committerEric Erfanian <erfanian@google.com>2017-03-27 08:56:19 -0700
commit9050823ccf6f512e06ad65c8a741cb17cbc4a833 (patch)
treee454c9e0fa20b8384fa87d4e6309bb8b9e3aa2a4 /java/com/android/dialer/oem
parentdd9d50805f1b49dff1fe3787740393d726124cdb (diff)
downloadandroid_packages_apps_Dialer-9050823ccf6f512e06ad65c8a741cb17cbc4a833.tar.gz
android_packages_apps_Dialer-9050823ccf6f512e06ad65c8a741cb17cbc4a833.tar.bz2
android_packages_apps_Dialer-9050823ccf6f512e06ad65c8a741cb17cbc4a833.zip
Update AOSP Dialer source from internal google3 repository at
cl/151128062 Test: make, treehugger This CL updates the AOSP Dialer source with all the changes that have gone into the private google3 repository. This includes all the changes from cl/150756069 (3/21/2017) to cl/151128062 (3/24/2017). Notable this release: - Explicitly enumerate host and target dependencies. - Update proguard flag references. This goal of these drops is to keep the AOSP source in sync with the internal google3 repository. Currently these sync are done by hand with very minor modifications to the internal source code. See the Android.mk file for list of modifications. Our current goal is to do frequent drops (daily if possible) and eventually switched to an automated process. Bug: 33210202 36511925 Addresses 33210202 - Proguard support 36511925 - Compiler warnings when building against platform sdk Change-Id: I448ec3b3f2358886859cf7a4ef76a8fcef3244ae
Diffstat (limited to 'java/com/android/dialer/oem')
-rw-r--r--java/com/android/dialer/oem/MotorolaHiddenMenuKeySequence.java3
-rw-r--r--java/com/android/dialer/oem/MotorolaUtils.java60
-rw-r--r--java/com/android/dialer/oem/res/values-mcc310-mnc000/motorola_config.xml6
-rw-r--r--java/com/android/dialer/oem/res/values-mcc310-mnc120/motorola_config.xml5
-rw-r--r--java/com/android/dialer/oem/res/values-mcc311-mnc490/motorola_config.xml5
-rw-r--r--java/com/android/dialer/oem/res/values-mcc311-mnc870/motorola_config.xml5
-rw-r--r--java/com/android/dialer/oem/res/values-mcc312-mnc530/motorola_config.xml5
-rw-r--r--java/com/android/dialer/oem/res/values-mcc316-mnc010/motorola_config.xml5
8 files changed, 89 insertions, 5 deletions
diff --git a/java/com/android/dialer/oem/MotorolaHiddenMenuKeySequence.java b/java/com/android/dialer/oem/MotorolaHiddenMenuKeySequence.java
index 18f621e01..9cf145b7a 100644
--- a/java/com/android/dialer/oem/MotorolaHiddenMenuKeySequence.java
+++ b/java/com/android/dialer/oem/MotorolaHiddenMenuKeySequence.java
@@ -68,7 +68,8 @@ public class MotorolaHiddenMenuKeySequence {
private MotorolaHiddenMenuKeySequence(Context context) {
featureHiddenMenuEnabled =
- context.getResources().getBoolean(R.bool.motorola_feature_hidden_menu);
+ MotorolaUtils.isSpnMatched(context)
+ && context.getResources().getBoolean(R.bool.motorola_feature_hidden_menu);
// In case we do have a SPN from resource we need to match from service; otherwise we are
// free to go
if (featureHiddenMenuEnabled) {
diff --git a/java/com/android/dialer/oem/MotorolaUtils.java b/java/com/android/dialer/oem/MotorolaUtils.java
index e31ec98b8..d0589103d 100644
--- a/java/com/android/dialer/oem/MotorolaUtils.java
+++ b/java/com/android/dialer/oem/MotorolaUtils.java
@@ -16,23 +16,53 @@
package com.android.dialer.oem;
import android.content.Context;
+import android.content.res.Resources;
+import android.telephony.TelephonyManager;
import com.android.dialer.common.ConfigProviderBindings;
+import com.android.dialer.common.PackageUtils;
/** Util class for Motorola OEM devices. */
public class MotorolaUtils {
private static final String CONFIG_HD_CODEC_BLINKING_ICON_WHEN_CONNECTING_CALL_ENABLED =
"hd_codec_blinking_icon_when_connecting_enabled";
+ private static final String CONFIG_HD_CODEC_SHOW_ICON_IN_NOTIFICATION_ENABLED =
+ "hd_codec_show_icon_in_notification_enabled";
private static final String CONFIG_HD_CODEC_SHOW_ICON_IN_CALL_LOG_ENABLED =
"hd_codec_show_icon_in_call_log_enabled";
+ private static final String CONFIG_WIFI_CALL_SHOW_ICON_IN_CALL_LOG_ENABLED =
+ "wifi_call_show_icon_in_call_log_enabled";
// This is used to check if a Motorola device supports HD voice call feature, which comes from
// system feature setting.
private static final String HD_CALL_FEATRURE = "com.motorola.software.sprint.hd_call";
+ // This is used to check if a Motorola device supports WiFi call feature, by checking if a certain
+ // package is enabled.
+ private static final String WIFI_CALL_PACKAGE_NAME = "com.motorola.sprintwfc";
// Feature flag indicates it's a HD call, currently this is only used by Motorola system build.
// TODO(b/35359461): Upstream and move it to android.provider.CallLog.
private static final int FEATURES_HD_CALL = 0x10000000;
+ // Feature flag indicates it's a WiFi call, currently this is only used by Motorola system build.
+ private static final int FEATURES_WIFI = 0x80000000;
+
+ private static boolean hasCheckedSprintWifiCall;
+ private static boolean supportSprintWifiCall;
+
+ /**
+ * Returns true if SPN is specified and matched the current sim operator name. This is necessary
+ * since mcc310-mnc000 is not sufficient to identify Sprint network.
+ */
+ static boolean isSpnMatched(Context context) {
+ try {
+ String spnResource = context.getResources().getString(R.string.motorola_enabled_spn);
+ return spnResource.equalsIgnoreCase(
+ context.getSystemService(TelephonyManager.class).getSimOperatorName());
+ } catch (Resources.NotFoundException exception) {
+ // If SPN is not specified we consider as not necessary to enable/disable the feature.
+ return true;
+ }
+ }
public static boolean shouldBlinkHdIconWhenConnectingCall(Context context) {
return ConfigProviderBindings.get(context)
@@ -40,11 +70,24 @@ public class MotorolaUtils {
&& isSupportingSprintHdCodec(context);
}
+ public static boolean shouldShowHdIconInNotification(Context context) {
+ return ConfigProviderBindings.get(context)
+ .getBoolean(CONFIG_HD_CODEC_SHOW_ICON_IN_NOTIFICATION_ENABLED, true)
+ && isSupportingSprintHdCodec(context);
+ }
+
public static boolean shouldShowHdIconInCallLog(Context context, int features) {
return ConfigProviderBindings.get(context)
.getBoolean(CONFIG_HD_CODEC_SHOW_ICON_IN_CALL_LOG_ENABLED, true)
- && isSupportingSprintHdCodec(context)
- && (features & FEATURES_HD_CALL) == FEATURES_HD_CALL;
+ && (features & FEATURES_HD_CALL) == FEATURES_HD_CALL
+ && isSupportingSprintHdCodec(context);
+ }
+
+ public static boolean shouldShowWifiIconInCallLog(Context context, int features) {
+ return ConfigProviderBindings.get(context)
+ .getBoolean(CONFIG_WIFI_CALL_SHOW_ICON_IN_CALL_LOG_ENABLED, true)
+ && (features & FEATURES_WIFI) == FEATURES_WIFI
+ && isSupportingSprintWifiCall(context);
}
/**
@@ -60,7 +103,16 @@ public class MotorolaUtils {
}
private static boolean isSupportingSprintHdCodec(Context context) {
- return context.getPackageManager().hasSystemFeature(HD_CALL_FEATRURE)
- && context.getResources().getBoolean(R.bool.motorola_sprint_hd_codec);
+ return isSpnMatched(context)
+ && context.getResources().getBoolean(R.bool.motorola_sprint_hd_codec)
+ && context.getPackageManager().hasSystemFeature(HD_CALL_FEATRURE);
+ }
+
+ private static boolean isSupportingSprintWifiCall(Context context) {
+ if (!hasCheckedSprintWifiCall) {
+ supportSprintWifiCall = PackageUtils.isPackageEnabled(WIFI_CALL_PACKAGE_NAME, context);
+ hasCheckedSprintWifiCall = true;
+ }
+ return supportSprintWifiCall;
}
}
diff --git a/java/com/android/dialer/oem/res/values-mcc310-mnc000/motorola_config.xml b/java/com/android/dialer/oem/res/values-mcc310-mnc000/motorola_config.xml
new file mode 100644
index 000000000..7f63bee75
--- /dev/null
+++ b/java/com/android/dialer/oem/res/values-mcc310-mnc000/motorola_config.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <bool name="motorola_sprint_hd_codec">true</bool>
+ <bool name="motorola_feature_hidden_menu">true</bool>
+ <string name="motorola_enabled_spn">Sprint</string>
+</resources> \ No newline at end of file
diff --git a/java/com/android/dialer/oem/res/values-mcc310-mnc120/motorola_config.xml b/java/com/android/dialer/oem/res/values-mcc310-mnc120/motorola_config.xml
new file mode 100644
index 000000000..39b72cdd1
--- /dev/null
+++ b/java/com/android/dialer/oem/res/values-mcc310-mnc120/motorola_config.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <bool name="motorola_sprint_hd_codec">true</bool>
+ <bool name="motorola_feature_hidden_menu">true</bool>
+</resources> \ No newline at end of file
diff --git a/java/com/android/dialer/oem/res/values-mcc311-mnc490/motorola_config.xml b/java/com/android/dialer/oem/res/values-mcc311-mnc490/motorola_config.xml
new file mode 100644
index 000000000..39b72cdd1
--- /dev/null
+++ b/java/com/android/dialer/oem/res/values-mcc311-mnc490/motorola_config.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <bool name="motorola_sprint_hd_codec">true</bool>
+ <bool name="motorola_feature_hidden_menu">true</bool>
+</resources> \ No newline at end of file
diff --git a/java/com/android/dialer/oem/res/values-mcc311-mnc870/motorola_config.xml b/java/com/android/dialer/oem/res/values-mcc311-mnc870/motorola_config.xml
new file mode 100644
index 000000000..39b72cdd1
--- /dev/null
+++ b/java/com/android/dialer/oem/res/values-mcc311-mnc870/motorola_config.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <bool name="motorola_sprint_hd_codec">true</bool>
+ <bool name="motorola_feature_hidden_menu">true</bool>
+</resources> \ No newline at end of file
diff --git a/java/com/android/dialer/oem/res/values-mcc312-mnc530/motorola_config.xml b/java/com/android/dialer/oem/res/values-mcc312-mnc530/motorola_config.xml
new file mode 100644
index 000000000..39b72cdd1
--- /dev/null
+++ b/java/com/android/dialer/oem/res/values-mcc312-mnc530/motorola_config.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <bool name="motorola_sprint_hd_codec">true</bool>
+ <bool name="motorola_feature_hidden_menu">true</bool>
+</resources> \ No newline at end of file
diff --git a/java/com/android/dialer/oem/res/values-mcc316-mnc010/motorola_config.xml b/java/com/android/dialer/oem/res/values-mcc316-mnc010/motorola_config.xml
new file mode 100644
index 000000000..39b72cdd1
--- /dev/null
+++ b/java/com/android/dialer/oem/res/values-mcc316-mnc010/motorola_config.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <bool name="motorola_sprint_hd_codec">true</bool>
+ <bool name="motorola_feature_hidden_menu">true</bool>
+</resources> \ No newline at end of file