Skip to content

Commit

Permalink
Version 4.1.1 Alexa Auto SDK
Browse files Browse the repository at this point in the history
The Alexa Auto SDK is for automotive OEMs to integrate Alexa directly into vehicles.

**v4.1.1**

* v4.1.1 released on 2022-08-08

**Enhancements**
* Improved Auto SDK AACS Sample App Setup and Settings UX.
* Updated APL renderer app component, as well as dependent APL Viewhost Android libraries (AARs). It is highly recommended you update to release 4.1.1 for APL integrations.
>**Note:** All Auto SDK 4.1 extensions are compatible with 4.1.1.

**Resolved Issues**
* Improved the settings menu by expanding the clickable area of settings, and added missing descriptions for menu items.
* Fixed a race condition in which updating the Alexa language setting, and then navigating away from the menu page could crash the application without switching the language.
* Fixed an issue in which the Alexa comms permission screen did not render properly. Improved the margin alignment issue in the setup screens.

**Known Issues**
**General**

* The [Alexa Automotive UX guidelines](#https://developer.amazon.com/en-US/docs/alexa/alexa-auto/display-cards.html#dismiss-display-cards) specify when to automatically dismiss a `TemplateRuntime` display card for each template type. The Engine publishes the `TemplateRuntime` interface messages `ClearTemplate` and `ClearPlayerInfo` based on the timeouts configured in the `aace.alexa.templateRuntimeCapabilityAgent` Engine configuration. However, the configuration does not provide enough granularity to specify timeouts for different types of display cards. Consequently, there is no way for your application to configure automatically dismissing local search templates (e.g., `LocalSearchListTemplate2`) with a different timeout than other templates (e.g., `WeatherTemplate`). The configuration also does not provide a way for you to specify infinite timeout for `NowPlaying` cards. You must implement your application’s dismissal logic for display cards and media info accordingly.
* There is a rare race condition in which publishing the `AlexaClient.StopForegroundActivity` message does not cancel the active Alexa interaction. The race condition can happen when the application publishes the message at the beginning of the `THINKING` state `AlexaClient.DialogStateChanged` transition.

**Car control**

* If you configure the Auto SDK Engine and connect to Alexa using a set of endpoint configurations, you cannot delete any endpoint in the set from Alexa. For example, after you configure set A with endpoints 1, 2, and 3, if you change your car control configuration during development to set B with endpoints 2, 3, and 4, Alexa retains endpoint 1 from set A, which might interfere with resolving the correct endpoint ID for your utterances. However, any endpoint configurations with matching IDs override previous configurations. For example, the configuration of endpoint 2 in set B replaces endpoint 2 in set A. During development, limit configuration changes to create only supersets of previous endpoint configurations. Work with your Solutions Architect or Partner Manager to produce the correct configuration on the first try

**Communications**

* If the user asks Alexa to redial the last called number when their phone is not connected to the head unit, Alexa is silent rather than prompting the user to connect their phone.

**Entertainment**

* When music is playing, repeatedly pressing the “next” button to advance in the playlist restarts the current song.
* When using the LVC extension, if the application publishes the `MediaPlaybackRequestor.RequestMediaPlayback` AASB message before the Auto SDK Engine connects to Alexa cloud, media playback will not automatically resume as expected. The workaround is to wait for the connection to Alexa cloud to complete before publishing the `RequestMediaPlayback` message.
* There is no AASB message to indicate to Alexa that the user switched the media player UI on the head unit from an Alexa-integrated local media source, such as FM radio, to Alexa cloud-based music service provider. The only way to switch the audio context between the two player types is through voice interaction explicitly requesting a particular player.
* If your application cancels an Alexa interaction by sending the `AlexaClient.StopForegroundActivity` message to the Engine during music playback, the Engine might erroneously request your application to dismiss the `NowPlaying` media info by publishing the `TemplateRuntime.ClearPlayerInfo` message. Your application should not dismiss the media info in this scenario.

**Local Voice Control**

* In offline mode with LVC, after the user requests a list of POIs with an utterance such as “Alexa, find a nearby Starbucks”, Alexa does not recognize follow up requests such as "Alexa, select the first one" and does not display or read detailed information about the requested selection.

**AACS sample app**
* Sometimes the sample app will display an error page during sign-in if the user launched the app with the launcher icon. The recommended workaround is to set Alexa as the default assistant in the settings menu to guarantee AACS initializes properly before sign in.
* APL Card is prematurely closed if there is music playing in the background and APL command `SpeakItem` or `SpeakList`is executed.
* The voice interaction UI does not match the automotive UX guidelines for touching the screen during the interaction. The UX guidelines state that the interaction should continue if the user taps or scrolls, but the sample app cancels the interaction when the user taps or scrolls.
* The volume Alexa uses to read a shopping list is louder than the volume set for other Alexa responses.
* When the device has internet disconnected and the user sets the system language to a language not supported by Alexa, the sample app does not always display the language selection screen automatically.
* When the user revokes Alexa permission to use the microphone and then re-enables the permission, Alexa does not respond to utterances until the user restarts the app.
* If an alert is going off while Alexa is speaking, the timer audio cancels the Alexa speech. timer is going off while Alexa is speaking, the timer audio cancels the Alexa speech.

**C++ sample app**

* The sample app may fail to handle synchronous-style `AASB messages` within the required timeout to construct device context for Alexa. As a result, some utterances may not work as expected.

[Read the SDK Docs](https://alexa.github.io/alexa-auto-sdk/docs/)
  • Loading branch information
MuniSakkuru authored and Muni Sakkuru committed Aug 8, 2022
1 parent 56b1b1e commit 3835d01
Show file tree
Hide file tree
Showing 1,567 changed files with 1,809 additions and 100,597 deletions.
8 changes: 0 additions & 8 deletions .githooks/clang-format

This file was deleted.

25 changes: 0 additions & 25 deletions .githooks/exec_tool.sh

This file was deleted.

8 changes: 0 additions & 8 deletions .githooks/linux-x64/clang-format

This file was deleted.

Binary file removed .githooks/mac-x64/clang-format
Binary file not shown.
26 changes: 0 additions & 26 deletions .githooks/pre-commit

This file was deleted.

2 changes: 1 addition & 1 deletion aacs/android/app-components/alexa-auto-apis/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ android {
defaultConfig {
minSdkVersion 25
versionCode 1
versionName "4.1"
versionName "4.1.1"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
}
buildTypes {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ android {
minSdkVersion 26
targetSdkVersion 28
versionCode 1
versionName "4.1"
versionName "4.1.1"
}
buildTypes {
release {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ android {
minSdkVersion 22
targetSdkVersion 28
versionCode 1
versionName "4.1"
versionName "4.1.1"
buildConfigField 'int', 'VERSION_CODE', "1"
buildConfigField 'String', 'VERSION_NAME', "\"4.1\""
buildConfigField 'String', 'VERSION_NAME', "\"4.1.1\""
}

buildTypes {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@

import com.amazon.apl.android.APLOptions;
import com.amazon.apl.android.RootConfig;
import com.amazon.apl.android.audio.RuntimeAudioPlayerFactory;
import com.amazon.apl.android.dependencies.IOpenUrlCallback;
import com.amazon.apl.android.dependencies.impl.OpenUrlCallback;
import com.amazon.apl.android.media.RuntimeMediaPlayerFactory;
import com.amazon.apl.android.render.BuildConfig;
import com.amazon.apl.android.render.dagger.ActivityContext;
import com.amazon.apl.android.render.dagger.ActivityScope;
Expand All @@ -42,12 +44,8 @@ public class APLOptionsModule {
* @return an instance of {@link APLOptions}.
*/
@Provides
APLOptions.Builder provideAPLOptions(final APLMediaPlayerProvider mediaProvider,
final IOpenUrlCallback openUrlCallback, final APLTtsPlayerProvider ttsProvider) {
return APLOptions.builder()
.mediaPlayerProvider(mediaProvider)
.openUrlCallback(openUrlCallback)
.ttsPlayerProvider(ttsProvider);
APLOptions.Builder provideAPLOptions(final IOpenUrlCallback openUrlCallback) {
return APLOptions.builder().openUrlCallback(openUrlCallback);
}

/**
Expand All @@ -64,14 +62,17 @@ public IOpenUrlCallback provideOpenUrl(@ActivityContext final Context context) {
* @return an instance of {@link RootConfig}
*/
@Provides
public RootConfig provideRootConfig(@ActivityContext final Context context) {
public RootConfig provideRootConfig(@ActivityContext final Context context, final APLTtsPlayerProvider ttsProvider,
final APLMediaPlayerProvider mediaProvider) {
Map<String, String> autoEnvironmentValues = new HashMap<>();
autoEnvironmentValues.put("drivingState", "moving");
return RootConfig.create(context)
.agent(BuildConfig.VERSION_NAME, "1.9")
.registerDataSource("dynamicIndexList")
.registerDataSource("dynamicTokenList")
.setEnvironmentValue("automobile", autoEnvironmentValues)
.audioPlayerFactory(new RuntimeAudioPlayerFactory(ttsProvider))
.mediaPlayerFactory(new RuntimeMediaPlayerFactory(mediaProvider))
.allowOpenUrl(false);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,89 +22,46 @@
import androidx.annotation.NonNull;

import com.amazon.apl.android.dependencies.impl.MediaPlayer;
import com.amazon.apl.android.render.audio.AudioFocusController;
import com.amazon.apl.android.render.interfaces.IAPLEventSender;
import com.amazon.apl.android.render.interfaces.IAPLTokenProvider;

/**
* Provides a wrapper of the MediaPlayer player that can report activity events
* and request Android audio focus. The Media player is used for playing video
* content.
* Provides a wrapper of the MediaPlayer player that can report activity events.
* The Media player is used for playing video content. Android audio focus
* management is built into the base MediaPlayer class.
*/
public class APLMediaPlayer extends MediaPlayer implements AudioFocusController.PlaybackController {
public class APLMediaPlayer extends MediaPlayer {
private static final String TAG = APLMediaPlayer.class.getSimpleName();

private final IAPLEventSender mAplEventSender;
private final IAPLTokenProvider mAplTokenProvider;
private final AudioFocusController mAudioFocusController;

public APLMediaPlayer(@NonNull Context context, @NonNull TextureView view, @NonNull IAPLEventSender aplEventSender,
@NonNull IAPLTokenProvider aplTokenProvider) {
super(context, view);
Log.v(TAG, "Created");
mAplEventSender = aplEventSender;
mAplTokenProvider = aplTokenProvider;
AudioManager audioManager =
(AudioManager) context.getApplicationContext().getSystemService(Context.AUDIO_SERVICE);
mAudioFocusController = new AudioFocusController(audioManager, this);
}

/**
* {@inheritDoc}
*/
@Override
public void play() {
Log.v(TAG, "play: ");
mAudioFocusController.startPlaybackAfterAcquiringFocus();
Log.v(TAG, "play:");
super.play();
mAplEventSender.sendActivityEventRequest(mAplTokenProvider.getToken(), IAPLEventSender.ActivityEvent.ACTIVATED);
}

/**
* {@inheritDoc}
*/
@Override
public void stop() {
Log.v(TAG, "stop: ");
super.stop();
mAudioFocusController.relinquishAudioFocusIfCurrentlyAcquired();
mAplEventSender.sendActivityEventRequest(
mAplTokenProvider.getToken(), IAPLEventSender.ActivityEvent.DEACTIVATED);
}

@Override
public void startPlaybackNow() {
Log.v(TAG, "startPlaybackNow: ");
super.play();
mAplEventSender.sendActivityEventRequest(mAplTokenProvider.getToken(), IAPLEventSender.ActivityEvent.ACTIVATED);
}

@Override
public void requestResumingPlayback() {
Log.v(TAG, "requestResumingPlayback: ");
super.play();
mAplEventSender.sendActivityEventRequest(mAplTokenProvider.getToken(), IAPLEventSender.ActivityEvent.ACTIVATED);
}

@Override
public void requestPausePlayback() {
Log.v(TAG, "requestPausePlayback: ");
super.pause();
}

@Override
public void requestStopPlayback() {
Log.v(TAG, "requestStopPlayback: ");
Log.v(TAG, "stop:");
super.stop();
mAplEventSender.sendActivityEventRequest(
mAplTokenProvider.getToken(), IAPLEventSender.ActivityEvent.DEACTIVATED);
}

@Override
public void adjustPlaybackVolume(float volumeMultiplier) {
Log.v(TAG, "adjustPlaybackVolume: " + volumeMultiplier);
}

@Override
public void failedToAcquireFocus() {
Log.e(TAG, "failedToAcquireFocus: ");
super.stop();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,15 @@ public void prepare(@NonNull String source, @NonNull ITtsSourceProvider ttsSourc
}
}

@Override
public void prepare(@NonNull String source) {
try {
getPlayer().prepare(source, new URL(source));
} catch (Exception e) {
Log.e(TAG, "Could not set the speech source", e);
}
}

@Override
public void onDocumentFinish() {
if (mTtsPlayer != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import static com.amazon.alexa.auto.apps.common.Constants.APL_RUNTIME_PROPERTIES;
import static com.amazon.alexa.auto.apps.common.Constants.APL_RUNTIME_PROPERTY_DRIVING_STATE_NAME;
import static com.amazon.alexa.auto.apps.common.Constants.APL_RUNTIME_PROPERTY_THEME_NAME;
import static com.amazon.alexa.auto.apps.common.Constants.APL_RUNTIME_PROPERTY_VIDEO_NAME;

import android.content.Context;
import android.content.SharedPreferences;
Expand Down Expand Up @@ -380,13 +381,17 @@ private String constructAPLRuntimeProperties() {
Preconditions.checkNotNull(sharedPreferences);
String drivingStateValue = sharedPreferences.getString(APL_RUNTIME_PROPERTY_DRIVING_STATE_NAME, "");
String themeValue = sharedPreferences.getString(APL_RUNTIME_PROPERTY_THEME_NAME, "");
String videoValue = sharedPreferences.getString(APL_RUNTIME_PROPERTY_VIDEO_NAME, "");

if (!drivingStateValue.isEmpty()) {
properties.put(APL_RUNTIME_PROPERTY_DRIVING_STATE_NAME, drivingStateValue);
}
if (!themeValue.isEmpty()) {
properties.put(APL_RUNTIME_PROPERTY_THEME_NAME, themeValue);
}
if (!videoValue.isEmpty()) {
properties.put(APL_RUNTIME_PROPERTY_VIDEO_NAME, videoValue);
}

return properties.toString();
} catch (JSONException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ android {
defaultConfig {
minSdkVersion 26
versionCode 1
versionName "4.1"
versionName "4.1.1"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
}
buildTypes {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ android {
defaultConfig {
minSdkVersion 25
versionCode 1
versionName "4.1"
versionName "4.1.1"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
}
buildTypes {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ public class Constants {
public static final String APL_RUNTIME_PROPERTY_THEME_NAME = "theme";
public static final String APL_RUNTIME_PROPERTY_DRIVING_STATE_VALUE_MOVING = "moving";
public static final String APL_RUNTIME_PROPERTY_DRIVING_STATE_VALUE_PARKED = "parked";
public static final String APL_RUNTIME_PROPERTY_VIDEO_NAME = "video";
public static final String APL_RUNTIME_PROPERTY_VIDEO_VALUE_ENABLED = "enabled";
public static final String APL_RUNTIME_PROPERTY_VIDEO_VALUE_DISABLED = "disabled";

// Car UX Restrictions
public static final String CAR_UX_RESTRICTIONS_DRIVING_STATE_ACTION =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ android {
minSdkVersion 26
targetSdkVersion 29
versionCode 1
versionName "4.1"
versionName "4.1.1"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles 'consumer-rules.pro'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ android {
defaultConfig {
minSdkVersion 26
versionCode 1
versionName "4.1"
versionName "4.1.1"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
}
buildTypes {
Expand Down
Loading

0 comments on commit 3835d01

Please sign in to comment.