summaryrefslogtreecommitdiff
path: root/startop/scripts/lib/cmd_utils.py
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2019-09-07 10:18:23 -0600
committerJeff Sharkey <jsharkey@android.com>2019-09-09 10:05:27 -0600
commit462062c91cc2bad6d289ded27d3d5d7b53e224fb (patch)
treec5a655201ad5a9ec9cffcb34a82337008039dabf /startop/scripts/lib/cmd_utils.py
parent4827332e4fc5eb67608c8444829253c982ce613b (diff)
Selectively delay ContentObservers based on state.
While optimizing MediaProvider operations, we noticed that many background apps register ContentObservers which end up stampeding after any change is notified. This can starve the device of precious CPU/RAM needed while a Camera app is still trying to persist heavy operations such as a burst capture. The initial mitigation was to simply delay all notifications while a camera session was active, but OEMs have informed us that in a multi-window environment it's important that foreground apps not be subject to these delays. Thus, to strike a balance, this change moves the delaying logic into ContentService, where we only dispatch immediate notifications to foreground apps. Background apps will still hear about the changes, but they'll be delayed several seconds to avoid the stampeding described above. Bug: 140249142 Test: atest --test-mapping packages/providers/MediaProvider Change-Id: I0bffc49c116eef35c5bc4e1b24745e8e9e0974d6
Diffstat (limited to 'startop/scripts/lib/cmd_utils.py')
0 files changed, 0 insertions, 0 deletions