Danny Neumann
Oct 13, 2017
3:22 pm

License Activation Broadcast Not Working

I am trying to setup a receiver to know if the elm license has been activated. 

This intent-filter works: edm.intent.action.knox_license.status
This intent-filter doesn't work: edm.intent.action.license.status

The problem is the knox license is activated before the elm so i get security permission warnings b/c it is too soon. Why is edm.intent.action.license.status not getting broadcast?

Thanks!

Similar topics

No similar topics found.
Samuel G.Samsung SEAP Moderator
Oct 13, 2017
4:28 pm

Hi Danny,

Could you try using the intent filter "com.samsung.android.knox.intent.action.LICENSE_STATUS" instead of "edm.intent.action.license.status"? Sometimes the libraries are finiky as to what the action filter is for license activation.

 

Thanks,

Sam

Danny Neumann
Oct 13, 2017
4:41 pm

That one doesn't seem to work as well.

I noticed "com.samsung.action.knox.klms.KLMS_RP_NOTIFICATION" in the logcat. Could that be it? It has a KLMS_LICENSE_STATUS. Or is that for something else?

Danny Neumann
Oct 13, 2017
5:04 pm

So what i've noticed is the second time it calls the activatelicense method, the broadcast intent-filter edm.intent.action.license.status is fired. Why would it work the second time but not the first time?

Danny Neumann
Oct 13, 2017
6:51 pm

What I've discovered is the knox activation system can only activate 1 license at a time. Based on sample code i've seen, it appears like it can activate all keys at the same time (but it really can't). See below which is taken from the seap api page for activating licenses. 

Example:

// Import packages
import android.app.enterprise.license.EnterpriseLicenseManager;
import com.sec.enterprise.knox.license.KnoxEnterpriseLicenseManager;

//Activate ELM key
EnterpriseLicenseManager elm =
    EnterpriseLicenseManager.getInstance(getApplicationContext());
elm.activateLicense(ELMkey);

//Activate KLM key
KnoxEnterpriseLicenseManager klm =
    KnoxEnterpriseLicenseManager.getInstance(getApplicationContext());
klm.activateLicense(KLMkey);

To solve the problem, in the broadcastreceiver, listen for 2 different intent filters...

<receiver android:name=".receivers.KnoxReceiver" android:enabled="true" android:exported="true">
    <intent-filter>
        <!--<action android:name="com.samsung.android.knox.intent.action.LICENSE_STATUS" />-->
        <action android:name="edm.intent.action.license.status" />
        <action android:name="edm.intent.action.knox_license.status" />
    </intent-filter>
</receiver>

the knox_license.status filter will receiver knox activation and the license.status will receive the elm activation response. In the receiver then, conditionally handle each case so when knox license is done activating, fire off the klm.activatelicense() method. This does them synchronously and will be completely ready to go at the end of the calls (if you get success messages in the response). If you don't do it this way, you end up having to run the license activation routine twice.

I hope this helps someone out.