Questions tagged [device-policy-manager]

DevicePolicyManager is a Java class in Android where device policies (password quality etc) can be set by a third party Device Administrator application.

Methods and constants in DevicePolicyManager are shown here:

http://developer.android.com/reference/android/app/admin/DevicePolicyManager.html

A tutorial to write a Device Administrator application can be found here:

http://developer.android.com/guide/topics/admin/device-admin.html

154 questions
28
votes
4 answers

How to make an application default phone or Assistant handler on the device by giving user an option to make it default app

We have received a policy notice from playStore as: Your app manifest requests the Call Log permission group (e.g. READ_CALL_LOG, WRITE_CALL_LOG, PROCESS_OUTGOING_CALLS) It must be actively registered as the default Phone or Assistant handler on the…
Wasim
  • 386
  • 1
  • 4
  • 12
20
votes
6 answers

How to remove set-device-owner in Android DPM?

I have made an app device owner using ADB, by following this link : How to make my app a device owner? but now, I'm not able to revert this. In the device administration Tab, this option is disabled. Not able to change the value of this app.
KKSINGLA
  • 1,284
  • 2
  • 10
  • 22
18
votes
4 answers

How to programmatically set a lock or pin for an app

So right now I am trying to develop an Android App for my young children. I want to set a pin or passwords on selected applications for a particular amount of time to prevent them from opening the app. For example, let's say that my daughter wants…
17
votes
3 answers

Screen pinning 3rd party apps programmatically

After achieving device ownership, I am trying to implement a method to instruct the device to lock any given app into kiosk mode (or screen pinning mode). Since I have device ownership, the user is not asked for the permission to do so. From the…
13
votes
1 answer

How to find an app's available restrictions for DevicePolicyManager.setApplicationRestrictions

The new Android Lollipop API provides a new pair of methods for getting and setting restrictions on other apps: DevicePolicyManager.getApplicationRestrictions and DevicePolicyManager.setApplicationRestrictions There's an example of them being used…
10
votes
1 answer

How do I get the signature checksum of my APK that is signed with only the v2 scheme?

I previously posted a question on how to get the signature checksum of my APK here: How do I get the signature checksum of my APK? The answer is perfect if an app is signed with the v1 signature scheme or the combination v1/v2 signature schemes.…
9
votes
2 answers

devicePolicyManager.lockNow() is not working for Motorola Tablets

public final static void lockDevice() { try { if (devicePolicyManager.isAdminActive(adminComponent)) { devicePolicyManager.lockNow(); } } catch (final Exception…
PC.
  • 6,870
  • 5
  • 36
  • 71
9
votes
3 answers

Is it possible to have a "Profile Owner" app in Android Lollipop that is not co-present

The Lollipop API provides 2 new features "Profile Owner" and "Device Owner" (http://developer.android.com/about/versions/android-5.0.html#Enterprise). Between them, they offer just the features I need for an app that parents can use to control their…
8
votes
2 answers

Android 12 Device Owner Provisioning

I have an application, that can be successfully setup as Device Owner on devices up to Android 12 via QR code from JSON…
8
votes
5 answers

Android - how to completely disable keyguard

I want to control enabling/disabling keyguard on the device. To do that I'm using DevicePolicyManager and KeyguardLock API of Android SDK. Below is my implementation to manage this: public class DeviceLocker { private static DeviceLocker…
kowalski
  • 81
  • 1
  • 1
  • 3
7
votes
3 answers

Android Device Policy sync does not work until done manually

We have some android devices attached to Android Management API as fully managed work devices. Now when we push out some changes to the device policy such as Factory Reset Disabled, Adjust Volume Button Disabled or any other such controls, the…
7
votes
1 answer

How do I get the signature checksum of my APK?

I would like to use the signature checksum instead of the package checksum when provisioning a device with a device owner app. The app will be downloaded from an http server. This post is great when using…
6
votes
3 answers

Run intent DevicePolicyManager.ACTION_ADD_DEVICE_ADMIN from a service

I have a service and I want the service promote to enable it as Device Admin, until now I launched this kind of UI interactions from the service like Intent intent2 = new Intent(); intent2.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); …
Zorb
  • 726
  • 11
  • 24
6
votes
0 answers

Android: Detect whether device can be unlocked with fingerprint

I have an app that uses fingerprint-authentication. As an extra security-measure I'd like to detect whether the fingerprint is used to unlock the device. I tried retrieving the lock-mode in the following way: long mode =…
6
votes
1 answer

Detect programmatically if an Android device is able to do storage encryption

I am developing an Android App that starts the process of encrypting data on the device. I am detecting the encryption status with this code : int encrypted = 0; device_policy_manager = (DevicePolicyManager)…
1
2 3
10 11