summaryrefslogtreecommitdiff
path: root/telecomm/java/android/telecom/TelecomManager.java
diff options
context:
space:
mode:
Diffstat (limited to 'telecomm/java/android/telecom/TelecomManager.java')
-rw-r--r--telecomm/java/android/telecom/TelecomManager.java35
1 files changed, 22 insertions, 13 deletions
diff --git a/telecomm/java/android/telecom/TelecomManager.java b/telecomm/java/android/telecom/TelecomManager.java
index 3f8b68305914..746e72a0bde3 100644
--- a/telecomm/java/android/telecom/TelecomManager.java
+++ b/telecomm/java/android/telecom/TelecomManager.java
@@ -432,6 +432,14 @@ public class TelecomManager {
"android.telecom.extra.CALL_DISCONNECT_MESSAGE";
/**
+ * A string value for {@link #EXTRA_CALL_DISCONNECT_MESSAGE}, indicates the call was dropped by
+ * lower layers
+ * @hide
+ */
+ public static final String CALL_AUTO_DISCONNECT_MESSAGE_STRING =
+ "Call dropped by lower layers";
+
+ /**
* Optional extra for {@link android.telephony.TelephonyManager#ACTION_PHONE_STATE_CHANGED}
* containing the component name of the associated connection service.
* @hide
@@ -1649,24 +1657,25 @@ public class TelecomManager {
}
/**
- * Returns whether the caller has {@link InCallService} access for companion apps.
- *
- * A companion app is an app associated with a physical wearable device via the
- * {@link android.companion.CompanionDeviceManager} API.
+ * Returns whether the caller has {@link android.Manifest.permission#MANAGE_ONGOING_CALLS}
+ * permission. The permission can be obtained by associating with a physical wearable device
+ * via the {@link android.companion.CompanionDeviceManager} API as a companion app. If the
+ * caller app has the permission, it has {@link InCallService} access to manage ongoing calls.
*
* @return {@code true} if the caller has {@link InCallService} access for
* companion app; {@code false} otherwise.
*/
- public boolean hasCompanionInCallServiceAccess() {
- try {
- if (isServiceConnected()) {
- return getTelecomService().hasCompanionInCallServiceAccess(
+ public boolean hasManageOngoingCallsPermission() {
+ ITelecomService service = getTelecomService();
+ if (service != null) {
+ try {
+ return service.hasManageOngoingCallsPermission(
mContext.getOpPackageName());
- }
- } catch (RemoteException e) {
- Log.e(TAG, "RemoteException calling hasCompanionInCallServiceAccess().", e);
- if (!isSystemProcess()) {
- e.rethrowAsRuntimeException();
+ } catch (RemoteException e) {
+ Log.e(TAG, "RemoteException calling hasManageOngoingCallsPermission().", e);
+ if (!isSystemProcess()) {
+ e.rethrowAsRuntimeException();
+ }
}
}
return false;