동작 변경사항: 모든 앱

Android 14 플랫폼에는 앱에 영향을 줄 수 있는 동작 변경사항이 있습니다. targetSdkVersion과 관계없이 Android 14에서 실행되는 모든 앱에 적용되는 동작 변경사항은 다음과 같습니다. 이러한 변경사항을 적절히 지원해야 하는 경우 앱을 테스트한 후 필요에 따라 수정해야 합니다.

또한 Android 14를 타겟팅하는 앱에만 영향을 주는 동작 변경사항 목록을 검토해야 합니다.

핵심 기능

정확한 알람 예약은 기본적으로 거부됨

Exact alarms are meant for user-intentioned notifications, or for actions that need to happen at a precise time. Starting in Android 14, the SCHEDULE_EXACT_ALARM permission is no longer being pre-granted to most newly installed apps targeting Android 13 and higher—the permission is denied by default.

Learn more about the changes to the permission for scheduling exact alarms.

앱이 캐시되는 동안 컨텍스트 등록 브로드캐스트가 대기열에 추가됨

在 Android 14 中,当应用处于缓存状态时,系统可以将上下文注册的广播放入队列中。这与 Android 12(API 级别 31)为异步 binder 事务引入的队列行为类似。在清单中声明的广播不会加入队列,并且应用会从缓存状态中移除以进行广播传递。

当应用离开缓存状态(例如返回前台)时,系统会传递所有已加入队列的广播。某些广播的多个实例 可能会合并为一个广播。取决于其他因素,如系统 运行状况,则可能会从缓存状态中移除应用,以及之前排队 广播。

앱은 자체 백그라운드 프로세스만 종료할 수 있음

Android 14부터 앱이 killBackgroundProcesses()를 호출하면 API가 자체 앱의 백그라운드 프로세스만 종료할 수 있습니다.

다른 앱의 패키지 이름을 전달하면 이 메서드는 해당 앱의 백그라운드 프로세스에 영향을 미치지 않으며 Logcat에 다음 메시지가 표시됩니다.

Invalid packageName: com.example.anotherapp

앱은 killBackgroundProcesses() API를 사용하거나 이전 OS 버전에서도 다른 앱의 프로세스 수명 주기에 영향을 주려고 해서는 안 됩니다. Android는 캐시된 앱이 백그라운드에서 유지되고 시스템에 메모리가 필요할 때 자동으로 이를 종료하도록 설계되었습니다. 앱이 불필요하게 다른 앱을 종료하면 나중에 이러한 앱을 완전히 다시 시작해야 하므로 시스템 성능이 저하되고 배터리 소모가 늘어날 수 있습니다. 이로 인해 기존의 캐시된 앱을 재개하는 것보다 훨씬 많은 리소스가 소비됩니다.

MTU를 요청하는 첫 번째 GATT 클라이언트의 MTU가 517로 설정됨

Android 14부터 Android 블루투스 스택은 블루투스 핵심 사양 버전 5.2를 더 엄격하게 준수하고 첫 번째 GATT 클라이언트가 BluetoothGatt#requestMtu(int) API를 사용하여 MTU를 요청할 때 BLE ATT MTU를 517바이트로 요청하며 해당 ACL 연결에서 후속 MTU 요청을 모두 무시합니다.

이 변경사항을 해결하고 앱을 더 강력하게 만들려면 다음 옵션을 고려하세요.

  • 주변기기 기기는 Android 기기의 MTU 요청에 주변기기에서 수용할 수 있는 적절한 값으로 응답해야 합니다. 최종 협상된 값은 Android에서 요청한 값과 원격에서 제공한 값의 최솟값입니다 (예: min(517, remoteMtu)).
    • 이 수정사항을 구현하려면 주변기기의 펌웨어 업데이트가 필요할 수 있습니다.
  • 또는 알려진 지원되는 주변기기 값과 수신된 MTU 변경 값 중 최솟값을 기준으로 GATT 특성 쓰기를 제한합니다.
    • 헤더의 지원되는 크기에서 5바이트를 줄여야 한다는 알림
    • 예: arrayMaxLength = min(SUPPORTED_MTU, GATT_MAX_ATTR_LEN(517)) - 5

앱이 제한된 대기 버킷에 배치될 수 있는 새로운 이유

Android 14에서는 앱이 제한된 대기 버킷에 배치될 수 있는 새로운 이유를 도입합니다. 앱의 작업이 onStartJob, onStopJob 또는 onBind 메서드 시간 초과로 인해 ANR 오류를 여러 번 트리거합니다. onStartJobonStopJob의 변경사항은 JobScheduler가 콜백 및 네트워크 동작을 강화합니다를 참고하세요.

앱이 제한된 대기 버킷에 진입했는지 추적하려면 작업 실행 시 API UsageStatsManager.getAppStandbyBucket() 또는 앱 시작 시 UsageStatsManager.queryEventsForSelf()를 사용하여 로깅하는 것이 좋습니다.

mlock이 64KB로 제한됨

In Android 14 (API level 34) and higher, the platform reduces the maximum memory that can be locked using mlock() to 64 KB per process. In previous versions, the limit was 64 MB per process. This restriction promotes better memory management across apps and the system. To provide more consistency across devices, Android 14 adds a new CTS test for the new mlock() limit on compatible devices.

시스템에서 캐시된 앱 리소스 사용 강제 적용

By design, an app's process is in a cached state when it's moved to the background and no other app process components are running. Such an app process is subject to being killed due to system memory pressure. Any work that Activity instances perform after the onStop() method has been called and returned, while in this state, is unreliable and strongly discouraged.

Android 14 introduces consistency and enforcement to this design. Shortly after an app process enters a cached state, background work is disallowed, until a process component re-enters an active state of the lifecycle.

Apps that use typical framework-supported lifecycle APIs – such as services, JobScheduler, and Jetpack WorkManager – shouldn't be impacted by these changes.

사용자 환경

사용자가 닫을 수 없는 알림을 처리하는 방식 변경

如果您的应用向用户显示不可关闭的前台通知,请注意:Android 14 已更改此行为,允许用户关闭此类通知。

这项变更适用于阻止用户关闭前台的应用 将 Notification.FLAG_ONGOING_EVENT 设置为 Notification.Builder#setOngoing(true)NotificationCompat.Builder#setOngoing(true)FLAG_ONGOING_EVENT 的行为已发生变化,使用户实际上能够关闭此类通知。

在以下情况下,此类通知仍不可关闭:

  • 当手机处于锁定状态时
  • 如果用户选择全部清除通知操作(有助于防止意外关闭)

此外,这一新行为不适用于以下用例中的通知:

  • CallStyle 条通知
  • 企业设备政策控制器 (DPC) 和支持软件包
  • 媒体通知
  • 默认的搜索选择器软件包

데이터 보안 정보가 더 잘 보임

To enhance user privacy, Android 14 increases the number of places where the system shows the information you have declared in the Play Console form. Currently, users can view this information in the Data safety section on your app's listing in Google Play.

We encourage you to review your app's location data sharing policies and take a moment to make any applicable updates to your app's Google Play Data safety section.

Learn more in the guide about how data safety information is more visible on Android 14.

접근성

비선형 글꼴 크기 200%로 조정

从 Android 14 开始,系统支持字体放大高达 200%,为弱视用户提供了符合网络内容无障碍指南 (WCAG) 的其他无障碍功能选项。

如果您已使用放大像素 (sp) 单位来定义文本大小,这项更改可能不会对您的应用产生太大影响。不过,您应在启用最大字号 (200%) 的情况下执行界面测试,确保应用能够在不影响易用性的情况下适应较大的字号。

보안

설치 가능한 최소 대상 API 수준

从 Android 14 开始,targetSdkVersion 低于 23 的应用无法安装。要求应用满足这些最低目标 API 级别要求有助于提高用户的安全性和隐私性。

恶意软件通常会以较旧的 API 级别为目标平台,以绕过在较新版本 Android 中引入的安全和隐私保护机制。例如,有些恶意软件应用使用 targetSdkVersion 22,以避免受到 Android 6.0 Marshmallow(API 级别 23)在 2015 年引入的运行时权限模型的约束。这项 Android 14 变更使恶意软件更难以规避安全和隐私权方面的改进限制。尝试安装以较低 API 级别为目标平台的应用将导致安装失败,并且 Logcat 中会显示以下消息:

INSTALL_FAILED_DEPRECATED_SDK_VERSION: App package must target at least SDK version 23, but found 7

在升级到 Android 14 的设备上,targetSdkVersion 低于 23 的所有应用都将继续保持安装状态。

如果您需要测试以旧版 API 级别为目标平台的应用,请使用以下 ADB 命令:

adb install --bypass-low-target-sdk-block FILENAME.apk

미디어 소유자 패키지 이름이 수정될 수 있음

The media store supports queries for the OWNER_PACKAGE_NAME column, which indicates the app that stored a particular media file. Starting in Android 14, this value is redacted unless at least one of the following conditions is true:

  • The app that stored the media file has a package name that is always visible to other apps.
  • The app that queries the media store requests the QUERY_ALL_PACKAGES permission.

Learn more about how Android filters package visibility for privacy purposes.