Loading src/com/android/server/telecom/InCallController.java +12 −9 Original line number Diff line number Diff line Loading @@ -1246,7 +1246,8 @@ public class InCallController extends CallsManagerListenerBase { serviceInfo.metaData.getBoolean( TelecomManager.METADATA_INCLUDE_SELF_MANAGED_CALLS, false); int currentType = getInCallServiceType(entry.serviceInfo, packageManager); int currentType = getInCallServiceType(entry.serviceInfo, packageManager, packageName); if (requestedType == 0 || requestedType == currentType) { if (requestedType == IN_CALL_SERVICE_TYPE_NON_UI) { // We enforce the rule that self-managed calls are not supported by non-ui Loading @@ -1270,7 +1271,8 @@ public class InCallController extends CallsManagerListenerBase { /** * Returns the type of InCallService described by the specified serviceInfo. */ private int getInCallServiceType(ServiceInfo serviceInfo, PackageManager packageManager) { private int getInCallServiceType(ServiceInfo serviceInfo, PackageManager packageManager, String packageName) { // Verify that the InCallService requires the BIND_INCALL_SERVICE permission which // enforces that only Telecom can bind to it. boolean hasServiceBindPermission = serviceInfo.permission != null && Loading @@ -1288,12 +1290,12 @@ public class InCallController extends CallsManagerListenerBase { } // Check to see if the service holds permissions or metadata for third party apps. boolean hasInCallServiceUIMetadata = serviceInfo.metaData != null && serviceInfo.metaData.containsKey(TelecomManager.METADATA_IN_CALL_SERVICE_UI); boolean isUIService = serviceInfo.metaData != null && serviceInfo.metaData.getBoolean(TelecomManager.METADATA_IN_CALL_SERVICE_UI); boolean isThirdPartyCompanionApp = packageManager.checkPermission( Manifest.permission.CALL_COMPANION_APP, serviceInfo.packageName) == PackageManager.PERMISSION_GRANTED && !hasInCallServiceUIMetadata; !isUIService; // Check to see if the service is a car-mode UI type by checking that it has the // CONTROL_INCALL_EXPERIENCE (to verify it is a system app) and that it has the Loading @@ -1306,16 +1308,17 @@ public class InCallController extends CallsManagerListenerBase { TelecomManager.METADATA_IN_CALL_SERVICE_CAR_MODE_UI, false) && (hasControlInCallPermission || isThirdPartyCompanionApp); if (isCarModeUIService) { // ThirdPartyInCallService shouldn't be used when role manager hasn't assigned any car // mode role holders, i.e. packageName is null. if (isUIService || (isThirdPartyCompanionApp && packageName != null)) { return IN_CALL_SERVICE_TYPE_CAR_MODE_UI; } } // Check to see that it is the default dialer package boolean isDefaultDialerPackage = Objects.equals(serviceInfo.packageName, mDefaultDialerCache.getDefaultDialerApplication( mCallsManager.getCurrentUserHandle().getIdentifier())); boolean isUIService = serviceInfo.metaData != null && serviceInfo.metaData.getBoolean( TelecomManager.METADATA_IN_CALL_SERVICE_UI, false); if (isDefaultDialerPackage && isUIService) { return IN_CALL_SERVICE_TYPE_DIALER_UI; } Loading src/com/android/server/telecom/RoleManagerAdapterImpl.java +4 −8 Original line number Diff line number Diff line Loading @@ -26,15 +26,11 @@ import java.util.List; import java.util.stream.Collectors; public class RoleManagerAdapterImpl implements RoleManagerAdapter { // TODO: replace with actual role manager const. private static final String ROLE_CALL_REDIRECTION_APP = "android.app.role.PROXY_CALLING_APP"; // TODO: replace with actual role manager const. private static final String ROLE_CAR_MODE_DIALER = "android.app.role.ROLE_CAR_MODE_DIALER"; // TODO: replace with actual role manager const. private static final String ROLE_CAR_MODE_DIALER = "android.app.role.CAR_MODE_DIALER_APP"; private static final String ROLE_CALL_SCREENING = "android.app.role.CALL_SCREENING_APP"; // TODO: replace with actual role manager const. private static final String ROLE_CALL_COMPANION_APP = "android.app.role.ROLE_CALL_COMPANION_APP"; "android.app.role.CALL_COMPANION_APP"; private String mOverrideDefaultCallRedirectionApp = null; private String mOverrideDefaultCallScreeningApp = null; Loading Loading @@ -152,7 +148,7 @@ public class RoleManagerAdapterImpl implements RoleManagerAdapter { pw.println(); pw.print("DefaultCarModeDialerApp: "); if (mOverrideDefaultCallScreeningApp != null) { if (mOverrideDefaultCarModeApp != null) { pw.print("(override "); pw.print(mOverrideDefaultCarModeApp); pw.print(") "); Loading @@ -161,7 +157,7 @@ public class RoleManagerAdapterImpl implements RoleManagerAdapter { pw.println(); pw.print("DefaultCallCompanionApps: "); if (mOverrideDefaultCallScreeningApp != null) { if (mOverrideCallCompanionApps != null) { pw.print("(override "); pw.print(mOverrideCallCompanionApps.stream().collect(Collectors.joining(", "))); pw.print(") "); Loading Loading
src/com/android/server/telecom/InCallController.java +12 −9 Original line number Diff line number Diff line Loading @@ -1246,7 +1246,8 @@ public class InCallController extends CallsManagerListenerBase { serviceInfo.metaData.getBoolean( TelecomManager.METADATA_INCLUDE_SELF_MANAGED_CALLS, false); int currentType = getInCallServiceType(entry.serviceInfo, packageManager); int currentType = getInCallServiceType(entry.serviceInfo, packageManager, packageName); if (requestedType == 0 || requestedType == currentType) { if (requestedType == IN_CALL_SERVICE_TYPE_NON_UI) { // We enforce the rule that self-managed calls are not supported by non-ui Loading @@ -1270,7 +1271,8 @@ public class InCallController extends CallsManagerListenerBase { /** * Returns the type of InCallService described by the specified serviceInfo. */ private int getInCallServiceType(ServiceInfo serviceInfo, PackageManager packageManager) { private int getInCallServiceType(ServiceInfo serviceInfo, PackageManager packageManager, String packageName) { // Verify that the InCallService requires the BIND_INCALL_SERVICE permission which // enforces that only Telecom can bind to it. boolean hasServiceBindPermission = serviceInfo.permission != null && Loading @@ -1288,12 +1290,12 @@ public class InCallController extends CallsManagerListenerBase { } // Check to see if the service holds permissions or metadata for third party apps. boolean hasInCallServiceUIMetadata = serviceInfo.metaData != null && serviceInfo.metaData.containsKey(TelecomManager.METADATA_IN_CALL_SERVICE_UI); boolean isUIService = serviceInfo.metaData != null && serviceInfo.metaData.getBoolean(TelecomManager.METADATA_IN_CALL_SERVICE_UI); boolean isThirdPartyCompanionApp = packageManager.checkPermission( Manifest.permission.CALL_COMPANION_APP, serviceInfo.packageName) == PackageManager.PERMISSION_GRANTED && !hasInCallServiceUIMetadata; !isUIService; // Check to see if the service is a car-mode UI type by checking that it has the // CONTROL_INCALL_EXPERIENCE (to verify it is a system app) and that it has the Loading @@ -1306,16 +1308,17 @@ public class InCallController extends CallsManagerListenerBase { TelecomManager.METADATA_IN_CALL_SERVICE_CAR_MODE_UI, false) && (hasControlInCallPermission || isThirdPartyCompanionApp); if (isCarModeUIService) { // ThirdPartyInCallService shouldn't be used when role manager hasn't assigned any car // mode role holders, i.e. packageName is null. if (isUIService || (isThirdPartyCompanionApp && packageName != null)) { return IN_CALL_SERVICE_TYPE_CAR_MODE_UI; } } // Check to see that it is the default dialer package boolean isDefaultDialerPackage = Objects.equals(serviceInfo.packageName, mDefaultDialerCache.getDefaultDialerApplication( mCallsManager.getCurrentUserHandle().getIdentifier())); boolean isUIService = serviceInfo.metaData != null && serviceInfo.metaData.getBoolean( TelecomManager.METADATA_IN_CALL_SERVICE_UI, false); if (isDefaultDialerPackage && isUIService) { return IN_CALL_SERVICE_TYPE_DIALER_UI; } Loading
src/com/android/server/telecom/RoleManagerAdapterImpl.java +4 −8 Original line number Diff line number Diff line Loading @@ -26,15 +26,11 @@ import java.util.List; import java.util.stream.Collectors; public class RoleManagerAdapterImpl implements RoleManagerAdapter { // TODO: replace with actual role manager const. private static final String ROLE_CALL_REDIRECTION_APP = "android.app.role.PROXY_CALLING_APP"; // TODO: replace with actual role manager const. private static final String ROLE_CAR_MODE_DIALER = "android.app.role.ROLE_CAR_MODE_DIALER"; // TODO: replace with actual role manager const. private static final String ROLE_CAR_MODE_DIALER = "android.app.role.CAR_MODE_DIALER_APP"; private static final String ROLE_CALL_SCREENING = "android.app.role.CALL_SCREENING_APP"; // TODO: replace with actual role manager const. private static final String ROLE_CALL_COMPANION_APP = "android.app.role.ROLE_CALL_COMPANION_APP"; "android.app.role.CALL_COMPANION_APP"; private String mOverrideDefaultCallRedirectionApp = null; private String mOverrideDefaultCallScreeningApp = null; Loading Loading @@ -152,7 +148,7 @@ public class RoleManagerAdapterImpl implements RoleManagerAdapter { pw.println(); pw.print("DefaultCarModeDialerApp: "); if (mOverrideDefaultCallScreeningApp != null) { if (mOverrideDefaultCarModeApp != null) { pw.print("(override "); pw.print(mOverrideDefaultCarModeApp); pw.print(") "); Loading @@ -161,7 +157,7 @@ public class RoleManagerAdapterImpl implements RoleManagerAdapter { pw.println(); pw.print("DefaultCallCompanionApps: "); if (mOverrideDefaultCallScreeningApp != null) { if (mOverrideCallCompanionApps != null) { pw.print("(override "); pw.print(mOverrideCallCompanionApps.stream().collect(Collectors.joining(", "))); pw.print(") "); Loading