Have WebView Implementation Dev Setting use DefaultAppPickerFragment.

Make the WebView Implementation Dev Setting look like the fullscreen
settings deriving from DefaultAppPickerFragment.
Point the Activity opened through Settings.ACTION_WEBVIEW_SETTINGS to
the class WebViewAppPicker which is our new implementation of the
WebView Implementation setting.

Ensure the new setting closes if it is reached from a user that isn't an
admin of the device.

Bug: 34806477
Bug: 34966439
Test: Ensure WebView implementation Dev Setting looks ok (disabled
packages should have a text showing why they cannot be chosen).
Test: Start Intent with action Settings.ACTION_WEBVIEW_SETTINGS and
ensure the started Activity looks similar to the WebView Implementation
Dev Setting.
Test: Ensure picking a package that is no longer active, updates the
setting (so that package isn't visible anymore).
Change-Id: I08007c515193739ad61dfd735bb5130fc07bd6e6
This commit is contained in:
Gustav Sennton
2017-02-03 16:19:02 +00:00
parent 8be6862021
commit 5b596285a0
15 changed files with 365 additions and 512 deletions

View File

@@ -29,25 +29,33 @@ import android.os.UserHandle;
/**
* Data model representing an app in DefaultAppPicker UI.
*/
class DefaultAppInfo {
public class DefaultAppInfo {
public final int userId;
public final ComponentName componentName;
public final PackageItemInfo packageItemInfo;
public final String summary;
// Description for why this item is disabled, if null, the item is enabled.
public final String disabledDescription;
public DefaultAppInfo(int uid, ComponentName cn, String summary) {
packageItemInfo = null;
userId = uid;
componentName = cn;
this.summary = summary;
this.disabledDescription = null;
}
public DefaultAppInfo(PackageItemInfo info) {
public DefaultAppInfo(PackageItemInfo info, String description) {
userId = UserHandle.myUserId();
packageItemInfo = info;
componentName = null;
summary = null;
this.disabledDescription = description;
}
public DefaultAppInfo(PackageItemInfo info) {
this(info, null);
}
public CharSequence loadLabel(PackageManager pm) {