summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
Diffstat (limited to 'java')
-rw-r--r--java/com/android/dialer/about/AndroidManifest.xml16
-rw-r--r--java/com/android/dialer/app/settings/DialerSettingsActivity.java15
-rw-r--r--java/com/android/dialer/app/voicemail/error/res/values/strings.xml4
-rw-r--r--java/com/android/incallui/CallCardPresenter.java4
-rw-r--r--java/com/android/incallui/call/CallList.java22
-rw-r--r--java/com/android/incallui/call/DialerCall.java11
-rw-r--r--java/com/android/incallui/contactgrid/BottomRow.java5
-rw-r--r--java/com/android/incallui/contactgrid/res/values/strings.xml7
8 files changed, 68 insertions, 16 deletions
diff --git a/java/com/android/dialer/about/AndroidManifest.xml b/java/com/android/dialer/about/AndroidManifest.xml
index 85c750826..3d5067ade 100644
--- a/java/com/android/dialer/about/AndroidManifest.xml
+++ b/java/com/android/dialer/about/AndroidManifest.xml
@@ -1,10 +1,24 @@
+<!-- Copyright (C) 2017 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.
+-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.dialer.about">
<application android:theme="@style/Theme.AppCompat">
<activity
android:name="com.android.dialer.about.LicenseMenuActivity"
android:label="@string/licenseActivityLabel"
- android:exported="false"
+ android:exported="true"
android:theme="@style/Theme.AppCompat.Light">
</activity>
<activity
diff --git a/java/com/android/dialer/app/settings/DialerSettingsActivity.java b/java/com/android/dialer/app/settings/DialerSettingsActivity.java
index 6010f92b5..6286bfc88 100644
--- a/java/com/android/dialer/app/settings/DialerSettingsActivity.java
+++ b/java/com/android/dialer/app/settings/DialerSettingsActivity.java
@@ -135,10 +135,12 @@ public class DialerSettingsActivity extends AppCompatPreferenceActivity {
target.add(accessibilitySettingsHeader);
}
- Header aboutPhoneHeader = new Header();
- aboutPhoneHeader.titleRes = R.string.about_phone_label;
- aboutPhoneHeader.fragment = AboutPhoneFragment.class.getName();
- target.add(aboutPhoneHeader);
+ if (showAbout()) {
+ Header aboutPhoneHeader = new Header();
+ aboutPhoneHeader.titleRes = R.string.about_phone_label;
+ aboutPhoneHeader.fragment = AboutPhoneFragment.class.getName();
+ target.add(aboutPhoneHeader);
+ }
}
private void addVoicemailSettings(List<Header> target, boolean isPrimaryUser) {
@@ -208,6 +210,11 @@ public class DialerSettingsActivity extends AppCompatPreferenceActivity {
return result;
}
+ /** Whether "about" should be shown in settings. Override to hide about. */
+ public boolean showAbout() {
+ return true;
+ }
+
/**
* Returns {@code true} or {@code false} based on whether the display options setting should be
* shown. For languages such as Chinese, Japanese, or Korean, display options aren't useful since
diff --git a/java/com/android/dialer/app/voicemail/error/res/values/strings.xml b/java/com/android/dialer/app/voicemail/error/res/values/strings.xml
index 3917cf8a2..1ac48138d 100644
--- a/java/com/android/dialer/app/voicemail/error/res/values/strings.xml
+++ b/java/com/android/dialer/app/voicemail/error/res/values/strings.xml
@@ -136,8 +136,8 @@
<string translatable="false" name="verizon_domestic_customer_support_number">+18009220204</string>
<string translatable="false" name="verizon_domestic_customer_support_display_number">(800) 922–0204</string>
- <string name="verizon_terms_and_conditions_title">Turn on Visual Voice Mail</string>
- <string name="verizon_terms_and_conditions_message">%1$s\n\nBy turning on Visual Voice Mail you agree to the Verizon Wireless terms and conditions:\n\n%2$s</string>
+ <string name="verizon_terms_and_conditions_title">Turn on visual voicemail</string>
+ <string name="verizon_terms_and_conditions_message">%1$s\n\nBy turning on visual voicemail you agree to the Verizon Wireless terms and conditions:\n\n%2$s</string>
<string name="dialer_terms_and_conditions_title">Turn on visual voicemail</string>
<string name="dialer_terms_and_conditions_message">%s</string>
diff --git a/java/com/android/incallui/CallCardPresenter.java b/java/com/android/incallui/CallCardPresenter.java
index 653b51aa5..15b04eaaf 100644
--- a/java/com/android/incallui/CallCardPresenter.java
+++ b/java/com/android/incallui/CallCardPresenter.java
@@ -52,6 +52,7 @@ import com.android.dialer.logging.DialerImpression;
import com.android.dialer.logging.Logger;
import com.android.dialer.multimedia.MultimediaData;
import com.android.dialer.oem.MotorolaUtils;
+import com.android.dialer.phonenumberutil.PhoneNumberHelper;
import com.android.dialer.postcall.PostCall;
import com.android.incallui.ContactInfoCache.ContactCacheEntry;
import com.android.incallui.ContactInfoCache.ContactInfoCacheCallback;
@@ -466,7 +467,8 @@ public class CallCardPresenter
getCallStateIcon(),
getGatewayNumber(),
shouldShowCallSubject(mPrimary) ? mPrimary.getCallSubject() : null,
- mPrimary.getCallbackNumber(),
+ PhoneNumberHelper.formatNumber(
+ mPrimary.getCallbackNumber(), mPrimary.getSimCountryIso()),
mPrimary.hasProperty(Details.PROPERTY_WIFI),
mPrimary.isConferenceCall()
&& !mPrimary.hasProperty(Details.PROPERTY_GENERIC_CONFERENCE),
diff --git a/java/com/android/incallui/call/CallList.java b/java/com/android/incallui/call/CallList.java
index 1f2c4c6ec..8d6620628 100644
--- a/java/com/android/incallui/call/CallList.java
+++ b/java/com/android/incallui/call/CallList.java
@@ -79,6 +79,8 @@ public class CallList implements DialerCallDelegate {
private final Set<DialerCall> mPendingDisconnectCalls =
Collections.newSetFromMap(new ConcurrentHashMap<DialerCall, Boolean>(8, 0.9f, 1));
+
+ private UiListener mUiListeners;
/** Handles the timeout for destroying disconnected calls. */
private final Handler mHandler =
new Handler() {
@@ -116,6 +118,9 @@ public class CallList implements DialerCallDelegate {
public void onCallAdded(
final Context context, final android.telecom.Call telecomCall, LatencyReport latencyReport) {
Trace.beginSection("CallList.onCallAdded");
+ if (mUiListeners != null) {
+ mUiListeners.onCallAdded();
+ }
final DialerCall call =
new DialerCall(context, this, telecomCall, latencyReport, true /* registerCallback */);
if (getFirstCall() != null) {
@@ -377,6 +382,10 @@ public class CallList implements DialerCallDelegate {
listener.onCallListChange(this);
}
+ public void setUiListener(UiListener uiListener) {
+ mUiListeners = uiListener;
+ }
+
public void removeListener(@Nullable Listener listener) {
if (listener != null) {
mListeners.remove(listener);
@@ -727,6 +736,9 @@ public class CallList implements DialerCallDelegate {
for (DialerCall call : mCallById.values()) {
call.getLatencyReport().onInCallUiShown(forFullScreenIntent);
}
+ if (mUiListeners != null) {
+ mUiListeners.onInCallUiShown();
+ }
}
/** Listener interface for any class that wants to be notified of changes to the call list. */
@@ -775,6 +787,16 @@ public class CallList implements DialerCallDelegate {
void onInternationalCallOnWifi(@NonNull DialerCall call);
}
+ /** UiListener interface for measuring incall latency.(used by testing only) */
+ public interface UiListener {
+
+ /** Called when a new call gets added into call list from IncallServiceImpl */
+ void onCallAdded();
+
+ /** Called in the end of onResume method of IncallActivityCommon. */
+ void onInCallUiShown();
+ }
+
private class DialerCallListenerImpl implements DialerCallListener {
@NonNull private final DialerCall mCall;
diff --git a/java/com/android/incallui/call/DialerCall.java b/java/com/android/incallui/call/DialerCall.java
index a9bad5b58..4f31dadf4 100644
--- a/java/com/android/incallui/call/DialerCall.java
+++ b/java/com/android/incallui/call/DialerCall.java
@@ -1182,6 +1182,17 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa
return callbackNumber;
}
+ public String getSimCountryIso() {
+ String simCountryIso =
+ TelephonyManagerCompat.getTelephonyManagerForPhoneAccountHandle(
+ mContext, getAccountHandle())
+ .getSimCountryIso();
+ if (!TextUtils.isEmpty(simCountryIso)) {
+ simCountryIso = simCountryIso.toUpperCase(Locale.US);
+ }
+ return simCountryIso;
+ }
+
@Override
public void onVideoTechStateChanged() {
update();
diff --git a/java/com/android/incallui/contactgrid/BottomRow.java b/java/com/android/incallui/contactgrid/BottomRow.java
index 6068cc0e5..91f08ef3e 100644
--- a/java/com/android/incallui/contactgrid/BottomRow.java
+++ b/java/com/android/incallui/contactgrid/BottomRow.java
@@ -103,10 +103,7 @@ public class BottomRow {
}
} else if (!TextUtils.isEmpty(state.callbackNumber)) {
// This is used for carriers like Project Fi to show the callback number for emergency calls.
- label =
- context.getString(
- R.string.contact_grid_callback_number,
- PhoneNumberUtils.formatNumber(state.callbackNumber));
+ label = context.getString(R.string.contact_grid_callback_number, state.callbackNumber);
isTimerVisible = false;
} else {
label = getLabelForPhoneNumber(primaryInfo);
diff --git a/java/com/android/incallui/contactgrid/res/values/strings.xml b/java/com/android/incallui/contactgrid/res/values/strings.xml
index 63037dc31..eba4abf30 100644
--- a/java/com/android/incallui/contactgrid/res/values/strings.xml
+++ b/java/com/android/incallui/contactgrid/res/values/strings.xml
@@ -80,8 +80,7 @@
<!-- Displayed in the answer call screen for incoming spam calls. -->
<string name="contact_grid_incoming_suspected_spam">Suspected spam caller</string>
- <!-- In-call screen: string shown to the user when their outgoing number is different than the
- number reported by TelephonyManager#getLine1Number(). This is used for carriers like
- Project Fi so that users can give their number to emergency responders. -->
- <string name="contact_grid_callback_number">Callback number: <xliff:g id="dark_number">%1$s</xliff:g></string>
+ <!-- In-call screen: phone number of the device shown to the users so that users can give their
+ number to emergency responders. -->
+ <string name="contact_grid_callback_number">This phone\'s number: <xliff:g id="light_number">%1$s</xliff:g></string>
</resources>