What’s Old is New Again

Mishaal Rahman
|
Try Esper for Free
Learn about Esper mobile device management software for Android and iOS

AOSP, like Chromium OS, is an open source operating system, but Google isn’t nearly as open with its ongoing development as they are with Chromium. Instead, most of the source code for the next version of Android is held from the public until Google is ready to release it. However, not every code change is withheld from the public AOSP Gerrit. Code changes tweaking some under-the-hood components that aren’t interesting to anyone but system engineers (and nerds like me) are committed to the AOSP master branch all the time. Sometimes, these seemingly uninteresting code changes point to something exciting coming down the line, and in today’s edition of Android Dessert Bites, I’ll be looking at one such change and what it may mean for the Pixel.

Earlier this week, my friend Luca Stefani informed me about a patch submitted to the Linux kernel’s power supply subsystem. Google engineer Jack Wu submitted this patch last week, which adds a new power_supply_type string called “dock”, joining other power supply descriptors like “Battery”, “UPS”, “Mains”, “USB”, and “Wireless”. The purpose of these descriptors, according to this presentation from Sebastian Reichel, the maintainer of the Linux kernel’s power supply subsystem, is to supply information to userspace applications about the type of power supply that’s powering the device. Having information about what’s powering the device is useful as it lets the OS and applications adjust their performance profiles accordingly. If a device is running off a battery, for example, then it wouldn’t be wise to run high performance tasks that might lock the CPUs to near their maximum frequencies.

This kernel patch raises the question: Why does Google want to add this new power_supply_type now? Google does pay contractors to work on improving the overall security of the Linux kernel, but this patch doesn’t seem to be for general maintenance. Google recently committed to an “upstream first” development model for new features, which means they want to land new kernel code in the mainline Linux kernel first before merging it to the Android Common Kernel branches. Since Google has yet to submit a kernel driver that actually uses this new feature, though, this patch hasn’t landed in the mainline Linux kernel.

Google is holding off on merging this patch to the android13-5.10 ACK branch until the code is merged upstream.
Google is holding off on merging this patch to the android13-5.10 ACK branch until the code is merged upstream.

Google may not be ready to release their kernel driver yet, but they’ve begun work on the Android bits to “support Dock charging”. None of the Android-specific code changes reveal any useful information about Google’s plans for this feature, which is unsurprising given the nature of Google’s public versus private development. Yet I still find these code changes interesting.

The new "Dock" power supply type added to BatteryMonitor's power supply type map
The new "Dock" power supply type added to BatteryMonitor's power supply type map. Docks can charge devices either wirelessly (inductive charging) or wired (USB or POGO pins),  but this descriptor doesn’t differentiate.

Since the early days of Android, the platform has supported the concept of physical docks. The ACTION_DOCK_EVENT broadcast was introduced with Android 2.0 to notify apps of changes in the physical docking state of the device, while the UiModeManager class was introduced a few releases later with broadcasts that are sent when the device has been placed in a car or desk dock. Google’s documentation on docking also mentions other dock types introduced in Android 3.0, but more importantly, it also mentions that the dock state is “typically closely linked to the charging state as many docks provide power to docked devices.” It should go without saying that docks often provide power to devices that are docked to them, but this was always obvious, so why is Google now adding “dock” as a supported power supply type when the BatteryMonitor class is nearly a decade old.

Keep in mind that the Motorola Atrix with its laptop dock came out in 2011, so at that point in time, device makers thought physical docks would be all the rage. They obviously weren’t, but they seem to be making a resurgence, so the gossiper in me speculates that these recent changes have to do with an upcoming Pixel software or hardware feature. Exactly what that may be is something I don’t know, but it wouldn’t be the first time that a vague hint in AOSP led me to predict a Pixel feature.

Still, I admit my speculation lacks tangible evidence. I did notice that the Google engineer who’s working on dock charging support also submitted a series of code changes that improve charging support on foldables, and there’s considerable evidence that Google is working on its own foldable phone. In addition, one of the reviewers of these code changes is the Pixel team lead for charging and battery. Without additional evidence, though, I’d take any conclusions you might draw with a pinch of salt.

I decided to take a different approach to this week’s edition of Android Dessert Bites after nearly burning myself out from last week’s post on the security patch process (which I really recommend reading!) If you’re looking for the kind of in-depth explainer that I posted last week, then keep your eyes peeled for a future edition I have planned for Android Dessert Bites where I’ll talk about the incredibly important but woefully underdocumented Google Requirements Freeze program. Follow the Esper blog as well as I’ll be posting some articles there soon that cover unpublicized changes to the Android platform that are poised to have a profound impact.

Esper Device Management

FAQ

No items found.
No items found.

Keep Exploring

No items found.
Mishaal Rahman
Mishaal Rahman

Mishaal Rahman is a Technical Editor at Esper. He has been an Android user for over a decade and has been at the forefront of Android news coverage for half a decade. His in-depth breakdowns of new Android versions have been referenced across the Internet.

Mishaal Rahman
Learn about Esper mobile device management software for Android and iOS
Featured resource
Read more
Featured resource
Considerations for Building Android Apps for Company-Owned Devices
Your app delivers your customer (or employee) experience, making it a crucial piece of your overall solution. Use this guide to understand the considerations of designing and building your perfect app for dedicated device use cases on Android hardware.
Download the Guide

Esper is Modern Device Management

For tablets, smartphones, kiosks, point of sale, IoT, and other business-critical edge devices.
MDM Software
Kiosk mode icon as a feature in mobile device management software

Kiosk mode

Hardened device lockdown for all devices (not just kiosks)
App management icon as a feature in mobile device management software

App management

Google Play, Apple App Store, private apps, or a mix of all three
Devices groups icon as a feature in mobile device management software

Device groups

Manage devices individually, in user-defined groups, or all at once
Remote tools icon as a feature in mobile device management software

Remote tools

Monitor, troubleshoot, and update devices without leaving your desk
Touchless provisioning as a feature in mobile device management software

Touchless provisioning

Turn it on and walk away — let your devices provision themselves
Reporting and alerts as a feature in mobile device management software

Reporting and alerts

Custom reports and granular device alerts for managing by exception