Add work-only-category controller

The controller will hide category if there is no child in it.

Change-Id: I9bbcc4115b991574e608933f98857b0b4eb2ed7d
Fixes: 62185871
Test: robotests
This commit is contained in:
Fan Zhang
2017-10-16 18:21:00 -07:00
parent 7ad17d72ad
commit 1bde0d84b0
10 changed files with 166 additions and 25 deletions

View File

@@ -23,6 +23,7 @@ import com.android.settings.Utils;
public class DefaultWorkBrowserPreferenceController extends DefaultBrowserPreferenceController {
public static final String KEY = "work_default_browser";
private final UserHandle mUserHandle;
public DefaultWorkBrowserPreferenceController(Context context) {
@@ -35,7 +36,7 @@ public class DefaultWorkBrowserPreferenceController extends DefaultBrowserPrefer
@Override
public String getPreferenceKey() {
return "work_default_browser";
return KEY;
}
@Override

View File

@@ -23,6 +23,7 @@ import com.android.settings.Utils;
public class DefaultWorkPhonePreferenceController extends DefaultPhonePreferenceController {
public static final String KEY = "work_default_phone_app";
private final UserHandle mUserHandle;
public DefaultWorkPhonePreferenceController(Context context) {
@@ -43,6 +44,6 @@ public class DefaultWorkPhonePreferenceController extends DefaultPhonePreference
@Override
public String getPreferenceKey() {
return "work_default_phone_app";
return KEY;
}
}