Wednesday, September 4, 2019

[Update: Clock Plugins] Google is working on lock screen clock customization in Android Q

Update 1 (9/4/19 @ 10:54 AM EST): The Android 10 source code was released the other day, and it confirms that clock plugins are indeed a thing. Sadly, the popular type clock face has been removed.

The first Android Q beta release was made public 2 days ago. If you have a Google Pixel smartphone, you can download the beta right now. The biggest new features in Q are the system-wide dark mode (which has inexplicably been hidden from users), the privacy and permissions revamp (though the leaked permission overview interface was also hidden), and the desktop mode. We’ve been digging into the release using our trusted APKTool and JEB Decompiler to find all the hidden features like new gestures and Active Edge remapping that might arrive in the final Q release. Another feature that we found is lock screen clock customization.

As shown below, Google is working on letting you customize the appearance of the clock on the lock screen. They’ve created 3 different custom clock presets that can be enabled right now by changing the value of a hidden setting. The preset clocks include a text clock, a bubble clock, and a stretch analog clock. All of these custom clocks are incomplete since they’re missing the date and weather, but they do work with the Always on Display of the Pixel 2 and Pixel 3. The bubble and stretch clocks also show the standard digital clock, which probably won’t be the case if this feature makes its way into the final Android Q release.

To enable these custom clocks on Android Q, follow the instructions below.

Requirements:

Run one of the following commands to change the lock screen clock. The command takes effect immediately:

Bubble Clock: 

adb shell settings put secure lock_screen_custom_clock_face "com.android.keyguard.clock.BubbleClockController"

Stretch Analog Clock:

adb shell settings put secure lock_screen_custom_clock_face "com.android.keyguard.clock.StretchAnalogClockController"

Text Clock: 

adb shell settings put secure lock_screen_custom_clock_face "com.android.keyguard.clock.TypeClockController"

Normal Clock:

adb shell settings delete secure lock_screen_custom_clock_face

For any interested developers, here’s the relevant method in SystemUIGoogle’s ClockManager class:

Code for custom clock faces on the lock screen

private void register() {
String str = "lock_screen_custom_clock_face";
this.mContentResolver.registerContentObserver(Secure.getUriFor(str), false, this.mContentObserver);
ExtensionBuilder newExtension = this.mExtensionController.newExtension(ClockPlugin.class);
newExtension.withPlugin(ClockPlugin.class);
newExtension.withCallback(this.mClockPluginConsumer);
newExtension.withDefault(new SettingsGattedSupplier(this.mContentResolver, str, BubbleClockController.class.getName(), new C0386-$$Lambda$ClockManager$LL3RUa19AVegk9Mkg8eS_BmuG7o(this)));
newExtension.withDefault(new SettingsGattedSupplier(this.mContentResolver, str, StretchAnalogClockController.class.getName(), new C0387-$$Lambda$ClockManager$aVyrwGQVcB_VpjAEn9xTWGKpSj8(this)));
newExtension.withDefault(new SettingsGattedSupplier(this.mContentResolver, str, TypeClockController.class.getName(), new C0384-$$Lambda$ClockManager$0RLVFJyrdkzcA8PsTIu0AOgpy1E(this)));
this.mClockExtension = newExtension.build();
}

These custom clocks are being developed as a plug-in to SystemUI. It’s possible we might see them in the SystemUI Tuner of a future Android Q release, or we may never see them at all in any user-accessible way. Google works on new features like this all the time, many of which sadly never make their way into the Settings app. One of the most notable examples of this is the hidden navigation bar tuner in Android 7 Nougat. If lock screen clock customization does get released in a future Android Q beta build, we’ll let you all know.

More Android Q News, Tips, and Tricks


Update 1 (7/18/19 @ 7:00 PM EST): Google removed the TypeClockController in Q beta 4 and they also changed the Stretch Analog Clock. To enable the Stretch Analog Clock, enter:

adb shell settings put secure lock_screen_custom_clock_face "com.android.keyguard.clock.AnalogClockController"

The Bubble clock command remains the same.


Update 2: Clock Plugins in Android 10

As detailed on a readme page in AOSP, Google has added a ClockPlugin plugin interface to allow for customizing the clock that appears on the lock screen and the always on display. Because clocks are “high risk for battery consumption and screen burn-in,” OEMs are recommended to target a “maximum on-pixel-ratio (OPR) of 5%.” Furthermore, Google recommends that clocks “should not be composed of large solid blocks of color, and the clock should be moved around the screen to distribute the on pixels across a large number of pixels.” After implementing a clock, Google recommends testing for burn in.

Google currently supports two custom clock faces in AOSP Android 10: Stretch Analog and Bubble. The company removed support for the Type clock face, though the reasoning wasn’t explained.

The post [Update: Clock Plugins] Google is working on lock screen clock customization in Android Q appeared first on xda-developers.

HostGator Web Hosting

0 comments:

Post a Comment