Add logic to take action in your app. } override fun onStart() { registerScreenCaptureCallback(mainExecutor, screenCaptureCallback) } override fun onStop() { unregisterScreenCaptureCallback(screenCaptureCallback) } New Feature User Experience
partial access to their photos and videos when an app requests any visual media permissions that were introduced in Android 13. Behavior Changes: All Apps User Experience
to use USE_FULL_SCREEN_INTENT permission are limited to those that provide calling or alarms only. And users can turn this permission on and off. To support this changes • Use NotificationManager.canUseFullScreenIntent to check the permission. • Use ACTION_MANAGE_APP_USE_FULL_SCREEN_INTENT to launch the settings page. User Experience
set • Notification.Builder#setOngoing(true) • NotificationCompat.Builder#setOngoing(true) to prevent users dismissing foreground notification will be dismissable by the user. Behavior Changes: All Apps User Experience
the phone is locked • User selects a Clear all notification action • Notifications tied to real calls using CallStyle • Notifications created using MediaStyle Behavior Changes: All Apps User Experience
dialog now includes a clickable section that highlights your app's data sharing practices for some permission. Behavior Changes: All Apps User Experience
with a targetSdkVersion lower than 23 can't be installed. Requiring apps to meet these minimum target API level requirements improves security and privacy for users. // build.gradle (module) android { defaultConfig { targetSdk 22 } } Security
OWN_PACKAGE_NAME column in media store is redacted unless at least one of the following condition is true: • App that stored the media file has a package name that is always visible to other apps. • App that queries the media store requests the QUERY_ALL_PACKAGES permission. Behavior Changes: All Apps Security
Restricts apps from sending implicit intents to internal app components in the following ways: • Implicit intents are only delivered to exported components. • Mutable pending intent that doesn't specify a component or package Security
when targeting Android 14. context.startActivity(Intent("com.example.action.APP_ACTION")) // This makes the intent explicit. val intent = Intent("com.example.action.APP_ACTION").apply { setPackage(context.packageName) } context.startActivity(intent) Behavior Changes: Targeting 34 Security
as read-only. val jar = File("DYNAMICALLY_LOADED_FILE.jar") FileOutputStream(jar).use { // Set the file to read-only first to prevent race conditions jar.setReadOnly() // Then write the actual file content } val pathClassLoader = PathClassLoader(jar, parentClassLoader) Behavior Changes: Targeting 34 Security
you try to dynamically load them again in your app. Alternatively, verify the integrity of the files and re-label the existing files as read-only Behavior Changes: Targeting 34 Security
.. or start with / will throw a ZipException . Or calling dalvik.system.ZipPathValidator.clearCallback() to opt-out from this validation. Zip path traversal Behavior Changes: Targeting 34 Security
further restricts when apps are allowed to start activities from the background. • Sends a PendingIntent using PendingIntent#send() and wants to grant its own privileges to start the pending intent. • A visible app binds a service of another app that's in the background using the bindService() method and want to grant its own privileges to the bound service. Behavior Changes: Targeting 34 Security
Apps • Test your app with non-linear font scaling • Open the Settings app and navigate to Accessibility > Display size and text • Use scaled pixel (sp) units for text-sizes • Convert scaled pixel (sp) units • Use TypedValue.applyDimension() to convert from sp units to pixels • Use TypedValue.deriveDimension() to convert pixels to sp Accessibility
Apps The SCHEDULE_EXACT_ALARM permission is no longer being pre-granted, the permission is denied by default. • Targets Android 13 (API level 33) or higher • Declares the SCHEDULE_EXACT_ALARM permission in the manifest • Isn't a calendar or alarm clock app • Doesn't fall under an exemption or pre-grant scenario Core Functionality
Apps val manager: AlarmManager = context.getSystemService(AlarmManager::class.java) when { manager.canScheduleExactAlarms() -> { // If permission is granted, proceed with scheduling exact alarms manager.setExact(...) } else -> { // Ask users to go to exact alarm page in system settings startActivity(Intent(Settings.ACTION_REQUEST_SCHEDULE_EXACT_ALARM)) } } Core Functionality
at least one foreground service type for each foreground service within your app <manifest ...> <uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> <uses-permission android:name="android.permission.FOREGROUND_SERVICE_LOCATION" /> <application ...> <service android:name=".LocationTrackingService" android:exported="false" android:foregroundServiceType="location" /> </application> </manifest> Core Functionality