Android Q is not just another incremental update, and instead brings fundamental changes to Google‘s mobile operating system. The software is currently available in the form of a beta for 21 devices including Google’s own Pixel lineup. While it brings a number of changes including new ways to push security updates, an improved gesture-based navigation interface, there are some tiny features that could have impact on user experience as well. Google has added and removed some APIs that developers could target, two of the interesting new APIs added to the platform is called AudioPlaybackCapture and Thermal APIs.
Recording Audio from other Apps
With AudioPlaybackCapture API, Google will not only allow Android Q users to capture videos of their screen, but also record audio from other apps. With mobile gaming becoming a big focus for smartphone users and a number of them recording and posting their gameplay to streaming video services, the big pain has been recording audio alongside the video. The MediaProjection API currently targeted by developers does not allow third-party apps to record the internal audio output in other apps and forces them to use third-party screen recorders. While Samsung and Huawei offer tools to record internal audio output during a screen recording, Google has mostly stayed away from adding such a feature.
With Android Q, Google seems to have had a change of heart and developers will be able to enable support using AudioPlayback Capture API. Google describes it as an analog of screen capture but for audio recording. The only app to use the API is Google’s Live Caption, which adds caption to any video being played on the device. The primary purpose of the API, according to XDA Developers, is to allow streaming apps like Twitch or YouTube Gaming to capture the audio being played by games. Google is also imposing strict restrictions and the app whose audio is being recorded and the app capturing the audio must meet certain requirements.
Thermal API to check Throttling with Android Q
Another new API being added to Android Q is the Thermal API, which adds more transparency around the way apps are impacted by thermal throttling on their device. Thermal throttling happens whenever a device is stressed for performance or when resources are deployed elsewhere forcing most devices to throttle the CPU and GPU speeds. Developers do not have control on thermal throttling but with the new Thermal API in Android Q, apps will be able to receive callbacks for different stages of performance throttling or detriments in performance.
Watch: Android Q How to install
This will allow developers to reduce the strain caused by ramping down on activities requiring significant amount of CPU, GPU or modem use. XDA Developers notes that developers will be able to use this new API by registering a listener in PowerManager (addThermalStatusListener) and the system will then send the app one of the following thermal status codes:
THERMAL_STATUS_NONE: “Not under throttling.”
THERMAL_STATUS_LIGHT: “Light throttling where UX is not impacted.”
THERMAL_STATUS_MODERATE: “Moderate throttling where UX is not largely impacted.”
THERMAL_STATUS_SEVERE: “Severe throttling where UX is largely impacted.”
THERMAL_STATUS_CRITICAL: “Platform has done everything to reduce power.”
THERMAL_STATUS_EMERGENCY: “Key components in platform are shutting down due to thermal condition. Device functionalities will be limited.”
THERMAL_STATUS_SHUTDOWN: “Need shutdown immediately.”
The support for the new Thermal API not only requires Android Q but also requires addition of a new HAL. Google has confirmed that its Pixel devices on Android Q support the Thermal API and the company plans to work with its partners to add support for other devices.