ranjith R
Aug 19, 2019
1:21 pm

Api to power off device not working in oreo device

Hi team,

The api to power-off device is not working in oreo device.

 

Sample Code  : 

CustomDeviceManager cdm = CustomDeviceManager.getInstance();
SystemManager kcsm = cdm.getSystemManager();
kcsm.powerOff();

Am getting the following exception :

 Admin  does not have com.samsung.android.knox.permission.KNOX_CUSTOM_SYSTEM OR com.sec.enterprise.knox.permission.CUSTOM_SYSTEM

These above permssions are already defined in the Manifest..

Is there any alternate api to use this 

 

 

Regards,

Ranjith R

Updated: Aug 21, 2019 9:19 am

Raunak B.Samsung SEAP Moderator
Sep 13, 2019
8:47 pm

Hi Ranjith,

 

The code and the permission seem to be in order.

However, which development key do you have? There are multiple different types, and access to the powerOff() method is only available to those holding a KPE Premium Key.

https://seap.samsung.com/license-keys/license-permissions

The above link will lead to a webpage with the different keys and their respective permissions.

 

Cheers.