Fix gray work apps when WorkPausedCard shoul've shown
The reason is because WorkManager doesn't reset when user searches (which is why the apps gray out when you go to toast, turn off work profile then back gesture to all apps) Added test for ActivityAllAppsContainerView that test onAppsUpdated() and check for if there are work apps. From the test environment, onAppsUpdated() needs to be public because the method is outside the package. However, I've wrapped onAppsUpdated package private so I can test it with a boolean parameter. bug: 298492729 test: video: before: https://drive.google.com/file/d/1D0VlGeJEI5lGbYgP5Tnu5UO_Dv61X8Dv/view?usp=sharing after: https://drive.google.com/file/d/1D0qsq7sX_kAp2t92xser7YI4ADBhQfHY/view?usp=sharing Change-Id: I4eb7cf21e273e29171fcd62a4762e8bb1778e720
This commit is contained in:
1 parent
9dfbb0aca8
commit
c8af851e99
3 files changed
+105
-6
No files matched your search
@@ -52,6 +52,7 @@ import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.util.ArrayList;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* Companion class for {@link ActivityAllAppsContainerView} to manage work tab and personal tab
|
||||
@@ -215,6 +216,10 @@ public class WorkProfileManager implements PersonalWorkSlidingTabStrip.OnActiveP
|
||||
return mCurrentState != WorkProfileManager.STATE_DISABLED;
|
||||
}
|
||||
|
||||
public boolean hasWorkApps() {
|
||||
return Stream.of(mAllApps.getAppsStore().getApps()).anyMatch(mMatcher);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds work profile specific adapter items to adapterItems and returns number of items added
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user