OSDN Git Service

Expose BIND_NOT_PERCEPTIBLE service flag
authorAmith Yamasani <yamasani@google.com>
Mon, 17 Jun 2019 23:20:24 +0000 (16:20 -0700)
committerAmith Yamasani <yamasani@google.com>
Wed, 19 Jun 2019 21:40:57 +0000 (14:40 -0700)
commit5016a7891a8c5fe1c8ca5c24e83595b7973fc6b0
tree7c07b05ae1e668a78b0c9731729f864dc774b97b
parent1ed4ce01614fa082a809aceead0dea795fbd2c02
Expose BIND_NOT_PERCEPTIBLE service flag

Using this flag when binding to a service will
allow the bound process to be held at a low
oom_adj of 250, so that it can be expunged to
reclaim memory if a more user-visible app needs
it.

Use for bindings such as job services and other
connections that the caller can easily recover
from and restart if necessary.

Adjust the lmk thresholds to use this oom_adj
as one of the levels, so they're killed before
perceptible apps (such as foreground services).

Bug: 135219821
Test: CtsAppTestCases
      Manually check notification listener oom_adj
      and dumpsys activity services output

Change-Id: I9f6d0891d842e4d12f7995b9b1a8f57b0903a16d
api/current.txt
core/java/android/content/Context.java
core/proto/android/server/activitymanagerservice.proto
services/core/java/com/android/server/am/ConnectionRecord.java
services/core/java/com/android/server/am/OomAdjuster.java
services/core/java/com/android/server/am/ProcessList.java
services/core/java/com/android/server/job/JobServiceContext.java
services/core/java/com/android/server/notification/NotificationManagerService.java