Data transfer between application outside profile and inside profile in Android Lollipop

喜欢而已 提交于 2020-01-01 06:10:40

问题


Question related to Android for Work. My application was a device Admin privileged app and now I have modified the code which creates a managed work profile and sets itself as the profile owner.

The question is, if I upgrade my application, it becomes a profile owner from device admin. Now there will be two copies of my application, one outside the profile and one inside (badged version).

Is there a way if I need to transfer some data from the personal space app to the work profile app (badged version)?


回答1:


The DevicePolicyManager class implements a the addCrossProfileIntentFilter method for explicitly allowing Intents to be sent from the managed profile to the primary user profile.

public void addCrossProfileIntentFilter (ComponentName admin, IntentFilter filter, int flags)

Although

Called by the profile owner of a managed profile so that some intents sent in the managed profile can also be resolved in the parent, or vice versa. Only activity intents are supported.



来源:https://stackoverflow.com/questions/28602192/data-transfer-between-application-outside-profile-and-inside-profile-in-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!