Loading flags/Android.bp +3 −1 Original line number Diff line number Diff line Loading @@ -28,6 +28,8 @@ aconfig_declarations { "telecom_call_filtering_flags.aconfig", "telecom_incallservice_flags.aconfig", "telecom_default_phone_account_flags.aconfig", "telecom_callaudioroutestatemachine_flags.aconfig" "telecom_callaudioroutestatemachine_flags.aconfig", "telecom_resolve_hidden_dependencies.aconfig" ], } flags/telecom_resolve_hidden_dependencies.aconfig 0 → 100644 +8 −0 Original line number Diff line number Diff line package: "com.android.server.telecom.flags" flag { name: "telecom_resolve_hidden_dependencies" namespace: "android_platform_telecom" description: "Mainland cleanup for hidden dependencies" bug: "b/303440370" } src/com/android/server/telecom/Ringer.java +16 −7 Original line number Diff line number Diff line Loading @@ -186,6 +186,7 @@ public class Ringer { private final InCallController mInCallController; private final VibrationEffectProxy mVibrationEffectProxy; private final boolean mIsHapticPlaybackSupportedByDevice; private final FeatureFlags mFlags; /** * For unit testing purposes only; when set, {@link #startRinging(Call, boolean)} will complete * the future provided by the test using {@link #setBlockOnRingingFuture(CompletableFuture)}. Loading Loading @@ -256,6 +257,7 @@ public class Ringer { mSystemSettingsUtil.isHapticPlaybackSupported(mContext); mAudioManager = mContext.getSystemService(AudioManager.class); mFlags = featureFlags; } @VisibleForTesting Loading Loading @@ -650,7 +652,13 @@ public class Ringer { Log.i(this, "shouldRingForContact: returning computation from DndCallFilter."); return !call.isCallSuppressedByDoNotDisturb(); } final Uri contactUri = call.getHandle(); Uri contactUri = call.getHandle(); if (mFlags.telecomResolveHiddenDependencies()) { if (contactUri == null) { contactUri = Uri.EMPTY; } return mNotificationManager.matchesCallFilter(contactUri); } else { final Bundle peopleExtras = new Bundle(); if (contactUri != null) { ArrayList<Person> personList = new ArrayList<>(); Loading @@ -659,6 +667,7 @@ public class Ringer { } return mNotificationManager.matchesCallFilter(peopleExtras); } } private boolean hasExternalRinger(Call foregroundCall) { Bundle intentExtras = foregroundCall.getIntentExtras(); Loading tests/src/com/android/server/telecom/tests/ComponentContextFixture.java +5 −2 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.server.telecom.tests; import com.android.server.telecom.flags.FeatureFlags; import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.Multimap; Loading Loading @@ -57,6 +58,7 @@ import android.location.CountryDetector; import android.location.LocationManager; import android.media.AudioDeviceInfo; import android.media.AudioManager; import android.net.Uri; import android.os.BugreportManager; import android.os.Bundle; import android.os.DropBoxManager; Loading Loading @@ -627,8 +629,9 @@ public class ComponentContextFixture implements TestFixture<Context> { private TelecomManager mTelecomManager = mock(TelecomManager.class); public ComponentContextFixture() { public ComponentContextFixture(FeatureFlags featureFlags) { MockitoAnnotations.initMocks(this); when(featureFlags.telecomResolveHiddenDependencies()).thenReturn(true); when(mResources.getConfiguration()).thenReturn(mResourceConfiguration); when(mResources.getString(anyInt())).thenReturn(""); when(mResources.getStringArray(anyInt())).thenReturn(new String[0]); Loading Loading @@ -711,7 +714,7 @@ public class ComponentContextFixture implements TestFixture<Context> { } }).when(mAppOpsManager).checkPackage(anyInt(), anyString()); when(mNotificationManager.matchesCallFilter(any(Bundle.class))).thenReturn(true); when(mNotificationManager.matchesCallFilter(any(Uri.class))).thenReturn(true); when(mCarrierConfigManager.getConfig()).thenReturn(new PersistableBundle()); when(mCarrierConfigManager.getConfigForSubId(anyInt())).thenReturn(new PersistableBundle()); Loading tests/src/com/android/server/telecom/tests/MissedInformationTest.java +3 −2 Original line number Diff line number Diff line Loading @@ -109,6 +109,7 @@ public class MissedInformationTest extends TelecomSystemTest { mAdapter = new CallIntentProcessor.AdapterImpl(mCallsManager.getDefaultDialerCache()); mNotificationManager = spy((NotificationManager) mContext.getSystemService( Context.NOTIFICATION_SERVICE)); when(mFeatureFlags.telecomResolveHiddenDependencies()).thenReturn(true); when(mContentResolver.getPackageName()).thenReturn(PACKAGE_NAME); when(mContentResolver.acquireProvider(any(String.class))).thenReturn(mContentProvider); when(mContentProvider.call(any(String.class), any(String.class), Loading Loading @@ -358,7 +359,7 @@ public class MissedInformationTest extends TelecomSystemTest { setUpIncomingCall(); doReturn(mNotificationManager).when(mSpyContext) .getSystemService(Context.NOTIFICATION_SERVICE); doReturn(false).when(mNotificationManager).matchesCallFilter(any(Bundle.class)); doReturn(false).when(mNotificationManager).matchesCallFilter(any(Uri.class)); doReturn(false).when(mIncomingCall).wasDndCheckComputedForCall(); mCallsManager.getRinger().setNotificationManager(mNotificationManager); Loading @@ -369,7 +370,7 @@ public class MissedInformationTest extends TelecomSystemTest { // Wait for ringer attributes build completed verify(mNotificationManager, timeout(TEST_TIMEOUT_MILLIS)) .matchesCallFilter(any(Bundle.class)); .matchesCallFilter(any(Uri.class)); mCallsManager.getRinger().waitForAttributesCompletion(); mCallsManager.markCallAsDisconnected(mIncomingCall, Loading Loading
flags/Android.bp +3 −1 Original line number Diff line number Diff line Loading @@ -28,6 +28,8 @@ aconfig_declarations { "telecom_call_filtering_flags.aconfig", "telecom_incallservice_flags.aconfig", "telecom_default_phone_account_flags.aconfig", "telecom_callaudioroutestatemachine_flags.aconfig" "telecom_callaudioroutestatemachine_flags.aconfig", "telecom_resolve_hidden_dependencies.aconfig" ], }
flags/telecom_resolve_hidden_dependencies.aconfig 0 → 100644 +8 −0 Original line number Diff line number Diff line package: "com.android.server.telecom.flags" flag { name: "telecom_resolve_hidden_dependencies" namespace: "android_platform_telecom" description: "Mainland cleanup for hidden dependencies" bug: "b/303440370" }
src/com/android/server/telecom/Ringer.java +16 −7 Original line number Diff line number Diff line Loading @@ -186,6 +186,7 @@ public class Ringer { private final InCallController mInCallController; private final VibrationEffectProxy mVibrationEffectProxy; private final boolean mIsHapticPlaybackSupportedByDevice; private final FeatureFlags mFlags; /** * For unit testing purposes only; when set, {@link #startRinging(Call, boolean)} will complete * the future provided by the test using {@link #setBlockOnRingingFuture(CompletableFuture)}. Loading Loading @@ -256,6 +257,7 @@ public class Ringer { mSystemSettingsUtil.isHapticPlaybackSupported(mContext); mAudioManager = mContext.getSystemService(AudioManager.class); mFlags = featureFlags; } @VisibleForTesting Loading Loading @@ -650,7 +652,13 @@ public class Ringer { Log.i(this, "shouldRingForContact: returning computation from DndCallFilter."); return !call.isCallSuppressedByDoNotDisturb(); } final Uri contactUri = call.getHandle(); Uri contactUri = call.getHandle(); if (mFlags.telecomResolveHiddenDependencies()) { if (contactUri == null) { contactUri = Uri.EMPTY; } return mNotificationManager.matchesCallFilter(contactUri); } else { final Bundle peopleExtras = new Bundle(); if (contactUri != null) { ArrayList<Person> personList = new ArrayList<>(); Loading @@ -659,6 +667,7 @@ public class Ringer { } return mNotificationManager.matchesCallFilter(peopleExtras); } } private boolean hasExternalRinger(Call foregroundCall) { Bundle intentExtras = foregroundCall.getIntentExtras(); Loading
tests/src/com/android/server/telecom/tests/ComponentContextFixture.java +5 −2 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.server.telecom.tests; import com.android.server.telecom.flags.FeatureFlags; import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.Multimap; Loading Loading @@ -57,6 +58,7 @@ import android.location.CountryDetector; import android.location.LocationManager; import android.media.AudioDeviceInfo; import android.media.AudioManager; import android.net.Uri; import android.os.BugreportManager; import android.os.Bundle; import android.os.DropBoxManager; Loading Loading @@ -627,8 +629,9 @@ public class ComponentContextFixture implements TestFixture<Context> { private TelecomManager mTelecomManager = mock(TelecomManager.class); public ComponentContextFixture() { public ComponentContextFixture(FeatureFlags featureFlags) { MockitoAnnotations.initMocks(this); when(featureFlags.telecomResolveHiddenDependencies()).thenReturn(true); when(mResources.getConfiguration()).thenReturn(mResourceConfiguration); when(mResources.getString(anyInt())).thenReturn(""); when(mResources.getStringArray(anyInt())).thenReturn(new String[0]); Loading Loading @@ -711,7 +714,7 @@ public class ComponentContextFixture implements TestFixture<Context> { } }).when(mAppOpsManager).checkPackage(anyInt(), anyString()); when(mNotificationManager.matchesCallFilter(any(Bundle.class))).thenReturn(true); when(mNotificationManager.matchesCallFilter(any(Uri.class))).thenReturn(true); when(mCarrierConfigManager.getConfig()).thenReturn(new PersistableBundle()); when(mCarrierConfigManager.getConfigForSubId(anyInt())).thenReturn(new PersistableBundle()); Loading
tests/src/com/android/server/telecom/tests/MissedInformationTest.java +3 −2 Original line number Diff line number Diff line Loading @@ -109,6 +109,7 @@ public class MissedInformationTest extends TelecomSystemTest { mAdapter = new CallIntentProcessor.AdapterImpl(mCallsManager.getDefaultDialerCache()); mNotificationManager = spy((NotificationManager) mContext.getSystemService( Context.NOTIFICATION_SERVICE)); when(mFeatureFlags.telecomResolveHiddenDependencies()).thenReturn(true); when(mContentResolver.getPackageName()).thenReturn(PACKAGE_NAME); when(mContentResolver.acquireProvider(any(String.class))).thenReturn(mContentProvider); when(mContentProvider.call(any(String.class), any(String.class), Loading Loading @@ -358,7 +359,7 @@ public class MissedInformationTest extends TelecomSystemTest { setUpIncomingCall(); doReturn(mNotificationManager).when(mSpyContext) .getSystemService(Context.NOTIFICATION_SERVICE); doReturn(false).when(mNotificationManager).matchesCallFilter(any(Bundle.class)); doReturn(false).when(mNotificationManager).matchesCallFilter(any(Uri.class)); doReturn(false).when(mIncomingCall).wasDndCheckComputedForCall(); mCallsManager.getRinger().setNotificationManager(mNotificationManager); Loading @@ -369,7 +370,7 @@ public class MissedInformationTest extends TelecomSystemTest { // Wait for ringer attributes build completed verify(mNotificationManager, timeout(TEST_TIMEOUT_MILLIS)) .matchesCallFilter(any(Bundle.class)); .matchesCallFilter(any(Uri.class)); mCallsManager.getRinger().waitForAttributesCompletion(); mCallsManager.markCallAsDisconnected(mIncomingCall, Loading