Questions tagged [device-admin]

The Device Administration API for Android 2.2 and later allows applications to enforce security policies by requiring a password or encryption, and to lock or wipe the device programmatically.

Android 2.2 introduces support for enterprise applications by offering the Android Device Administration API. Administrators can enforce password policies — including alphanumeric passwords or numeric PINs — across devices. Administrators can also remotely wipe (that is, restore factory defaults on) lost or stolen handsets.

226 questions
5
votes
1 answer

Android Device Administrator / Profile owner

I'm trying to know how Device Administrator and Profile Owner works. I followed some examples from google website, but I still do not quite know how profile owner works. To test this, I've built a sample app which will ask the user to accept the…
Luis Pereira
  • 1,481
  • 3
  • 19
  • 46
5
votes
2 answers

Android Lollipop becoming device admininistrator doesn't work

I'm following this guide on how to have my app request to become a device administrator. This works great on any 4.x android versions with any phone, but doesn't work on Lollipop (I've tried on a Nexus 5 and on a Nexus 7). Logcat shoes the following…
Eran
  • 2,324
  • 3
  • 22
  • 27
5
votes
1 answer

How do disable lockscreen in android?

I have my app registered as device administrator, with the appropriate lock screen permissions. I can access the method to lock the device, but cannot disable lockscreen. Is there an API method available that will disable lock?
munkay
  • 1,883
  • 2
  • 16
  • 15
5
votes
0 answers

Empty Constructor exception in DeviceAdminReceiver

E/AndroidRuntime(27856): java.lang.RuntimeException: Unable to instantiate receiver com.inc.statusbar.Statusbar$DeviceAdminSampleReceiver: java.lang.InstantiationException: can't instantiate class…
Mihir
  • 2,064
  • 2
  • 21
  • 28
5
votes
2 answers

Lock android phone

I am trying to lock a device programmatically when the user presses a button. I am aware that I will need to use deviceAdminReciever and I have done so but my app crashes whenever I run it The following is my manifest:
Ankush
  • 791
  • 2
  • 9
  • 20
4
votes
2 answers

Work around for Device admin api does not own profile

I was working my way through the device admin api, and while invoking the setPermissionGrantState function on the DevicePolicyManager I got Unable to start receiver com.xx.admin.receivers.AdminReceiver: java.lang.SecurityException: Admin…
humblerookie
  • 4,717
  • 4
  • 25
  • 40
4
votes
2 answers

Android "Not granting permission" error

I've been recently exploring the device administration APIs, and i've found that neither my code, nor the sample code on the android developing website have been able to enable the device administration. The error i get on launching is: 12-28…
Jainathan Leung
  • 1,147
  • 2
  • 15
  • 27
4
votes
1 answer

Android device administrator - Disable camera not applied in (Multi-user) Guest account

I have implemented a device administrator application that disables the camera, among other things, based on certain requisites (server side logic) etc. devicePolicyManager = (DevicePolicyManager)…
staticvoid
  • 261
  • 3
  • 9
4
votes
0 answers

Android M and Device Admin Applications

I have a device admin application that supports android devices with API 8+. I am checking how the changes of Android M might affect my current application. It turned out now the user has the option to turn off certain permissions even though device…
4
votes
3 answers

APN setup programmatically in Android

I am setting up an APN programmatically in Android. when I run the code I am getting Security Exception :android.permission.WRITE_APN_SETTINGS. if I mentioned this permission in manifest, I'm getting error like these permission only SYSTEM APPS. …
4
votes
2 answers

How to SET and UNSET lock screen password in Android programatically

I want to set lock screen password programatically and then remove when the loop is executed. I have added Device Administration successfully, can someone help me to SET and UNSET lock screen password from my application itself. Below is my working…
user45678
  • 1,504
  • 6
  • 29
  • 58
4
votes
1 answer

DevicePolicyManger().getCurrentFailedPasswordAttempts crashes app

Seems like some of the DeviceAdmin functionality has been broken in Lollipop, at least on my Nexus 5. This works perfectly on KitKat, JellyBean and Ice Cream Sandwich @Override public void onPasswordFailed(Context context, Intent intent) { …
Jakob Harteg
  • 9,587
  • 15
  • 56
  • 78
4
votes
1 answer

Android - Password Protected Device Admin Disablement

so here's the problem: I'm trying to create a Device Admin app where when the user attempts to disable the admin functionality of the app, he is prompted for a password, and if he fails to input the correct password, the app keeps admin privileges. …
4
votes
2 answers

Device Administrator rights disabled on phone restart

I have created an android application with device admin rights. It was working properly on my Moto G and many other devices. In Sony Xperia C, the device administrator rights disabled automatically on phone restart. Is anyone come across such issue?…
venkat
  • 517
  • 1
  • 8
  • 29
4
votes
1 answer

How to unlock phone using DevicePolicyManager

I know how to lock device using DevicePolicyManager.. boolean active = mDPM.isAdminActive(mDeviceAdminSample); if (active) mDPM.lockNow(); but how to undo this(unlock a phone)?
Atul Bhardwaj
  • 6,647
  • 5
  • 45
  • 63
1 2
3
15 16