Rb B
Apr 19, 2017
9:26 pm

SPDControl API not working on 7.0 devices - works on 6.0

I have a working app that uses the standard and customixation SDKs. On 6.0.1  everything works fine. On 7.0 SPDControlPolicy no longer works throwing a security exception. Every other command still works fine with no issues. The code compiles just like it does for 6.0, but throws a runtime security error.

Code:

SPDControlPolicy spdControlPolicy = edm.getSPDControlPolicy();
spdControlPolicy.setAutoSecurityPolicyUpdateMode(SPDControlPolicy.SPD_ENFORCE_ON);

Error:

04-19 08:15:44.878 15544-15544/com.dish.stagingapp E/AndroidRuntime: FATAL EXCEPTION: main
                                                                     Process: com.dish.stagingapp, PID: 15544
                                                                     java.lang.RuntimeException: Unable to resume activity {com.dish.stagingapp/com.samsung.android.sdk.b2b.samples.custommanagerpolicy.apis.AdminLicenseActivation}: java.lang.SecurityException: Admin  does not have com.samsung.android.knox.permission.KNOX_SPDCONTROL
                                                                         at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3832)
                                                                         at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3872)
                                                                         at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3014)
                                                                         at android.app.ActivityThread.-wrap14(ActivityThread.java)
                                                                         at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1650)
                                                                         at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                         at android.os.Looper.loop(Looper.java:154)
                                                                         at android.app.ActivityThread.main(ActivityThread.java:6688)
                                                                         at java.lang.reflect.Method.invoke(Native Method)
                                                                         at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1468)
                                                                         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1358)
                                                                      Caused by: java.lang.SecurityException: Admin  does not have com.samsung.android.knox.permission.KNOX_SPDCONTROL

Manifest permissions:

<uses-sdk
        android:minSdkVersion="16"
        android:targetSdkVersion="23" />

    <uses-permission android:name="com.sec.enterprise.knox.permission.CUSTOM_SEALEDMODE" />
    <uses-permission android:name="com.sec.enterprise.knox.permission.CUSTOM_SETTING" />
    <uses-permission android:name="android.permission.SET_WALLPAPER" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    ;
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    ;
    <uses-permission android:name="android.permission.sec.MDM_APP_MGMT" />
    ;
    <uses-permission android:name="com.android.launcher.permission.UNINSTALL_SHORTCUT" />
    ;
    <uses-permission android:name="android.permission.sec.MDM_SECURITY" />
    ;
    <uses-permission android:name="android.permission.sec.MDM_RESTRICTION" />
    ;
    <uses-permission android:name="android.permission.sec.MDM_LOCATION" />
    ;
    <uses-permission android:name="android.permission.WRITE_CONTACTS" />
    ;
    <uses-permission android:name="android.permission.sec.MDM_REMOTE_CONTROL" />
    ;
    <uses-permission android:name="com.sec.enterprise.permission.MDM_SPDCONTROL" />
    ;
    <uses-permission android:name="com.samsung.android.knox.permission.KNOX_SPDCONTROL" />
    ;
    <android:uses-permission android:name="android.permission.READ_PHONE_STATE" />

 

Any ideas what changed for this to no longer work?

Richard.bonnell@dish.com

Samuel V.Samsung SEAP Moderator
Apr 19, 2017
11:13 pm

Hi Rb,

Chris who's in charge of your support ticket has reproduced the issue and escalated it to R&D. You should hear back from him soon.

Best regards,

Samuel