Rephrase the see more button of Internet panel when ProviderModel is enabled

Bug: 176871139
Test: build Test and manaual test(check the UI)
make RunSettingsRoboTests -j ROBOTEST_FILTER=InternetConnectivityPanel
(PASS)

Change-Id: I5e601c6639d979ca776f4bdf7f5e870a0513c7f5
This commit is contained in:
SongFerngWang
2021-01-06 20:28:51 +08:00
parent ce66cbb502
commit 19cd9506c7
3 changed files with 41 additions and 7 deletions

View File

@@ -34,10 +34,6 @@ import java.util.List;
/**
* Represents the Internet Connectivity Panel.
*
* <p>
* Displays Wifi (full Slice) and Airplane mode.
* </p>
*/
public class InternetConnectivityPanel implements PanelContent {
@@ -78,6 +74,21 @@ public class InternetConnectivityPanel implements PanelContent {
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
}
@Override
public boolean isCustomizedButtonUsed() {
return Utils.isProviderModelEnabled(mContext);
}
@Override
public CharSequence getCustomizedButtonTitle() {
return mContext.getText(R.string.settings_button);
}
@Override
public void onClickCustomizedButton() {
mContext.startActivity(getSeeMoreIntent());
}
@Override
public int getMetricsCategory() {
return SettingsEnums.PANEL_INTERNET_CONNECTIVITY;

View File

@@ -452,13 +452,13 @@ public class PanelFragment extends Fragment {
View.OnClickListener getSeeMoreListener() {
return (v) -> {
mPanelClosedKey = PanelClosedKeys.KEY_SEE_MORE;
final FragmentActivity activity = getActivity();
if (mPanel.isCustomizedButtonUsed()) {
mPanel.onClickCustomizedButton();
} else {
final FragmentActivity activity = getActivity();
activity.startActivityForResult(mPanel.getSeeMoreIntent(), 0);
activity.finish();
}
activity.finish();
};
}