Skip to main content

UidObserverCodes

Struct UidObserverCodes 

Source
pub struct UidObserverCodes {
    pub register_code: u32,
    pub unregister_code: u32,
    pub register_for_uids_code: Option<u32>,
    pub on_gone_code: u32,
    pub on_active_code: u32,
    pub on_idle_code: u32,
    pub on_cached_code: u32,
    pub on_state_code: u32,
    pub on_adj_code: u32,
}
Expand description

Uid lifecycle observer tx codes (uid-scoped, event-driven both ways).

registerUidObserver(observer, which, cutpoint, callingPackage) reports per-uid lifecycle events: onUidGone (no more processes for the uid), onUidActive (uid is no longer idle), onUidIdle, onUidCachedChanged (cached state changed), plus onUidStateChanged/onUidProcAdjChanged when the corresponding UID_OBSERVER_* flags are requested. The daemon pins the app’s uid at handoff, so it can filter these events on that single uid — no pid resolution, no /proc, no retry loop.

registerUidObserverForUids (added in S) is the filtered variant that only delivers events for a caller-supplied uid list; it requires the caller to hold PACKAGE_USAGE_STATS (or PERMISSION_GRANTED via root/system canAccessUnexportedComponents).

Fields§

§register_code: u32

TRANSACTION_registerUidObserver on IActivityManager$Stub

§unregister_code: u32

TRANSACTION_unregisterUidObserver on IActivityManager$Stub

§register_for_uids_code: Option<u32>

TRANSACTION_registerUidObserverForUids on IActivityManager$Stub (filtered variant, API 31+)

§on_gone_code: u32

TRANSACTION_onUidGone on IUidObserver$Stub

§on_active_code: u32

TRANSACTION_onUidActive on IUidObserver$Stub

§on_idle_code: u32

TRANSACTION_onUidIdle on IUidObserver$Stub

§on_cached_code: u32

TRANSACTION_onUidCachedChanged on IUidObserver$Stub

§on_state_code: u32

TRANSACTION_onUidStateChanged on IUidObserver$Stub

§on_adj_code: u32

TRANSACTION_onUidProcAdjChanged on IUidObserver$Stub

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.