Fix disabled WebView packages being shown as enabled in Dev Setting.
WebView packages that cannot be chosen as WebView implementation should be shown as disabled in the 'WebView Implementation' Dev Setting. Simplify the logic in DefaultAppInfo a little bit to avoid special-casing for the WebView Dev setting. Also add tests to ensure we are correctly disabling WebView packages in the Dev setting and showing their disabled-reasons. Bug: 35707106 Test: 'make RunSettingsRoboTests' Test: Ensure disabled WebView packages show up as being disabled in the 'WebView Implementation' Dev Setting. Change-Id: Ic2f5265c3451b6396e55b7bc29689c3d889ddb5e
This commit is contained in:
@@ -35,8 +35,6 @@ public class DefaultAppInfo {
|
||||
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 final boolean enabled;
|
||||
|
||||
public DefaultAppInfo(int uid, ComponentName cn) {
|
||||
@@ -52,21 +50,19 @@ public class DefaultAppInfo {
|
||||
userId = uid;
|
||||
componentName = cn;
|
||||
this.summary = summary;
|
||||
this.disabledDescription = null;
|
||||
this.enabled = enabled;
|
||||
}
|
||||
|
||||
public DefaultAppInfo(PackageItemInfo info, String description) {
|
||||
public DefaultAppInfo(PackageItemInfo info, String summary, boolean enabled) {
|
||||
userId = UserHandle.myUserId();
|
||||
packageItemInfo = info;
|
||||
componentName = null;
|
||||
summary = null;
|
||||
this.disabledDescription = description;
|
||||
enabled = true;
|
||||
this.summary = summary;
|
||||
this.enabled = enabled;
|
||||
}
|
||||
|
||||
public DefaultAppInfo(PackageItemInfo info) {
|
||||
this(info, null);
|
||||
this(info, null /* summary */, true /* enabled */);
|
||||
}
|
||||
|
||||
public CharSequence loadLabel(PackageManager pm) {
|
||||
|
Reference in New Issue
Block a user