Exploring the Latest Features in Android 17 QPR2

The Android Open Source Project (AOSP) has recently introduced Android 17 QPR2 (SDK 37.2), continuing its commitment to an open-source ecosystem. This update empowers developers and device manufacturers by providing transparent access to the platform code, enabling them to inspect the operating system’s functionality, debug issues confidently, and create innovative applications.
Key Improvements in Android 17 QPR2
Building on the foundation laid by Android 17 and QPR1 (SDK 37.1), QPR2 brings several targeted platform APIs and runtime enhancements for Android devices, including phones, foldables, and tablets. While there are no changes to target-SDK behavior, the update includes runtime improvements that all apps should verify.
Memory Management Enhancements
One of the standout features in Android 17 QPR2 is the introduction of App Memory Budgets. This allows apps to declare soft working-set targets for their packages or individual processes. If an app exceeds its memory budget, the operating system will take action by reclaiming cold pages specifically for that app. This mechanism helps maintain system stability while allowing the app to keep its working set in memory.
Additionally, developers can utilize the new MemoryBudgetManager to register a background pressure listener and manage memory budgets effectively. Alongside this, QPR2 enforces stricter device-wide app memory limits to terminate processes that exhibit runaway memory leaks.
Enhanced App Diagnostics and Performance
QPR2 (SDK 37.2) expands the ApplicationExitInfo, providing dedicated exit reasons along with structured ANR (Application Not Responding) metadata. This enhancement aids developers in diagnosing app behavior more effectively.
Another significant improvement is the addition of the registerOnJankDataListener() method for SurfaceView and SurfaceControl. This feature allows applications, including games and camera viewfinders, to monitor frame presentation times accurately, enhancing the overall user experience.
Optimized Broadcasts and Security Features
Starting with Android 17 QPR2, self-broadcasts are optimized for all apps, regardless of their target SDK version. This means that broadcasts sent by an app will be processed within the same process, improving efficiency. However, undelivered self-broadcasts will be lost if the process is terminated.
Moreover, the update includes mechanisms to prevent circular lock-inversion deadlocks in RemoteCallbackList, ensuring smoother operation for apps that rely on callbacks.
Modernizing the User Interface
Android 17 QPR2 also brings significant upgrades to the Picture-in-Picture (PiP) mode, enhancing the experience on various devices. New APIs have been introduced to implement backdrop blurring and other visual effects, such as frosted glass. Developers can now use the setBackdropRenderEffect() method to easily incorporate these effects into their app’s user interface.
For media applications, the SurfaceView.setBlurRegions() method allows developers to blur areas behind video player controls, creating a more visually appealing experience when controls appear or disappear.
Streamlined Permissions Management
In this update, when an app launches intents like ACTION_SEND with content URIs, the system now automatically grants read access to the target app. However, there are plans to revise this automatic permission granting in future releases. Developers are encouraged to use the StrictMode.VmPolicy.Builder.detectImplicitUriPermissionGrant() in debug builds to identify intents that depend on implicit grants and to implement explicit permission flags where necessary.
Overall, Android 17 QPR2 (SDK 37.2) introduces a range of enhancements that improve memory management, app diagnostics, user interface design, and security. These updates not only empower developers to create more efficient applications but also enhance the overall user experience across Android devices.
Source for the original facts: Original source.




