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
6
votes
2 answers

How to enable Non market application in Managed Profile (Android 5.0) programmatically

Hello I was checking Android 5.0 samples there was sample BasicManagedProfile. Using that I have created managed profile successfully. But it was managing only Market applications (Downloaded from Google Play) as managed application. But I tried…
5
votes
1 answer

PackageManager.getPackageArchiveInfo with GET_SIGNING_CERTIFICATES returning null signing info

I am trying to get the signatures from an apk file prior to installing, however I am getting null signingInfo object. The PackageInfo is properly populated with all of the other data related to the package. If I install the apk, then use…
JeremyK
  • 1,075
  • 1
  • 22
  • 45
5
votes
0 answers

Setting proxy username and password for Android setRecommendedGlobalProxy

I'm trying to set a network independent proxy server to an android device using setRecommendedGlobalProxy method. ProxyInfo proxyInfo = ProxyInfo.buildDirectProxy(hostname, port); devicePolicyManager.setRecommendedGlobalProxy(deviceAdmin,…
madawa
  • 496
  • 6
  • 24
5
votes
2 answers

Android - Allowing installation of non-market-apps fails in device owner app

I'm trying to set the security setting "Unknown Sources - Allow installation of apps from unknown sources" programmatically. For this, the DevicePolicyManager (with level 21) provides a function ("SetSecureSetting") to set this setting (only…
Arne
  • 53
  • 1
  • 5
5
votes
0 answers

Android DevicePolicyManager locknow() not working in Lollipop

I'm locking and unlocked the lock screen. Unlocking via boolean result = devicePolicyManager.resetPassword( "", 0 ); devicePolicyManager.lockNow(); In Lollipop, it turns the screen off (expected) and when you turn it on - instead of the swipe…
dashman
  • 2,858
  • 3
  • 29
  • 51
5
votes
0 answers

How to communicate between apps in profile owner and device in android lollipop?

I am developing a DPM application. After creating a provising profile, I can see two copy of my application. What I want is, all the server communication should be done my device owner app and this app should communicate all related data to profile…
Sud
  • 421
  • 1
  • 4
  • 8
5
votes
3 answers

Activate a device owner using NFC on Android Lollipop

I am trying to set the device owner package on a device using NFC. The is mentioned in the Lollipop overview here: To deploy and activate a device owner, you must perform an NFC data transfer from a programming app to the device while the device…
tagy22
  • 1,353
  • 17
  • 26
5
votes
1 answer

Android ICS Device Encryption

i'm trying to trigger the encryption of my ICS device programmatically by launching an intent (Intent --> DevicePolicyManager.ACTION_START_ENCRYPTION). This works quite well. I would like to know whether there is sent an broadcast or sth like that…
4
votes
1 answer

Android Lock Phone Programatically without Strong authentication to unlock again

I am trying to create an app that, upon launching, will lock the phone. (It acts as an alternative of pressing the physical lock button on the phone instead). I was able to achieve it with this code: MainActivity.kt class MainActivity :…
4
votes
1 answer

How to set device owner on Android Things?

I would like to set my Android app as device owner on a device running Android Things. (I know that Android Things is getting shut down, but still I would need to make it work) I tried the usual command: adb shell dpm set-device-owner…
4
votes
2 answers

Management API error: persistentPreferredActivities 4

I am building an Android KIOSK app, and I try to enable kiosk mode with Android Management API by providing a device policy. My policy json is: { "keyguardDisabled": true, "applications": [ { …
4
votes
0 answers

Make a custom Setup Wizard for System Android Application running on an Emulator

I need to build a custom Setup Wizard to provision another app as a device owner. The setup wizard will then run on our hardware as a privileged app (residing in the priv-app folder) I have spent a lot of time trying to get this to work in an…
nilsi
  • 10,351
  • 10
  • 67
  • 79
4
votes
1 answer

DevicePolicyManager.isDeviceOwnerApp Method Not Working Properly

I want to put my application in pinned screen mode. And I want a permission from user for this. Permission Notice But I don't always want to show this statement to user. I found the setLockTaskPackages() method in the Android 5.0 Api…
Necati Alp
  • 43
  • 4
4
votes
0 answers

unlock screen programmatically not working

I am making a small app in which when I draw my phone near to me the screen will lock itself and when I keep the phone far from me the phone will unlock itself. I used proximity sensor for this check. I can lock the screen when I put finger over the…
Somnath Pal
  • 1,570
  • 4
  • 23
  • 42
4
votes
2 answers

Automatically grant ACTION_MANAGE_OVERLAY_PERMISSION via setPermissionGrantState or similar

I'm trying to grant some runtime permissions to my app automatically, these include ACCESS_FINE_LOCATION, READ_PHONE_STATE as well as ACTION_MANAGE_OVERLAY_PERMISSION. Do note that this requires at least Device Administrator access rights, which I…
Syzygy
  • 578
  • 7
  • 27
1
2
3
10 11