telecom-bluetooth DND bug
Bugs came in about Do Not Disturb being on but still
interrupting users of incoming calls. Turns out, this was a
result of BluetoothInCallService putting the headset into ring
mode before Telecom informed the InCallService to not ring.
Fix is to add a new EXTRA called EXTRA_IS_SUPPRESSED_BY_DO_NOT_DISTURB.
The extra is intended for InCallServices that may interrupt the user of
an incoming call.
Bug: 208652088
Test: maual + unit tests,
3 DndCallFilter tests,
2 RingerTests,
1 CallTests
Change-Id: If8abec19dfc90999b2fc2ef3e4f5584c55d6fc2a
diff --git a/telecomm/java/android/telecom/Call.java b/telecomm/java/android/telecom/Call.java
index 432af3a..5cef2cb 100644
--- a/telecomm/java/android/telecom/Call.java
+++ b/telecomm/java/android/telecom/Call.java
@@ -168,6 +168,18 @@
public static final String AVAILABLE_PHONE_ACCOUNTS = "selectPhoneAccountAccounts";
/**
+ * Extra key intended for {@link InCallService}s that notify the user of an incoming call. When
+ * EXTRA_IS_SUPPRESSED_BY_DO_NOT_DISTURB returns true, the {@link InCallService} should not
+ * interrupt the user of the incoming call because the call is being suppressed by Do Not
+ * Disturb settings.
+ *
+ * This extra will be removed from the {@link Call} object for {@link InCallService}s that do
+ * not hold the {@link android.Manifest.permission#READ_CONTACTS} permission.
+ */
+ public static final String EXTRA_IS_SUPPRESSED_BY_DO_NOT_DISTURB =
+ "android.telecom.extra.IS_SUPPRESSED_BY_DO_NOT_DISTURB";
+
+ /**
* Key for extra used to pass along a list of {@link PhoneAccountSuggestion}s to the in-call
* UI when a call enters the {@link #STATE_SELECT_PHONE_ACCOUNT} state. The list included here
* will have the same length and be in the same order as the list passed with
diff --git a/telecomm/java/android/telecom/ParcelableCallAnalytics.java b/telecomm/java/android/telecom/ParcelableCallAnalytics.java
index ff87ab0..a69dfb0b 100644
--- a/telecomm/java/android/telecom/ParcelableCallAnalytics.java
+++ b/telecomm/java/android/telecom/ParcelableCallAnalytics.java
@@ -111,6 +111,8 @@
public static final int FILTERING_INITIATED = 106;
public static final int FILTERING_COMPLETED = 107;
public static final int FILTERING_TIMED_OUT = 108;
+ public static final int DND_CHECK_INITIATED = 109;
+ public static final int DND_CHECK_COMPLETED = 110;
public static final int SKIP_RINGING = 200;
public static final int SILENCE = 201;
@@ -195,6 +197,7 @@
public static final int BLOCK_CHECK_FINISHED_TIMING = 9;
public static final int FILTERING_COMPLETED_TIMING = 10;
public static final int FILTERING_TIMED_OUT_TIMING = 11;
+ public static final int DND_PRE_CALL_PRE_CHECK_TIMING = 12;
/** {@hide} */
public static final int START_CONNECTION_TO_REQUEST_DISCONNECT_TIMING = 12;