Merge "Add config value to switch between Tether Settings UIs."
This commit is contained in:
@@ -201,7 +201,7 @@ public final class AllInOneTetherSettings extends RestrictedDashboardFragment
|
||||
// Assume we are in a SettingsActivity. This is only safe because we currently use
|
||||
// SettingsActivity as base for all preference fragments.
|
||||
final SettingsActivity activity = (SettingsActivity) getActivity();
|
||||
BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();
|
||||
final BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();
|
||||
if (adapter != null) {
|
||||
adapter.getProfileProxy(activity.getApplicationContext(), mProfileServiceListener,
|
||||
BluetoothProfile.PAN);
|
||||
@@ -404,6 +404,12 @@ public final class AllInOneTetherSettings extends RestrictedDashboardFragment
|
||||
return keys;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isPageSearchEnabled(Context context) {
|
||||
return context.getResources().getBoolean(
|
||||
R.bool.config_show_all_in_one_tether_settings);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AbstractPreferenceController> createPreferenceControllers(
|
||||
Context context) {
|
||||
|
@@ -450,6 +450,12 @@ public class TetherSettings extends RestrictedSettingsFragment
|
||||
return Arrays.asList(sir);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isPageSearchEnabled(Context context) {
|
||||
return !context.getResources().getBoolean(
|
||||
R.bool.config_show_all_in_one_tether_settings);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getNonIndexableKeys(Context context) {
|
||||
final List<String> keys = super.getNonIndexableKeys(context);
|
||||
|
@@ -109,6 +109,10 @@ public class TetherPreferenceController extends AbstractPreferenceController imp
|
||||
|
||||
// Grey out if provisioning is not available.
|
||||
mPreference.setEnabled(!TetherSettings.isProvisioningNeededButUnavailable(mContext));
|
||||
|
||||
if (mContext.getResources().getBoolean(R.bool.config_show_all_in_one_tether_settings)) {
|
||||
mPreference.setFragment("com.android.settings.AllInOneTetherSettings");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -257,6 +257,12 @@ public class WifiTetherSettings extends RestrictedDashboardFragment
|
||||
return keys;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isPageSearchEnabled(Context context) {
|
||||
return !context.getResources().getBoolean(
|
||||
R.bool.config_show_all_in_one_tether_settings);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AbstractPreferenceController> createPreferenceControllers(
|
||||
Context context) {
|
||||
|
Reference in New Issue
Block a user