Struct android_tools::adb::AdbShellDpm
source · [−]pub struct AdbShellDpm { /* private fields */ }
Implementations
sourceimpl AdbShellDpm
impl AdbShellDpm
pub fn new() -> Self
pub fn name(&mut self, name: String) -> &mut Self
pub fn user_id(&mut self, user_id: String) -> &mut Self
sourcepub fn set_active_admin(&mut self, set_active_admin: bool) -> &mut Self
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.
sourcepub fn set_profile_owner(&mut self, set_profile_owner: bool) -> &mut Self
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.
sourcepub fn set_device_owner(&mut self, set_device_owner: bool) -> &mut Self
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.
sourcepub fn remove_active_admin(&mut self, remove_active_admin: bool) -> &mut Self
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.
sourcepub fn clear_freeze_period_record(
&mut self,
clear_freeze_period_record: bool
) -> &mut Self
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.
sourcepub fn force_network_logs(&mut self, force_network_logs: bool) -> &mut Self
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.
sourcepub fn force_security_logs(&mut self, force_security_logs: bool) -> &mut Self
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.
pub fn run(&self) -> Result<()>
Trait Implementations
sourceimpl Clone for AdbShellDpm
impl Clone for AdbShellDpm
sourcefn clone(&self) -> AdbShellDpm
fn clone(&self) -> AdbShellDpm
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Default for AdbShellDpm
impl Default for AdbShellDpm
sourcefn default() -> AdbShellDpm
fn default() -> AdbShellDpm
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl RefUnwindSafe for AdbShellDpm
impl Send for AdbShellDpm
impl Sync for AdbShellDpm
impl Unpin for AdbShellDpm
impl UnwindSafe for AdbShellDpm
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more