device-policy-manager

How do you un-provision a device in order to set the Device Owner?

末鹿安然 提交于 2019-12-02 02:02:15
'm trying to set up Device Owner using the sample apps downloadable from developer.android.com https://developer.android.com/samples/NfcProvisioning/index.html https://developer.android.com/samples/DeviceOwner/index.html But when I NFC tap the devices in the logcat for the device I am trying to set the Device Owner for I see this: /? E/ManagedProvisioning﹕ Device already provisioned. However I am doing a factory reset just before attempting the provisioning, so how can I get the device into an unprovisioned state? I've seen different behaviours depending on models. Usually removing all

Run intent DevicePolicyManager.ACTION_ADD_DEVICE_ADMIN from a service

守給你的承諾、 提交于 2019-12-01 17:48:49
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); intent2.setAction(android.content.Intent.ACTION_VIEW); intent2.setDataAndType(uri, "application/vnd.android.package-archive"); context.startActivity(intent2); and it works, but with DevicePolicyManager I can't find the way: Intent intent = new Intent(DevicePolicyManager.ACTION_ADD_DEVICE_ADMIN); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.putExtra

Run intent DevicePolicyManager.ACTION_ADD_DEVICE_ADMIN from a service

南楼画角 提交于 2019-12-01 16:46:49
问题 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); intent2.setAction(android.content.Intent.ACTION_VIEW); intent2.setDataAndType(uri, "application/vnd.android.package-archive"); context.startActivity(intent2); and it works, but with DevicePolicyManager I can't find the way: Intent intent = new Intent

Upgrading app in background using Device Policy Controller

本小妞迷上赌 提交于 2019-12-01 12:58:10
问题 I have a working DPC app which is the Device Owner. I have tried this on two different Android 6.0.1 devices to rule out any device/manufacturer issues. I used adb shell dpm set-device-owner com.example.dpc/.DpcDeviceAdminReceiver to make my DPC-app the owner. After making it the owner it can correctly grant COSU permissions to another app, which convinces me that this has worked. The command returned the response: Success: Device owner set to package com.example.dpc Active admin set to

Activate a device owner using NFC on Android Lollipop

此生再无相见时 提交于 2019-11-30 07:32:20
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 is in its unprovisioned state. This data transfer sends the same information as in the provisioning intent described in Managed provisioning. The reason is once this is set you can use the screen pinning feature to lock the device in a kiosk mode. I have been able to test the this kiosk mode by manually setting the device owner by placing a device

How to programmatically set a lock or pin for an app

丶灬走出姿态 提交于 2019-11-29 21:08:09
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 to play angry birds for some time on my phone while I am doing work. I will select my important apps like messaging, gmail, etc and put a pin or password on it for 30 minutes while she plays angry birds. After 30 minutes, I get my phone from my daughter and I can open the app without a pin because the time limit expired. I have done a ton of research

Activate a device owner using NFC on Android Lollipop

妖精的绣舞 提交于 2019-11-29 10:05:01
问题 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 is in its unprovisioned state. This data transfer sends the same information as in the provisioning intent described in Managed provisioning. The reason is once this is set you can use the screen pinning feature to lock the device in a kiosk mode. I

devicePolicyManager.lockNow() is not working for Motorola Tablets

寵の児 提交于 2019-11-27 02:20:41
问题 public final static void lockDevice() { try { if (devicePolicyManager.isAdminActive(adminComponent)) { devicePolicyManager.lockNow(); } } catch (final Exception ex) { ... } } The above code does not throw any exception nor it locks the screen for motorola xoom tablets only. (Both Homeycomb and Icecream Sandwitch) The same code works perfectly on other Homeycomb and ICS tablets. I googled, but did not get any solution. Any Ideas.....? 回答1: Possible reasons for this problem 1) I think there is