2025년 3월 27일부터 AOSP를 빌드하고 기여하려면 aosp-main
대신 android-latest-release
를 사용하는 것이 좋습니다. 자세한 내용은 AOSP 변경사항을 참고하세요.
앱 백그라운드 동작 추적기
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
Android 13은 전력 소비 추적기 개념을 도입했습니다. 이는 앱의 포그라운드 또는 백그라운드 배터리 사용량을 모니터링하여 앱이 일부 정책을 위반하는지 확인하는 프로세스입니다.
Android 13에는 두 가지 전력 소비 추적기, 즉 포그라운드 서비스 추적기와 백그라운드 배터리 사용량 추적기가 있습니다. 자체 메커니즘을 사용하여 앱의 배터리 악용을 판단하는 대신 이러한 추적기를 사용하여 과도한 배터리 사용량을 모니터링하고 사용자에게 알리는 것이 좋습니다.
포그라운드 서비스 추적기
포그라운드 서비스는 장시간 배터리를 실행하고 사용할 수 있습니다.
포그라운드 서비스 추적기는 포그라운드 서비스가 오랫동안 실행되고 있지만 보이지 않는 경우(예: 사용자가 서비스의 알림을 닫음) 사용자에게 알림을 표시합니다. 사용자가 알림을 클릭하면 작업 관리자가 표시되고 작업 관리자를 통해 사용자는 포그라운드 서비스를 중지할 수 있습니다. 이 추적기는 기본적으로 사용 설정되어 있습니다.
백그라운드 배터리 사용량 추적기
사용자가 모르는 사이 앱이 백그라운드에서 배터리를 소모할 수 있습니다. 백그라운드 배터리 추적기는 각 앱의 배터리 사용량을 감시합니다. 이 컨텍스트에서 배터리 사용량은 세 가지 측정기준으로 정의됩니다. 즉 상단의 포그라운드 앱, 보이지 않는 것을 실행하는 포그라운드 서비스, 앱의 백그라운드 부분입니다. 앱 배터리 사용량의 백그라운드 부분이 일정 기준점을 초과하면 앱을 제한된 버킷으로 이동하여 매일 하나의 작업으로 앱을 제한합니다. 이 추적기는 기본적으로 사용 중지되어 있습니다. 이 추적기를 사용 설정하려면 다음 명령어를 실행합니다.
adb shell device_config put activity_manager bg_auto_restrict_abusive_apps 1
adb shell device_config put activity_manager bg_current_drain_auto_restrict_abusive_apps_enabled 1
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 Oracle 계열사의 상표 또는 등록 상표입니다.
최종 업데이트: 2025-07-27(UTC)
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-07-27(UTC)"],[],[],null,["# App background behavior trackers\n\nAndroid 13 introduces the concept of a\n*power consumption tracker*, which is a process that monitors foreground or\nbackground battery usage by apps to determine if apps violate some policy.\nAndroid 13 contains two power consumption trackers:\nthe foreground service tracker and background battery usage tracker. As opposed\nto using your own mechanisms to determine battery abuse by apps, we\nrecommend using these trackers to monitor and alert users of excessive battery\nusage.\n\nForeground service tracker\n--------------------------\n\nForeground services can execute and use battery for an extended period of time.\nThe foreground service tracker displays a notification to users when a\nforeground service has been running for a long period of time but is invisible,\nsuch as when a user has dismissed the service's notification. If the user\nclicks the notification, the task manager is displayed and lets\nthe user stop the foreground service. This tracker is enabled by default.\n\nBackground battery usage tracker\n--------------------------------\n\nApps can drain battery in the background without the user being aware. The\nbackground battery tracker watches battery usage for each app. Battery usage\nin this context is defined by three dimensions: foreground app on top,\nforeground service running something that isn't visible, and background part of\napp. If the background portion of the app's battery usage crosses some threshold,\nthe app is moved into a restricted bucket limiting it to one job per day. This\ntracker is disabled by default. To enable this tracker, run the following\ncommands: \n\n adb shell device_config put activity_manager bg_auto_restrict_abusive_apps 1\n adb shell device_config put activity_manager bg_current_drain_auto_restrict_abusive_apps_enabled 1"]]