'Mobile plan' is searchable even if it is unavailable

'Mobile plan' yields a search hit event though the 'Mobile plan'
setting is unavailable on the device.

Bug: 287198186
Test: Manual
Change-Id: Ibc6f01602a364ae902f8a6ce15083890e89446d2
This commit is contained in:
David Magno
2023-06-14 10:41:52 +02:00
parent 286344d539
commit 50e8eab484
2 changed files with 13 additions and 1 deletions

View File

@@ -174,5 +174,17 @@ public class NetworkDashboardFragment extends DashboardFragment implements
null /* metricsFeatureProvider */, null /* fragment */,
null /* mobilePlanHost */);
}
@Override
public List<String> getNonIndexableKeys(Context context) {
final List<String> keys = super.getNonIndexableKeys(context);
MobilePlanPreferenceController mppc =
new MobilePlanPreferenceController(context, null);
if (!mppc.isAvailable()) {
keys.add(MobilePlanPreferenceController.KEY_MANAGE_MOBILE_PLAN);
}
return keys;
}
};
}