Source: Wear OS by Google: AoG support and new enhanced battery saver mode from Android Developer
Posted by Hoi Lam, Lead Developer Advocate, Wear OS by Google
At Google I/O, we launched the Wear OS by Google developer preview 2. This update added support for Actions on Google (AoG) and more power-related enhancements including a new battery saver mode.
This developer preview includes updated Android Emulator images and a downloadable system image for the Huawei Watch 2 Bluetooth or Huawei Watch 2 Classic Bluetooth. This preview release is intended for developers only and not for daily or consumer use. Therefore, the preview release is only available via manual download and flash. Please refer to the release notes for known issues before downloading and flashing your device.
We have revamped the Google Assistant on Wear OS to support features such as visual cards, follow-on suggestion chips, and text-to-speech. For developers, we added support for Actions on Google to Wear OS and existing Actions will work on Wear OS out of the box. Be sure to observe best practices for Actions on Google to get the best results such as short concise dialog and adopting to both visual and vocal feedback. This feature does not depend on Android P and is being rolled out to all Wear 2.0 users.
In this Android P developer preview, we are launching an enhanced battery saver mode. While the watch is in this mode, the watch shows a power-efficient watch face and turns off a set of services including radios, the touch screen, and tilt to wake. Users can get the time by pressing the side button. A long press allows the user to switch back to a fully-operational mode and perform tasks such as paying with NFC or replying to a message. Developers should assume that their apps, watch faces, and complication data providers are not available in enhanced battery saver mode.
We received much feedback on the power saving features in the last developer preview. As a result, we have updates on two features:
Smart Reply has been enabled for bridged notifications from the user’s smartphone for some time. With the latest developer preview, we are introducing simplified Chinese support for our users in China. This feature is powered by an on-device model using TensorFlow Lite and the model is optimized for low-memory, low-power devices.
To use this feature, developers should set
setAllowGeneratedReplies of the reply action to true. Here’s a sample code snippet with the important part highlighted in bold:
NotificationCompat.Action action = new NotificationCompat.Action.Builder(R.drawable.ic_reply_white_24dp, replyLabel, replyPendingIntent) .addRemoteInput(remoteInput) .setAllowGeneratedReplies(true) // <--- true to enable smart replies // Wear OS requires a hint to display the reply action inline. .extend(new NotificationCompat.Action.WearableExtender() .setHintDisplayActionInline(true)) .build();
In addition, for messaging apps, we recommend that developers use
MessagingStyle notifications. This can give the algorithm a more structured data set on which to base its recommendations.
We expect to provide more updates to this preview before the final production release. Please submit any bugs you find via the Wear OS by Google issue tracker. The earlier you submit them, the higher the likelihood that we can include the fixes in the final release.