Skip to content
Commit 690c1ed1 authored by Austin Borger's avatar Austin Borger
Browse files

UidObserver / Camera: Track the OOM adj of a uid via UidObserver.

Previously, onUidProcAdjChanged merely signaled that the OOM adj of a
uid changed, but did not provide the actual OOM adj score. Having this
information allows the camera service to cut out redundant calls to
onCameraAccessPrioritiesChanged and avoid overwhelming apps.

The number of calls to onCameraAccessPrioritiesChanged is reduced by
only signaling when it's likely the uid owning a camera would lose
access to it if another uid tried to open that camera. This is opposed
to the status quo, which signals every time a watched uid changes its
OOM adj, which is highly inefficient.

Bug: 274486653
Test: -- on physical device:
      -- testCamera2AccessCallbackInSplitMode x10
      -- ActivityManagerServiceTest
      -- ActivityManagerProcessStateTest
      -- ActivityManagerFgsBgStartTest
      -- UidObserverControllerTest
      -- Alternate focus in split screen between Camera2 + GCA x20
Change-Id: I994bf56d8e1687460149626a3a658851ca9513c4
parent 49faea59
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment