Andrey Lebed
May 29, 2018
6:57 am



I am working on developing software for Android Knox Containers using SEAP API.

When application is installed it is possible to receive intent using android api

What api can be used if I want to get information after application installation/uninstallation for containers?
It would be good to subscribe to similar intent, but standard receiver is not called after container application change it's state.



Kamil Kaszubski
May 29, 2018
10:40 am

Unfortunately, this intent is not send outside of Container.

The only workaround is using additional listener inside Knox container which is running activity from your application outside Container with intent added to allowed intents.

Intents can be whitelisted since Android N using addCrossProfileIntentFilter API.

Andrey Lebed
May 29, 2018
5:56 pm

Is it possible to get working example of function addCrossProfileIntentFilter ?

I use 2 different applications, which are communicating well outside the container. When I put one application inside the container, and call startActivity inside it, I receive exception, that called activity can not be found.
addCrossProfileIntentFilter is called according to docs without errors:,%20android.content.IntentFilter,%20int)

Kamil Kaszubski
May 30, 2018
8:22 am

I have created apk, however I am not able to attach it here at this point.

Please take a look at below solution explanation with sampe code.

Application 1:
- activates device admin
- activates Knox license
- creates container and installs Application 2 inside it.
- add cross profile intent as below

    public static final String INTENT_FOR_SECOND_ACTIVITY = "";
    IntentFilter intentFilter = new IntentFilter(INTENT_FOR_SECOND_ACTIVITY);
    containerConfigurationPolicy.addCrossProfileIntentFilter(DeviceAdminController.getAdmin(this), intentFilter, DevicePolicyManager.FLAG_PARENT_CAN_ACCESS_MANAGED);

- includes second Activity declared as below

        <activity android:name=".Main2Activity">
                <action android:name=""/>
                <category android:name="android.intent.category.DEFAULT" />
Application 2.
- is installed inside Knox container
- sends intent as below

    public static final String INTENT_RUNNING_APP_FROM_PERSONAL = "";
    Intent intent = new Intent(INTENT_RUNNING_APP_FROM_PERSONAL);
        try {
        } catch (ActivityNotFoundException e){
            Toast.makeText(this, R.string.activity_not_found, Toast.LENGTH_SHORT).show();
Please note that cross profile intents work on devices with Android N and higher