androidandroid-manifestsamsung-knox

Samsung KNOX LICENSE_STATUS not broadcasted


I use the latest (3.4.1) version of the KNOX libraries, and trying to activate my license.

My AndroidManifest entry:

        <receiver
            android:name=".receiver.KnoxLicenseReceiver"
            tools:ignore="ExportedReceiver">
            <intent-filter>
                <action android:name="com.samsung.android.knox.intent.action.LICENSE_STATUS" />
            </intent-filter>
        </receiver>

And activating the license like this:

KnoxEnterpriseLicenseManager
                .getInstance(context)
                .activateLicense(context.getString(R.string.const_kpe_key), getPackageName.exec())

It shows the Toast that the license was activated successfully (and works fine — I can, for example, disable the camera), but the receiver is never called.

I've tried on multiple devices with different Android versions (5.1 and 7.1) with no luck. What's wrong?


Solution

  • Well, Samsung docs are not correct. Correct intent action is

    com.samsung.android.knox.intent.action.KNOX_LICENSE_STATUS
    

    while action in docs is

    com.samsung.android.knox.intent.action.LICENSE_STATUS