summaryrefslogtreecommitdiff
path: root/telecomm
diff options
context:
space:
mode:
authorBrian Orr <brianorr@google.com>2021-05-13 20:42:01 -0700
committerBrian Orr <brianorr@google.com>2021-05-13 20:42:01 -0700
commit1b62159ffcebb2c102e129b2e778a8f65b7e5948 (patch)
treec28571796470b5c9e3d9e8c2dc8d49ddf819fd60 /telecomm
parent86a43bb54c1ed3c75d072a2c465bf0447b5188c1 (diff)
parent3a582255fbbf0840208ec8cee02f8401982f0e39 (diff)
Merge SP1A.210510.001
Change-Id: Ia86f3e18206beabe334e3081cedbaf5b3274f78e
Diffstat (limited to 'telecomm')
-rwxr-xr-xtelecomm/java/android/telecom/Call.java1
-rw-r--r--telecomm/java/android/telecom/CallScreeningService.java2
-rw-r--r--telecomm/java/android/telecom/CallerInfoAsyncQuery.java11
-rwxr-xr-xtelecomm/java/android/telecom/ConnectionService.java9
-rw-r--r--telecomm/java/android/telecom/DiagnosticCall.java27
-rw-r--r--telecomm/java/android/telecom/Logging/Session.java22
6 files changed, 32 insertions, 40 deletions
diff --git a/telecomm/java/android/telecom/Call.java b/telecomm/java/android/telecom/Call.java
index 41d4df43b1da..c40de406fb6d 100755
--- a/telecomm/java/android/telecom/Call.java
+++ b/telecomm/java/android/telecom/Call.java
@@ -2553,6 +2553,7 @@ public final class Call {
} else if (mRttCall != null && parcelableCall.getParcelableRttCall() == null
&& parcelableCall.getIsRttCallChanged()) {
isRttChanged = true;
+ mRttCall.close();
mRttCall = null;
}
diff --git a/telecomm/java/android/telecom/CallScreeningService.java b/telecomm/java/android/telecom/CallScreeningService.java
index deeb4331bcaa..7861b11158cd 100644
--- a/telecomm/java/android/telecom/CallScreeningService.java
+++ b/telecomm/java/android/telecom/CallScreeningService.java
@@ -516,7 +516,7 @@ public abstract class CallScreeningService extends Service {
* called with {@code false}, and all other parameters in this builder will be ignored.
* <p>
* This request will only be honored if the {@link CallScreeningService} shares the same
- * uid as the default dialer app. Otherwise, the call will go through as usual.
+ * uid as the system dialer app. Otherwise, the call will go through as usual.
* <p>
* Apps built with SDK version {@link android.os.Build.VERSION_CODES#R} or later which
* are using the microphone as part of audio processing should specify the
diff --git a/telecomm/java/android/telecom/CallerInfoAsyncQuery.java b/telecomm/java/android/telecom/CallerInfoAsyncQuery.java
index a9e1a8fc1952..bf49f3c7b9bf 100644
--- a/telecomm/java/android/telecom/CallerInfoAsyncQuery.java
+++ b/telecomm/java/android/telecom/CallerInfoAsyncQuery.java
@@ -483,7 +483,16 @@ public class CallerInfoAsyncQuery {
// check to see if these are recognized numbers, and use shortcuts if we can.
TelephonyManager tm = context.getSystemService(TelephonyManager.class);
- if (tm.isEmergencyNumber(number)) {
+ boolean isEmergencyNumber = false;
+ try {
+ isEmergencyNumber = tm.isEmergencyNumber(number);
+ } catch (IllegalStateException ise) {
+ // Ignore the exception that Telephony is not up. Use PhoneNumberUtils API now.
+ // Ideally the PhoneNumberUtils API needs to be removed once the
+ // telphony service not up issue can be fixed (b/187412989)
+ isEmergencyNumber = PhoneNumberUtils.isLocalEmergencyNumber(context, number);
+ }
+ if (isEmergencyNumber) {
cw.event = EVENT_EMERGENCY_NUMBER;
} else if (PhoneNumberUtils.isVoiceMailNumber(context, subId, number)) {
cw.event = EVENT_VOICEMAIL_NUMBER;
diff --git a/telecomm/java/android/telecom/ConnectionService.java b/telecomm/java/android/telecom/ConnectionService.java
index c0b540e024bb..7cff44ea47b8 100755
--- a/telecomm/java/android/telecom/ConnectionService.java
+++ b/telecomm/java/android/telecom/ConnectionService.java
@@ -3450,4 +3450,13 @@ public abstract class ConnectionService extends Service {
public Handler getHandler() {
return mHandler;
}
+
+ /**
+ * Sets this {@link ConnectionService} ready for testing purposes.
+ * @hide
+ */
+ @VisibleForTesting
+ public void setReadyForTest() {
+ mAreAccountsInitialized = true;
+ }
}
diff --git a/telecomm/java/android/telecom/DiagnosticCall.java b/telecomm/java/android/telecom/DiagnosticCall.java
deleted file mode 100644
index a6b7258052a4..000000000000
--- a/telecomm/java/android/telecom/DiagnosticCall.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright (C) 2021 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 android.telecom;
-
-import android.annotation.SystemApi;
-
-/**
- * @deprecated use {@link CallDiagnostics} instead.
- * @hide
- */
-@SystemApi
-public abstract class DiagnosticCall extends CallDiagnostics {
-}
diff --git a/telecomm/java/android/telecom/Logging/Session.java b/telecomm/java/android/telecom/Logging/Session.java
index 4aa3614fa004..e2fb6019f30a 100644
--- a/telecomm/java/android/telecom/Logging/Session.java
+++ b/telecomm/java/android/telecom/Logging/Session.java
@@ -453,19 +453,19 @@ public class Session {
@Override
public String toString() {
- if (mParentSession != null && mIsStartedFromActiveSession) {
+ Session sessionToPrint = this;
+ if (getParentSession() != null && isStartedFromActiveSession()) {
// Log.startSession was called from within another active session. Use the parent's
// Id instead of the child to reduce confusion.
- return mParentSession.toString();
- } else {
- StringBuilder methodName = new StringBuilder();
- methodName.append(getFullMethodPath(false /*truncatePath*/));
- if (mOwnerInfo != null && !mOwnerInfo.isEmpty()) {
- methodName.append("(");
- methodName.append(mOwnerInfo);
- methodName.append(")");
- }
- return methodName.toString() + "@" + getFullSessionId();
+ sessionToPrint = getRootSession("toString");
+ }
+ StringBuilder methodName = new StringBuilder();
+ methodName.append(sessionToPrint.getFullMethodPath(false /*truncatePath*/));
+ if (sessionToPrint.getOwnerInfo() != null && !sessionToPrint.getOwnerInfo().isEmpty()) {
+ methodName.append("(");
+ methodName.append(sessionToPrint.getOwnerInfo());
+ methodName.append(")");
}
+ return methodName.toString() + "@" + sessionToPrint.getFullSessionId();
}
}