Remove saving state from Toolbar am: cffd5ba0e5 am: 4cbfbdba11 am: bf2c058664
Change-Id: I46b15e7b8d66bf7580fc6f4a74f149e64059e65b
diff --git a/car-assist-client-lib/src/com/android/car/assist/client/BundleBuilder.java b/car-assist-client-lib/src/com/android/car/assist/client/BundleBuilder.java
index 742eca6..9428247 100644
--- a/car-assist-client-lib/src/com/android/car/assist/client/BundleBuilder.java
+++ b/car-assist-client-lib/src/com/android/car/assist/client/BundleBuilder.java
@@ -17,6 +17,7 @@
import static com.android.car.assist.CarVoiceInteractionSession.KEY_ACTION;
import static com.android.car.assist.CarVoiceInteractionSession.KEY_EXCEPTION;
+import static com.android.car.assist.CarVoiceInteractionSession.KEY_FALLBACK_ASSISTANT_ENABLED;
import static com.android.car.assist.CarVoiceInteractionSession.KEY_NOTIFICATION;
import static com.android.car.assist.CarVoiceInteractionSession.VOICE_ACTION_HANDLE_EXCEPTION;
import static com.android.car.assist.CarVoiceInteractionSession.VOICE_ACTION_READ_NOTIFICATION;
@@ -66,10 +67,12 @@
* @return The bundle that can be sent to Assistant.
*/
static Bundle buildAssistantHandleExceptionBundle(
- @ExceptionValue String exception) {
+ @ExceptionValue String exception,
+ boolean fallbackAssistantEnabled) {
Bundle args = new Bundle();
args.putString(KEY_ACTION, VOICE_ACTION_HANDLE_EXCEPTION);
args.putString(KEY_EXCEPTION, exception);
+ args.putBoolean(KEY_FALLBACK_ASSISTANT_ENABLED, fallbackAssistantEnabled);
return args;
}
}
diff --git a/car-assist-client-lib/src/com/android/car/assist/client/CarAssistUtils.java b/car-assist-client-lib/src/com/android/car/assist/client/CarAssistUtils.java
index 029467e..1f9d915 100644
--- a/car-assist-client-lib/src/com/android/car/assist/client/CarAssistUtils.java
+++ b/car-assist-client-lib/src/com/android/car/assist/client/CarAssistUtils.java
@@ -346,7 +346,8 @@
// If there is an active assistant, alert them to request permissions.
Bundle handleExceptionBundle = BundleBuilder
.buildAssistantHandleExceptionBundle(
- EXCEPTION_NOTIFICATION_LISTENER_PERMISSIONS_MISSING);
+ EXCEPTION_NOTIFICATION_LISTENER_PERMISSIONS_MISSING,
+ /* fallbackAssistantEnabled */ false);
fireAssistantAction(CarVoiceInteractionSession.VOICE_ACTION_HANDLE_EXCEPTION,
handleExceptionBundle, callback);
}
@@ -390,8 +391,13 @@
final String fallbackActionResult = hasError ? ActionRequestCallback.RESULT_FAILED
: ActionRequestCallback.RESULT_SUCCESS;
if (hasActiveAssistant()) {
+ // If there is an active assistant, alert them to request permissions.
+ Bundle handleExceptionBundle = BundleBuilder
+ .buildAssistantHandleExceptionBundle(
+ EXCEPTION_NOTIFICATION_LISTENER_PERMISSIONS_MISSING,
+ /* fallbackAssistantEnabled */ true);
fireAssistantAction(CarVoiceInteractionSession.VOICE_ACTION_HANDLE_EXCEPTION,
- null, new ActionRequestCallback() {
+ handleExceptionBundle, new ActionRequestCallback() {
@Override
public void onResult(String requestActionFromAssistantResult) {
if (fallbackActionResult.equals(
diff --git a/car-assist-lib/src/com/android/car/assist/CarVoiceInteractionSession.java b/car-assist-lib/src/com/android/car/assist/CarVoiceInteractionSession.java
index cd58229..6c16fdc 100644
--- a/car-assist-lib/src/com/android/car/assist/CarVoiceInteractionSession.java
+++ b/car-assist-lib/src/com/android/car/assist/CarVoiceInteractionSession.java
@@ -42,6 +42,13 @@
public static final String KEY_EXCEPTION = "KEY_EXCEPTION";
/**
+ * The key used for the {@link CarVoiceInteractionSession#VOICE_ACTION_HANDLE_EXCEPTION} payload
+ * {@link Bundle}. Must map to a boolean. If value is true, the Fallback Assistant that can
+ * handle the user's request has been disabled.
+ */
+ public static final String KEY_FALLBACK_ASSISTANT_ENABLED = "KEY_FALLBACK_ASSISTANT_ENABLED";
+
+ /**
* The key used for the payload {@link Bundle}, if a {@link StatusBarNotification} is used as
* the payload.
*/
diff --git a/car-broadcastradio-support/res/values-or/strings.xml b/car-broadcastradio-support/res/values-or/strings.xml
index 2a149ad..ab448c8 100644
--- a/car-broadcastradio-support/res/values-or/strings.xml
+++ b/car-broadcastradio-support/res/values-or/strings.xml
@@ -20,5 +20,5 @@
<string name="radio_fm_text" msgid="1973045042281933494">"FM"</string>
<string name="radio_dab_text" msgid="8456449462266648979">"DAB"</string>
<string name="program_list_text" msgid="4414150317304422313">"ଷ୍ଟେଶନ୍"</string>
- <string name="favorites_list_text" msgid="7829827713977109155">"ପସନ୍ଦଦାର୍"</string>
+ <string name="favorites_list_text" msgid="7829827713977109155">"ପସନ୍ଦର"</string>
</resources>