Forum Discussion
Managed configurations is null while creating work-profile
Hey Shivam.,
How's it going?
Mr. jasonbayton , I wanted to loop you in to see if you have any insights or responses to this question. 😊
Thanks,
Reece
- jasonbayton11 months agoLevel 4.0: Ice Cream Sandwich
I'd look at bug report & app logs to begin with, and compare it against that of a fully managed device.
The behaviour should be identical and so I'm not sure why it'd return `null`.
jeremy any thoughts?
- mobisecte11 months agoLevel 1.5: Cupcake
As of now, I am not able to pin-point the issue and still looking for some insight on the issue to resolve it.
I have uploaded the policy and bugreport of the a device that is enrolling in the work-profile without issue (Samsung) and of the particular device that is having the issue (Moto).
https://drive.google.com/drive/folders/1-iOVMhbCV5fC23yXIvyXB341eOqLJAoZ?usp=sharing
I used the same policy in both of the devices and in fully managed, along with the work-profile where we allow personal usage. Everywhere the policy works but in two of our new moto devices giving us the issue as I have explained in the post.
Here is the code that we use in the MainActivity of the app when it opens up to get the Restrictions.fun setupRestrictions(){ val restrictionManager = getSystemService(Context.RESTRICTIONS_SERVICE) as RestrictionsManager val appRestrictions = restrictionManager.applicationRestrictions if (appRestrictions != null){ val id = appRestrictions.getString(AppDataStoreKey.id.key) val url = appRestrictions.getString(AppDataStoreKey.url.key) Log.d(TAG, "onCreate: Restrictions: ${Gson().toJson(appRestrictions)}") if (!id.isNullOrEmpty()){ CoroutineScope(Dispatchers.IO).launch { appDataStore.saveString(AppDataStoreKey.id, id) } } if (!url.isNullOrEmpty()){ CoroutineScope(Dispatchers.IO).launch { appDataStore.saveString(AppDataStoreKey.url, url) } } Log.d(TAG, "onCreate: Restrictions: \nID: $id \nURL: $url") } }
- Shivam10 months agoLevel 1.5: Cupcake
Hey anything that can we do about it, I have added the bug report of different working and non working devices also with app code below. Also, I have this question, does management api put any limit on work profile enrollment on a device, because we have these devices on which we continuously add and remove work profile, can this be a reason or anything else.
Related Content
- 2 years ago
- 2 years ago