Tuesday, April 10, 2018

Android P may bring wallpaper support to the Google Pixel 2/2 XL’s Always on Display

Popularized by the Samsung Galaxy S7 series, "Always on Display" features are becoming more and more common in flagship Android devices. The feature allows you to glance at the time, date, and notifications without ever needing to touch your phone. Google jumped on board the bandwagon with the Google Pixel 2 and Pixel 2 XL, which had the added benefit of bringing the feature to AOSP starting with Android 8.1 Oreo. Meanwhile, Samsung has continued tweaking their version of the AOD by adding static wallpaper support and even basic GIF support. Now, it appears that Google may be catching up with Samsung on this front as the first Android P Developer Preview hints at wallpaper support in the Pixel 2's Always on Display.

I decompiled the SystemUI APK from the Google Pixel 2 XL running Android P Developer Preview 1 and found interesting new debug parameters related to AOD. Nearly 2 months ago, I discovered a set of hidden commands used to customize the AOD, and these new debug parameters seem to be part of the same set of commands. Searching for other references to these names brought me to a class called "DozeWallpaperState" as shown below.

Google Pixel 2 Always on Display Android P

As you can see in the first screenshot, there are several fields in the "AlwaysOnDisplayPolicy" class. The fields include prox_cooldown_periodprox_cooldown_triggerprox_screen_off_delay, and screen_brightness_array which were present in Android 8.1 Oreo. However, two new fields called wallpaperFadeOutDuration and wallpaperVisibilityDuration hint at debugging parameters used by Google engineers to test smoothly fading in and out of the wallpaper shown on the Always on Display when transitioning to the lock screen.

In the second screenshot, we see a method from the DozeWallpaperState class that defines what to do when the device transitions to an ambient display mode (regular or AOD). Of interest are some lines being written to the system log that when the device supports AOD but isn't currently in ambient display mode. The log states that the "AoD wallpaper state changed to" and lists the current ambient display state and how long it took to animate that transition.

Another possible explanation of this code is that the AOD will only show the wallpaper during an incoming notification, but we aren't too sure. We spoke to a few developers who looked at the code with us, but we couldn't get a consensus. Hopefully, we'll find out in the next Android P Developer Preview or when the source code for Android P drops. By then, someone might even figure out how to enable this feature before the next Android P preview build!



from xda-developers https://ift.tt/2GOKDZF
via IFTTT

No comments:

Post a Comment