Fix issue with auto-adding work tile
When a work profile is created, it is first created as disabled, and then enabled when it's verified (all this done by DPM). ManagedProfileControllerImpl, which is what WorkModeTile uses to verify that there's a work profile available, only returns true if there's an Enabled work profile. However, WorkTileAutoAddable was adding the tile when the profile was created, regardless of the enabled state. This made it so the tile was immediately destroyed if auto-added. With this change, we explicitly require in WorkTileAutoAddable that the profile is enabled, matching what ManagedProfileControllerImpl does and also the correct behavior. UserTracker will send a profiles changed both when the profile is added as disabled and when it's enabled, so that is not a problem. Test: atest WorkTileAutoAddableTest Test: manual, create a work profile first as disabled and then enable it Flag: ACONFIG com.android.systemui.qs_new_pipeline NEXTFOOD Fixes: 325595352 Change-Id: Ib741135315e7a4787049129ba2918bd68bc7484b
Loading
Please register or sign in to comment