device-owner

startLockTask() without request user action

被刻印的时光 ゝ 提交于 2021-02-07 19:44:30
问题 I want to activate startLockTask() without any request for users. So at first i read this Device Administration and create small sample application. In result i have my application in device administrators list but when i call startLockTask() it still execute not in silent mode. When i'm trying to call it so: DevicePolicyManager myDevicePolicyManager = (DevicePolicyManager) getSystemService(Context.DEVICE_POLICY_SERVICE); String[] packages = {this.getPackageName()}; myDevicePolicyManager

Install updates for a Device-Owner App

陌路散爱 提交于 2021-02-05 20:36:17
问题 Does anyone know what is the behavior in production of a device-owner App, distributed thru Google Play, when updates occur? As we know, installing a device-owner App involves some motivation and is not easy: reset to factory default then NFC-provision the device with a second device etc… So even if we consider this step done, would any further update involve so much pain, each time? This question occurs because on my development device, I cannot re-launch the device-owner App with changes if

Unable to set device owner through programmatically

大兔子大兔子 提交于 2020-12-16 03:32:08
问题 I tried to execute the following code to set my app as a device owner. I can't use ADB because I have more than 10K android-9 non rooted devices. So, Need to do this programmatically. String name = AdminReceiver.class.getName(); if (name.startsWith(BuildConfig.APPLICATION_ID)) { name = name.substring(BuildConfig.APPLICATION_ID.length()); } final String command = "dpm set-device-owner " + BuildConfig.APPLICATION_ID + '/' + name; Process process = Runtime.getRuntime().exec(command); Log.d(TAG,

Launch application after PackageInstaller finished (self) updating

Deadly 提交于 2020-08-10 13:42:13
问题 After the PackageInstaller successfully (self) updates the application, the application closes and doesn't launch again. Possible duplicate: Android PackageInstaller, re-open the app after it updates itself The situation is pretty similar, ill show some code snippets first. AndroidManifest.xml <receiver android:name=".UpdateReceiver" > <intent-filter> <action android:name="android.intent.action.MY_PACKAGE_REPLACED" /> </intent-filter> </receiver> My PackageInstaller session runs in an

Launch application after PackageInstaller finished (self) updating

六眼飞鱼酱① 提交于 2020-08-10 13:40:05
问题 After the PackageInstaller successfully (self) updates the application, the application closes and doesn't launch again. Possible duplicate: Android PackageInstaller, re-open the app after it updates itself The situation is pretty similar, ill show some code snippets first. AndroidManifest.xml <receiver android:name=".UpdateReceiver" > <intent-filter> <action android:name="android.intent.action.MY_PACKAGE_REPLACED" /> </intent-filter> </receiver> My PackageInstaller session runs in an

System apps missing after QR provisioning

人走茶凉 提交于 2020-03-03 10:50:15
问题 I'm trying to provision my 7.0 device through QR provisioning. The provisioning was done successfully but it created a separate profile and the apps in the priv-app section are not visible here. When i try to manually install the apps through adb it says success but the app is still not visible. On checking the apps section in settings it says that the app is installed on another user. Any idea on how to get those system apps into the current provisioned profile ? 回答1: You can set the extra

System apps missing after QR provisioning

大憨熊 提交于 2020-03-03 10:48:07
问题 I'm trying to provision my 7.0 device through QR provisioning. The provisioning was done successfully but it created a separate profile and the apps in the priv-app section are not visible here. When i try to manually install the apps through adb it says success but the app is still not visible. On checking the apps section in settings it says that the app is installed on another user. Any idea on how to get those system apps into the current provisioned profile ? 回答1: You can set the extra

Making my app a device owner doesn't work

拜拜、爱过 提交于 2020-01-25 06:49:09
问题 I need to update my application silently (as described here). So I need to make my app a device owner in phone SAMSUNG S6. I use dpm command through adb shell command, so I provision my device (remove all account from Settings->Accounts), enable developer mode, enable debugging, install my app as usual (install it with Android Studio for example) and then run command: adb shell dpm set-device-owner <PACKAGE-NAME>/.DeviceAdminComponent But I get a next error: java.lang.IllegalStateException:

Device owner issue using adb method with LG devices only

怎甘沉沦 提交于 2019-12-30 10:38:06
问题 I have been trying to get device owner, inspired by google sample code Using adb, I am able to get device owner on nexus 4,5,7,9 and micromax. However in LG G Pad (LG-V400) and LG G3 (LG G3 855) I get an error. java.lang.SecurityException: Neither user 2000 nor current process has android.permission.BIND_DEVICE_ADMIN. I noticed that the device admin is enabled on these devices, but not the device owner. I was able to capture the bug report from the device found here. I have tried contacting

Screen pinning 3rd party apps programmatically

怎甘沉沦 提交于 2019-12-29 03:29:07
问题 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 developer website, brief description tells me that it is possible to do what I am trying: http://developer.android.com/about/versions/android-5.0.html#ScreenPinning Programmatically: To activate screen pinning programmatically, call startLockTask()