Fix UI issue in LocationSettings

- Add WorkPreferenceController to support directly use work profile
related feature in xml
- Get only work/personal infos in RecentLocationRequestPreferenceController
and RecentLocationRequestSeeAllPreferenceController
- Remove ProfileSelectStorageFragment

Bug: 141601408
Fixes: 146080649
Test: manual, robolectric
Change-Id: Ide39c7a3796e16421f3a5690309c3d746a956de8
This commit is contained in:
Raff Tsai
2019-12-13 16:46:33 +08:00
parent d230b552f5
commit 5ec8efe7e0
21 changed files with 442 additions and 246 deletions

View File

@@ -27,8 +27,8 @@ import com.google.android.collect.Maps;
import org.robolectric.RuntimeEnvironment;
import org.robolectric.annotation.Implementation;
import org.robolectric.annotation.Implements;
import org.robolectric.shadow.api.Shadow;
import org.robolectric.annotation.Resetter;
import org.robolectric.shadow.api.Shadow;
import java.util.ArrayList;
import java.util.Collections;
@@ -132,6 +132,16 @@ public class ShadowUserManager extends org.robolectric.shadows.ShadowUserManager
return mUserSwitchEnabled;
}
@Implementation
protected boolean isManagedProfile(int userId) {
return mManagedProfiles.contains(userId);
}
public void setManagedProfiles(Set<Integer> profileIds) {
mManagedProfiles.clear();
mManagedProfiles.addAll(profileIds);
}
public void setUserSwitcherEnabled(boolean userSwitchEnabled) {
mUserSwitchEnabled = userSwitchEnabled;
}