Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c172cb7c authored by Sudheer Shanka's avatar Sudheer Shanka
Browse files

Allow clients to register for listening to changes in capabilities.

Clients can register for listening to changes in procstates and if
they are only interested in knowing if the procstate crosses a certain
threshold, they can specify a "cutpoint" and they will only get
a callback if the procstate crosses that "cutpoint" but clients cannot
use this if they are also interested in changes in capabilities. So,
add a way for clients to use the "cutpoint" facility and also listen
to changes in capabilities.

Bug: 177641226
Test: atest services/tests/servicestests/src/com/android/server/am/ActivityManagerServiceTest.java
Test: atest services/tests/servicestests/src/com/android/server/am/UidObserverControllerTest.java
Test: atest ./tests/cts/hostside/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java
Change-Id: I50c711a7572a2797fd31630c1a38d04a2fe6cbeb
parent 0e796939
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -41,7 +41,11 @@ public:
        // Flag for registerUidObserver: report uid has become idle
        UID_OBSERVER_IDLE = 1<<2,
        // Flag for registerUidObserver: report uid has become active
        UID_OBSERVER_ACTIVE = 1<<3
        UID_OBSERVER_ACTIVE = 1<<3,
        // Flag for registerUidObserver: report uid cached state has changed
        UID_OBSERVER_CACHED = 1<<4,
        // Flag for registerUidObserver: report uid capability has changed
        UID_OBSERVER_CAPABILITY = 1<<5,
    };

    // PROCESS_STATE_* must come from frameworks/base/core/java/android/app/ProcessStateEnum.aidl.