Fix the end-icon missing issue for Wi-Fi networks

- Because WifiEntryPreference needs to support policy transparency, the inherited class is changed from Preference to RestrictedPreference.

- The RestrictedPreference will hides the end icon as default, causing this issue to happen.

- Override the getSecondTargetResId() function with necessary resource id to avoid the end-icon being hidden.

- Remove the redundant setWidgetLayoutResource, because it will be initialized in the extended class.

Bug: 262456749
Test: manual test
make RunSettingsRoboTests ROBOTEST_FILTER=WifiEntryPreferenceTest

Change-Id: Ie3d3a649d3137dc705d7887c8e74592437d9ce61
This commit is contained in:
Weng Su
2022-12-23 18:34:10 +08:00
parent ee3c5500f6
commit fbe02cd543
2 changed files with 50 additions and 54 deletions

View File

@@ -82,7 +82,6 @@ public class WifiEntryPreference extends RestrictedPreference implements
super(context);
setLayoutResource(R.layout.preference_access_point);
setWidgetLayoutResource(R.layout.access_point_friction_widget);
mFrictionSld = getFrictionStateListDrawable();
mWifiEntry = wifiEntry;
mWifiEntry.setListener(this);
@@ -280,6 +279,11 @@ public class WifiEntryPreference extends RestrictedPreference implements
notifyChanged();
}
@Override
protected int getSecondTargetResId() {
return R.layout.access_point_friction_widget;
}
@Override
public void onClick(View view) {
if (view.getId() == R.id.icon_button) {