Struct AdbShellDpm

Source
pub struct AdbShellDpm { /* private fields */ }

Implementations§

Source§

impl AdbShellDpm

Source

pub fn new() -> Self

Source

pub fn name(&mut self, name: String) -> &mut Self

Source

pub fn user_id(&mut self, user_id: String) -> &mut Self

Source

pub fn set_active_admin(&mut self, set_active_admin: bool) -> &mut Self

Sets component as active admin.

Options are:

  • --user user_id: Specify the target user. You can also pass --user current to select the current user.
Source

pub fn set_profile_owner(&mut self, set_profile_owner: bool) -> &mut Self

Sets component as active admin and its package as profile owner for an existing user.

Options are:

  • --user user_id: Specify the target user. You can also pass –user current to select the current user.
  • --name name: Specify the human-readable organization name.
Source

pub fn set_device_owner(&mut self, set_device_owner: bool) -> &mut Self

Sets component as active admin and its package as device owner.

Options are:

  • --user user_id: Specify the target user. You can also pass –user current to select the current user.
  • --name name: Specify the human-readable organization name.
Source

pub fn remove_active_admin(&mut self, remove_active_admin: bool) -> &mut Self

Disables an active admin. The app must declare android:testOnly in the manifest. This command also removes device and profile owners.

Options are:

  • --user user_id: Specify the target user. You can also pass –user current to select the current user.
Source

pub fn clear_freeze_period_record( &mut self, clear_freeze_period_record: bool, ) -> &mut Self

Clears the device’s record of previously-set freeze periods for system OTA updates. This is useful to avoid the device’s scheduling restrictions when developing apps that manage freeze-periods. See [Manage system updates].

Supported on devices running Android 9.0 (API level 28) and higher.

Source

pub fn force_network_logs(&mut self, force_network_logs: bool) -> &mut Self

Forces the system to make any existing network logs ready for retrieval by a DPC. If there are connection or DNS logs available, the DPC receives the onNetworkLogsAvailable() callback. See Network activity logging.

This command is rate-limited. Supported on devices running Android 9.0 (API level 28) and higher.

Source

pub fn force_security_logs(&mut self, force_security_logs: bool) -> &mut Self

Forces the system to make any existing security logs available to the DPC. If there are logs available, the DPC receives the onSecurityLogsAvailable() callback. See Log enterprise device activity.

This command is rate-limited. Supported on devices running Android 9.0 (API level 28) and higher.

Source

pub fn run(&self) -> Result<()>

Trait Implementations§

Source§

impl Clone for AdbShellDpm

Source§

fn clone(&self) -> AdbShellDpm

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Default for AdbShellDpm

Source§

fn default() -> AdbShellDpm

Returns the “default value” for a type. Read more

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.