Add call log uri for marking missed calls as read when dialer apps get
notification on reboot.
Test: N/A
Bug: 292597423
Change-Id: I39b4b1cbd3d6626e4a70b7d15b31584adbbc0955
diff --git a/flags/telecom_api_flags.aconfig b/flags/telecom_api_flags.aconfig
index cbad597..74cb447 100644
--- a/flags/telecom_api_flags.aconfig
+++ b/flags/telecom_api_flags.aconfig
@@ -20,3 +20,10 @@
description: "When set, Telecom will auto-unbind if a ConnectionService returns no connections after some time."
bug: "293458004"
}
+
+flag{
+ name: "add_call_uri_for_missed_calls"
+ namespace: "telecom"
+ description: "The key is used for dialer apps to mark missed calls as read when it gets the notification on reboot."
+ bug: "292597423"
+}
diff --git a/src/com/android/server/telecom/CallLogManager.java b/src/com/android/server/telecom/CallLogManager.java
index fcb7778..cfa2eb4 100644
--- a/src/com/android/server/telecom/CallLogManager.java
+++ b/src/com/android/server/telecom/CallLogManager.java
@@ -263,8 +263,13 @@
logCall(call, type, new LogCallCompletedListener() {
@Override
public void onLogCompleted(@Nullable Uri uri) {
- mMissedCallNotifier.showMissedCallNotification(
- new MissedCallNotifier.CallInfo(call));
+ if (mFeatureFlags.addCallUriForMissedCalls()){
+ mMissedCallNotifier.showMissedCallNotification(
+ new MissedCallNotifier.CallInfo(call), uri);
+ } else {
+ mMissedCallNotifier.showMissedCallNotification(
+ new MissedCallNotifier.CallInfo(call), /* uri= */ null);
+ }
}
}, result);
} else {
diff --git a/src/com/android/server/telecom/CallsManager.java b/src/com/android/server/telecom/CallsManager.java
index 57a745d..0864c22 100755
--- a/src/com/android/server/telecom/CallsManager.java
+++ b/src/com/android/server/telecom/CallsManager.java
@@ -1021,7 +1021,7 @@
if (result.shouldShowNotification) {
Log.i(this, "onCallScreeningCompleted: blocked call, showing notification.");
mMissedCallNotifier.showMissedCallNotification(
- new MissedCallNotifier.CallInfo(incomingCall));
+ new MissedCallNotifier.CallInfo(incomingCall), /* uri= */ null);
}
}
}
diff --git a/src/com/android/server/telecom/MissedCallNotifier.java b/src/com/android/server/telecom/MissedCallNotifier.java
index 0e5a287..b0a7c8e 100644
--- a/src/com/android/server/telecom/MissedCallNotifier.java
+++ b/src/com/android/server/telecom/MissedCallNotifier.java
@@ -16,6 +16,7 @@
package com.android.server.telecom;
+import android.annotation.Nullable;
import android.net.Uri;
import android.os.UserHandle;
import android.telecom.PhoneAccountHandle;
@@ -85,7 +86,7 @@
void clearMissedCalls(UserHandle userHandle);
- void showMissedCallNotification(CallInfo call);
+ void showMissedCallNotification(CallInfo call, @Nullable Uri uri);
void reloadAfterBootComplete(CallerInfoLookupHelper callerInfoLookupHelper,
CallInfoFactory callInfoFactory);
diff --git a/src/com/android/server/telecom/TelecomSystem.java b/src/com/android/server/telecom/TelecomSystem.java
index 76777da..63edf9c 100644
--- a/src/com/android/server/telecom/TelecomSystem.java
+++ b/src/com/android/server/telecom/TelecomSystem.java
@@ -274,7 +274,8 @@
mMissedCallNotifier = missedCallNotifierImplFactory
.makeMissedCallNotifierImpl(mContext, mPhoneAccountRegistrar,
defaultDialerCache,
- deviceIdleControllerAdapter);
+ deviceIdleControllerAdapter,
+ featureFlags);
DisconnectedCallNotifier.Factory disconnectedCallNotifierFactory =
new DisconnectedCallNotifier.Default();
diff --git a/src/com/android/server/telecom/components/TelecomService.java b/src/com/android/server/telecom/components/TelecomService.java
index 9a5f2a7..9287d33 100644
--- a/src/com/android/server/telecom/components/TelecomService.java
+++ b/src/com/android/server/telecom/components/TelecomService.java
@@ -45,6 +45,7 @@
import com.android.server.telecom.ContactsAsyncHelper;
import com.android.server.telecom.DefaultDialerCache;
import com.android.server.telecom.DeviceIdleControllerAdapter;
+import com.android.server.telecom.flags.FeatureFlags;
import com.android.server.telecom.HeadsetMediaButton;
import com.android.server.telecom.HeadsetMediaButtonFactory;
import com.android.server.telecom.InCallWakeLockControllerFactory;
@@ -116,10 +117,11 @@
Context context,
PhoneAccountRegistrar phoneAccountRegistrar,
DefaultDialerCache defaultDialerCache,
- DeviceIdleControllerAdapter idleControllerAdapter) {
+ DeviceIdleControllerAdapter idleControllerAdapter,
+ FeatureFlags featureFlags) {
return new MissedCallNotifierImpl(context,
phoneAccountRegistrar, defaultDialerCache,
- idleControllerAdapter);
+ idleControllerAdapter, featureFlags);
}
},
new CallerInfoAsyncQueryFactory() {
diff --git a/src/com/android/server/telecom/ui/MissedCallNotifierImpl.java b/src/com/android/server/telecom/ui/MissedCallNotifierImpl.java
index 6b97f97..25ce0ca 100644
--- a/src/com/android/server/telecom/ui/MissedCallNotifierImpl.java
+++ b/src/com/android/server/telecom/ui/MissedCallNotifierImpl.java
@@ -20,6 +20,7 @@
import static android.app.admin.DevicePolicyResources.Strings.Telecomm.NOTIFICATION_MISSED_WORK_CALL_TITLE;
import android.annotation.NonNull;
+import android.annotation.Nullable;
import android.app.BroadcastOptions;
import android.app.Notification;
import android.app.NotificationManager;
@@ -42,6 +43,7 @@
import android.os.Binder;
import android.os.Bundle;
import android.os.UserHandle;
+import android.provider.CallLog;
import android.provider.CallLog.Calls;
import android.telecom.CallerInfo;
import android.telecom.Log;
@@ -62,6 +64,7 @@
import com.android.server.telecom.Constants;
import com.android.server.telecom.DefaultDialerCache;
import com.android.server.telecom.DeviceIdleControllerAdapter;
+import com.android.server.telecom.flags.FeatureFlags;
import com.android.server.telecom.MissedCallNotifier;
import com.android.server.telecom.PhoneAccountRegistrar;
import com.android.server.telecom.R;
@@ -87,7 +90,8 @@
MissedCallNotifier makeMissedCallNotifierImpl(Context context,
PhoneAccountRegistrar phoneAccountRegistrar,
DefaultDialerCache defaultDialerCache,
- DeviceIdleControllerAdapter deviceIdleControllerAdapter);
+ DeviceIdleControllerAdapter deviceIdleControllerAdapter,
+ FeatureFlags featureFlags);
}
public interface NotificationBuilderFactory {
@@ -141,19 +145,22 @@
private final Map<UserHandle, Integer> mMissedCallCounts;
private Set<UserHandle> mUsersToLoadAfterBootComplete = new ArraySet<>();
+ private FeatureFlags mFeatureFlags;
public MissedCallNotifierImpl(Context context, PhoneAccountRegistrar phoneAccountRegistrar,
DefaultDialerCache defaultDialerCache,
- DeviceIdleControllerAdapter deviceIdleControllerAdapter) {
+ DeviceIdleControllerAdapter deviceIdleControllerAdapter,
+ FeatureFlags featureFlags) {
this(context, phoneAccountRegistrar, defaultDialerCache,
- new DefaultNotificationBuilderFactory(), deviceIdleControllerAdapter);
+ new DefaultNotificationBuilderFactory(), deviceIdleControllerAdapter, featureFlags);
}
public MissedCallNotifierImpl(Context context,
PhoneAccountRegistrar phoneAccountRegistrar,
DefaultDialerCache defaultDialerCache,
NotificationBuilderFactory notificationBuilderFactory,
- DeviceIdleControllerAdapter deviceIdleControllerAdapter) {
+ DeviceIdleControllerAdapter deviceIdleControllerAdapter,
+ FeatureFlags featureFlags) {
mContext = context;
mPhoneAccountRegistrar = phoneAccountRegistrar;
mNotificationManager =
@@ -163,6 +170,7 @@
mNotificationBuilderFactory = notificationBuilderFactory;
mMissedCallCounts = new ArrayMap<>();
+ mFeatureFlags = featureFlags;
}
/** Clears missed call notification and marks the call log's missed calls as read. */
@@ -261,17 +269,17 @@
}
private void sendNotificationThroughDefaultDialer(String dialerPackage, CallInfo callInfo,
- UserHandle userHandle, int missedCallCount) {
+ UserHandle userHandle, int missedCallCount, @Nullable Uri uri) {
Intent intent = getShowMissedCallIntentForDefaultDialer(dialerPackage)
.setFlags(Intent.FLAG_RECEIVER_FOREGROUND)
.putExtra(TelecomManager.EXTRA_CLEAR_MISSED_CALLS_INTENT,
createClearMissedCallsPendingIntent(userHandle))
.putExtra(TelecomManager.EXTRA_NOTIFICATION_COUNT, missedCallCount)
+ .putExtra(TelecomManager.EXTRA_CALL_LOG_URI, uri)
.putExtra(TelecomManager.EXTRA_NOTIFICATION_PHONE_NUMBER,
callInfo == null ? null : callInfo.getPhoneNumber())
.putExtra(TelecomManager.EXTRA_PHONE_ACCOUNT_HANDLE,
callInfo == null ? null : callInfo.getPhoneAccountHandle());
-
if (missedCallCount == 1 && callInfo != null) {
final Uri handleUri = callInfo.getHandle();
String handle = handleUri == null ? null : handleUri.getSchemeSpecificPart();
@@ -295,7 +303,7 @@
* @param callInfo The missed call.
*/
@Override
- public void showMissedCallNotification(@NonNull CallInfo callInfo) {
+ public void showMissedCallNotification(@NonNull CallInfo callInfo, @Nullable Uri uri) {
final PhoneAccountHandle phoneAccountHandle = callInfo.getPhoneAccountHandle();
final PhoneAccount phoneAccount =
mPhoneAccountRegistrar.getPhoneAccountUnchecked(phoneAccountHandle);
@@ -306,10 +314,11 @@
} else {
userHandle = phoneAccountHandle.getUserHandle();
}
- showMissedCallNotification(callInfo, userHandle);
+ showMissedCallNotification(callInfo, userHandle, uri);
}
- private void showMissedCallNotification(@NonNull CallInfo callInfo, UserHandle userHandle) {
+ private void showMissedCallNotification(@NonNull CallInfo callInfo, UserHandle userHandle,
+ @Nullable Uri uri) {
int missedCallCounts;
synchronized (mMissedCallCountsLock) {
Integer currentCount = mMissedCallCounts.get(userHandle);
@@ -324,7 +333,7 @@
String dialerPackage = getDefaultDialerPackage(userHandle);
if (shouldManageNotificationThroughDefaultDialer(dialerPackage, userHandle)) {
sendNotificationThroughDefaultDialer(dialerPackage, callInfo, userHandle,
- missedCallCounts);
+ missedCallCounts, uri);
return;
}
@@ -446,7 +455,7 @@
String dialerPackage = getDefaultDialerPackage(userHandle);
if (shouldManageNotificationThroughDefaultDialer(dialerPackage, userHandle)) {
sendNotificationThroughDefaultDialer(dialerPackage, null, userHandle,
- 0 /* missedCallCount */);
+ /* missedCallCount= */ 0, /* uri= */ null);
return;
}
@@ -631,6 +640,13 @@
while (cursor.moveToNext()) {
// Get data about the missed call from the cursor
final String handleString = cursor.getString(CALL_LOG_COLUMN_NUMBER);
+ final Uri uri;
+ if (mFeatureFlags.addCallUriForMissedCalls()){
+ uri = Calls.CONTENT_URI.buildUpon().appendPath(
+ Long.toString(cursor.getInt(CALL_LOG_COLUMN_ID))).build();
+ }else{
+ uri = null;
+ }
final int presentation =
cursor.getInt(CALL_LOG_COLUMN_NUMBER_PRESENTATION);
final long date = cursor.getLong(CALL_LOG_COLUMN_DATE);
@@ -663,7 +679,8 @@
// null, just show the notification.
CallInfo callInfo = callInfoFactory.makeCallInfo(
info, null, handle, date);
- showMissedCallNotification(callInfo, userHandle);
+ showMissedCallNotification(callInfo, userHandle,
+ /* uri= */ uri);
}
}
@@ -678,7 +695,8 @@
}
CallInfo callInfo = callInfoFactory.makeCallInfo(
info, null, handle, date);
- showMissedCallNotification(callInfo, userHandle);
+ showMissedCallNotification(callInfo, userHandle,
+ /* uri= */ uri);
}
}
);
diff --git a/tests/src/com/android/server/telecom/tests/CallLogManagerTest.java b/tests/src/com/android/server/telecom/tests/CallLogManagerTest.java
index 94709cd..83d1043 100644
--- a/tests/src/com/android/server/telecom/tests/CallLogManagerTest.java
+++ b/tests/src/com/android/server/telecom/tests/CallLogManagerTest.java
@@ -23,6 +23,7 @@
import static org.junit.Assert.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.ArgumentMatchers.nullable;
import static org.mockito.Mockito.atLeast;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.mock;
@@ -368,6 +369,7 @@
VIA_NUMBER_STRING, // viaNumber
null
);
+ when(mFeatureFlags.addCallUriForMissedCalls()).thenReturn(true);
mCallLogManager.onCallStateChanged(fakeIncomingCall, CallState.ACTIVE,
CallState.DISCONNECTED);
ContentValues insertedValues = verifyInsertionWithCapture(CURRENT_USER_ID);
@@ -377,7 +379,7 @@
@MediumTest
@Test
- public void testLogCallDirectionMissed() {
+ public void testLogCallDirectionMissedAddCallUriForMissedCallsFlagOff() {
when(mMockPhoneAccountRegistrar.getPhoneAccountUnchecked(any(PhoneAccountHandle.class)))
.thenReturn(makeFakePhoneAccount(mDefaultAccountHandle, CURRENT_USER_ID));
Call fakeMissedCall = makeFakeCall(
@@ -393,6 +395,7 @@
VIA_NUMBER_STRING, // viaNumber
null
);
+ when(mFeatureFlags.addCallUriForMissedCalls()).thenReturn(false);
mCallLogManager.onCallStateChanged(fakeMissedCall, CallState.ACTIVE,
CallState.DISCONNECTED);
@@ -401,7 +404,39 @@
Integer.valueOf(CallLog.Calls.MISSED_TYPE));
// Timeout needed because showMissedCallNotification is called from onPostExecute.
verify(mMissedCallNotifier, timeout(TEST_TIMEOUT_MILLIS))
- .showMissedCallNotification(any(MissedCallNotifier.CallInfo.class));
+ .showMissedCallNotification(any(MissedCallNotifier.CallInfo.class),
+ /* uri= */ eq(null));
+ }
+
+ @MediumTest
+ @Test
+ public void testLogCallDirectionMissedAddCallUriForMissedCallsFlagOn() {
+ when(mMockPhoneAccountRegistrar.getPhoneAccountUnchecked(any(PhoneAccountHandle.class)))
+ .thenReturn(makeFakePhoneAccount(mDefaultAccountHandle, CURRENT_USER_ID));
+ Call fakeMissedCall = makeFakeCall(
+ DisconnectCause.MISSED, // disconnectCauseCode
+ false, // isConference
+ true, // isIncoming
+ 1L, // creationTimeMillis
+ 1000L, // ageMillis
+ TEL_PHONEHANDLE, // callHandle
+ mDefaultAccountHandle, // phoneAccountHandle
+ NO_VIDEO_STATE, // callVideoState
+ POST_DIAL_STRING, // postDialDigits
+ VIA_NUMBER_STRING, // viaNumber
+ null
+ );
+ when(mFeatureFlags.addCallUriForMissedCalls()).thenReturn(true);
+
+ mCallLogManager.onCallStateChanged(fakeMissedCall, CallState.ACTIVE,
+ CallState.DISCONNECTED);
+ ContentValues insertedValues = verifyInsertionWithCapture(CURRENT_USER_ID);
+ assertEquals(insertedValues.getAsInteger(CallLog.Calls.TYPE),
+ Integer.valueOf(CallLog.Calls.MISSED_TYPE));
+ // Timeout needed because showMissedCallNotification is called from onPostExecute.
+ verify(mMissedCallNotifier, timeout(TEST_TIMEOUT_MILLIS))
+ .showMissedCallNotification(any(MissedCallNotifier.CallInfo.class),
+ /* uri= */ any(Uri.class));
}
@MediumTest
diff --git a/tests/src/com/android/server/telecom/tests/CallsManagerTest.java b/tests/src/com/android/server/telecom/tests/CallsManagerTest.java
index 23b1360..36488b5 100644
--- a/tests/src/com/android/server/telecom/tests/CallsManagerTest.java
+++ b/tests/src/com/android/server/telecom/tests/CallsManagerTest.java
@@ -2449,7 +2449,7 @@
mCallsManager.onCallFilteringComplete(callSpy, result, false /* timeout */);
verify(mMissedCallNotifier).showMissedCallNotification(
- any(MissedCallNotifier.CallInfo.class));
+ any(MissedCallNotifier.CallInfo.class), /* uri= */ eq(null));
}
@Test
diff --git a/tests/src/com/android/server/telecom/tests/MissedCallNotifierImplTest.java b/tests/src/com/android/server/telecom/tests/MissedCallNotifierImplTest.java
index 2b05430..ac2f1f1 100644
--- a/tests/src/com/android/server/telecom/tests/MissedCallNotifierImplTest.java
+++ b/tests/src/com/android/server/telecom/tests/MissedCallNotifierImplTest.java
@@ -16,6 +16,8 @@
package com.android.server.telecom.tests;
+import static com.android.server.telecom.ui.MissedCallNotifierImpl.CALL_LOG_COLUMN_ID;
+
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertTrue;
@@ -46,10 +48,14 @@
import android.test.suitebuilder.annotation.SmallTest;
import android.telecom.CallerInfo;
+
+import com.android.server.telecom.CallLogManager;
import com.android.server.telecom.CallerInfoLookupHelper;
+import com.android.server.telecom.CallsManager;
import com.android.server.telecom.Constants;
import com.android.server.telecom.DefaultDialerCache;
import com.android.server.telecom.DeviceIdleControllerAdapter;
+import com.android.server.telecom.flags.FeatureFlags;
import com.android.server.telecom.MissedCallNotifier;
import com.android.server.telecom.PhoneAccountRegistrar;
import com.android.server.telecom.TelecomBroadcastIntentProcessor;
@@ -241,7 +247,7 @@
MissedCallNotifier.CallInfo fakeCall = makeFakeCallInfo(TEL_CALL_HANDLE, CALLER_NAME,
CALL_TIMESTAMP, phoneAccount.getAccountHandle());
- missedCallNotifier.showMissedCallNotification(fakeCall);
+ missedCallNotifier.showMissedCallNotification(fakeCall, /* uri= */ null);
ArgumentCaptor<Intent> intentArgumentCaptor = ArgumentCaptor.forClass(Intent.class);
verify(mContext).sendBroadcastAsUser(intentArgumentCaptor.capture(), any(),
anyString(), any());
@@ -250,6 +256,31 @@
assertEquals(1, sentIntent.getIntExtra(TelecomManager.EXTRA_NOTIFICATION_COUNT, -1));
}
+ @SmallTest
+ @Test
+ public void testCallLogUriSentToNotifier(){
+ MissedCallNotifier missedCallNotifier = setupMissedCallNotificationThroughDefaultDialer();
+ PhoneAccount phoneAccount = makePhoneAccount(PRIMARY_USER, NO_CAPABILITY);
+ Cursor mockMissedCallsCursor = new MockMissedCallCursorBuilder()
+ .addEntry(TEL_CALL_HANDLE.getSchemeSpecificPart(),
+ CallLog.Calls.PRESENTATION_ALLOWED, CALL_TIMESTAMP)
+ .build();
+ MissedCallNotifier.CallInfo fakeCall = makeFakeCallInfo(TEL_CALL_HANDLE, CALLER_NAME,
+ CALL_TIMESTAMP, phoneAccount.getAccountHandle());
+ when(mFeatureFlags.addCallUriForMissedCalls()).thenReturn(true);
+
+ missedCallNotifier.showMissedCallNotification(fakeCall,
+ CallLog.Calls.CONTENT_URI.buildUpon().appendPath(Long.toString(
+ mockMissedCallsCursor.getInt(CALL_LOG_COLUMN_ID))).build());
+ ArgumentCaptor<Intent> intentArgumentCaptor = ArgumentCaptor.forClass(Intent.class);
+ verify(mContext).sendBroadcastAsUser(intentArgumentCaptor.capture(), any(),
+ anyString(), any());
+
+ Intent sentIntent = intentArgumentCaptor.getValue();
+ Uri actualCallUri = sentIntent.getParcelableExtra(TelecomManager.EXTRA_CALL_LOG_URI);
+ assertTrue(actualCallUri.isPathPrefixMatch(CallLog.Calls.CONTENT_URI));
+ }
+
private MissedCallNotifier setupMissedCallNotificationThroughDefaultDialer() {
mComponentContextFixture.addIntentReceiver(
TelecomManager.ACTION_SHOW_MISSED_CALLS_NOTIFICATION, COMPONENT_NAME);
@@ -275,9 +306,9 @@
MissedCallNotifier.CallInfo fakeCall = makeFakeCallInfo(TEL_CALL_HANDLE, CALLER_NAME,
CALL_TIMESTAMP, phoneAccount.getAccountHandle());
- missedCallNotifier.showMissedCallNotification(fakeCall);
+ missedCallNotifier.showMissedCallNotification(fakeCall, /* uri= */null);
missedCallNotifier.clearMissedCalls(userHandle);
- missedCallNotifier.showMissedCallNotification(fakeCall);
+ missedCallNotifier.showMissedCallNotification(fakeCall, /* uri= */null);
ArgumentCaptor<Integer> requestIdCaptor = ArgumentCaptor.forClass(
Integer.class);
@@ -308,10 +339,10 @@
MissedCallNotifier missedCallNotifier = new MissedCallNotifierImpl(mContext,
mPhoneAccountRegistrar, mDefaultDialerCache, fakeBuilderFactory,
- mDeviceIdleControllerAdapter);
+ mDeviceIdleControllerAdapter, mFeatureFlags);
- missedCallNotifier.showMissedCallNotification(fakeCall);
- missedCallNotifier.showMissedCallNotification(fakeCall);
+ missedCallNotifier.showMissedCallNotification(fakeCall, /* uri= */ null);
+ missedCallNotifier.showMissedCallNotification(fakeCall, /* uri= */ null);
// The following captor is to capture the two notifications that got passed into
// notifyAsUser. This distinguishes between the builders used for the full notification
@@ -402,7 +433,7 @@
MissedCallNotifier.CallInfo fakeCall = makeFakeCallInfo(TEL_CALL_HANDLE, CALLER_NAME,
CALL_TIMESTAMP, phoneAccount.getAccountHandle());
- missedCallNotifier.showMissedCallNotification(fakeCall);
+ missedCallNotifier.showMissedCallNotification(fakeCall, /* uri= */ null);
ArgumentCaptor<Notification> notificationArgumentCaptor = ArgumentCaptor.forClass(
Notification.class);
@@ -464,13 +495,13 @@
MissedCallNotifier missedCallNotifier = new MissedCallNotifierImpl(mContext,
mPhoneAccountRegistrar, mDefaultDialerCache, fakeBuilderFactory,
- mDeviceIdleControllerAdapter);
+ mDeviceIdleControllerAdapter, mFeatureFlags);
PhoneAccount phoneAccount = makePhoneAccount(PRIMARY_USER, NO_CAPABILITY);
MissedCallNotifier.CallInfo fakeCall =
makeFakeCallInfo(SIP_CALL_HANDLE, CALLER_NAME, CALL_TIMESTAMP,
phoneAccount.getAccountHandle());
- missedCallNotifier.showMissedCallNotification(fakeCall);
+ missedCallNotifier.showMissedCallNotification(fakeCall, /* uri= */ null);
// Create two intents that correspond to call-back and respond back with SMS, and assert
// that in the case of a SIP call, no SMS intent is generated.
@@ -525,7 +556,7 @@
MissedCallNotifier missedCallNotifier = new MissedCallNotifierImpl(mContext,
mPhoneAccountRegistrar, mDefaultDialerCache, fakeBuilderFactory,
- mDeviceIdleControllerAdapter);
+ mDeviceIdleControllerAdapter, mFeatureFlags);
// AsyncQueryHandler used in reloadFromDatabase interacts poorly with the below
// timeout-verify, so run this in a new handler to mitigate that.
@@ -595,7 +626,7 @@
MissedCallNotifier missedCallNotifier = new MissedCallNotifierImpl(mContext,
mPhoneAccountRegistrar, mDefaultDialerCache, fakeBuilderFactory,
- mDeviceIdleControllerAdapter);
+ mDeviceIdleControllerAdapter, mFeatureFlags);
// AsyncQueryHandler used in reloadFromDatabase interacts poorly with the below
// timeout-verify, so run this in a new handler to mitigate that.
@@ -637,13 +668,13 @@
MissedCallNotifier missedCallNotifier = new MissedCallNotifierImpl(mContext,
mPhoneAccountRegistrar, mDefaultDialerCache, fakeBuilderFactory,
- mDeviceIdleControllerAdapter);
+ mDeviceIdleControllerAdapter, mFeatureFlags);
PhoneAccount phoneAccount = makePhoneAccount(PRIMARY_USER, NO_CAPABILITY);
MissedCallNotifier.CallInfo fakeCall =
makeFakeCallInfo(SIP_CALL_HANDLE, CALLER_NAME, CALL_TIMESTAMP,
phoneAccount.getAccountHandle());
- missedCallNotifier.showMissedCallNotification(fakeCall);
+ missedCallNotifier.showMissedCallNotification(fakeCall, /* uri= */ null);
ArgumentCaptor<Intent> intentCaptor = ArgumentCaptor.forClass(Intent.class);
ArgumentCaptor<Bundle> bundleCaptor =
@@ -701,7 +732,7 @@
NotificationBuilderFactory fakeBuilderFactory, UserHandle currentUser) {
MissedCallNotifier missedCallNotifier = new MissedCallNotifierImpl(mContext,
mPhoneAccountRegistrar, mDefaultDialerCache, fakeBuilderFactory,
- mDeviceIdleControllerAdapter);
+ mDeviceIdleControllerAdapter, mFeatureFlags);
missedCallNotifier.setCurrentUserHandle(currentUser);
return missedCallNotifier;
}
diff --git a/tests/src/com/android/server/telecom/tests/TelecomSystemTest.java b/tests/src/com/android/server/telecom/tests/TelecomSystemTest.java
index 0082e28..4a5f003 100644
--- a/tests/src/com/android/server/telecom/tests/TelecomSystemTest.java
+++ b/tests/src/com/android/server/telecom/tests/TelecomSystemTest.java
@@ -38,6 +38,7 @@
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
+import android.annotation.Nullable;
import android.app.AppOpsManager;
import android.bluetooth.BluetoothManager;
import android.content.BroadcastReceiver;
@@ -121,7 +122,7 @@
/**
* Implements mocks and functionality required to implement telecom system tests.
*/
-public class TelecomSystemTest extends TelecomTestCase {
+public class TelecomSystemTest extends TelecomTestCase{
private static final String CALLING_PACKAGE = TelecomSystemTest.class.getPackageName();
static final int TEST_POLL_INTERVAL = 10; // milliseconds
@@ -169,7 +170,7 @@
}
@Override
- public void showMissedCallNotification(CallInfo call) {
+ public void showMissedCallNotification(CallInfo call, @Nullable Uri uri) {
missedCallsNotified.add(call);
}
@@ -501,7 +502,8 @@
.thenReturn(null);
mTelecomSystem = new TelecomSystem(
mComponentContextFixture.getTestDouble(),
- (context, phoneAccountRegistrar, defaultDialerCache, mDeviceIdleControllerAdapter)
+ (context, phoneAccountRegistrar, defaultDialerCache, mDeviceIdleControllerAdapter,
+ mFeatureFlag)
-> mMissedCallNotifier,
mCallerInfoAsyncQueryFactoryFixture.getTestDouble(),
headsetMediaButtonFactory,