Merge "[Wi-Fi] Use getUriHelpString() result to judge if Settings APP should register the help button click event and file related intent if need." into rvc-dev
This commit is contained in:
@@ -770,9 +770,9 @@ public class WifiSettings2 extends RestrictedSettingsFragment
|
||||
pref.setOrder(index++);
|
||||
pref.refresh();
|
||||
|
||||
if (wifiEntry.canManageSubscription()) {
|
||||
if (wifiEntry.getHelpUriString() != null) {
|
||||
pref.setOnButtonClickListener(preference -> {
|
||||
openSubscriptionHelpPage();
|
||||
openSubscriptionHelpPage(wifiEntry);
|
||||
});
|
||||
}
|
||||
mWifiEntryPreferenceCategory.addPreference(pref);
|
||||
@@ -1111,8 +1111,8 @@ public class WifiSettings2 extends RestrictedSettingsFragment
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
void openSubscriptionHelpPage() {
|
||||
final Intent intent = getHelpIntent(getContext());
|
||||
void openSubscriptionHelpPage(WifiEntry wifiEntry) {
|
||||
final Intent intent = getHelpIntent(getContext(), wifiEntry.getHelpUriString());
|
||||
if (intent != null) {
|
||||
try {
|
||||
startActivityForResult(intent, MANAGE_SUBSCRIPTION);
|
||||
@@ -1123,10 +1123,7 @@ public class WifiSettings2 extends RestrictedSettingsFragment
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
Intent getHelpIntent(Context context) {
|
||||
return HelpUtils.getHelpIntent(
|
||||
context,
|
||||
context.getString(R.string.help_url_manage_wifi_subscription),
|
||||
context.getClass().getName());
|
||||
Intent getHelpIntent(Context context, String helpUrlString) {
|
||||
return HelpUtils.getHelpIntent(context, helpUrlString, context.getClass().getName());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user