Create RestrictedDashboardFragment.

RestrictedDashboardFragment has all the same logic coming from
RestrcitedSettingsFragment but extends from DashboardFragment.
As a result, we could use preferenceController in child class of
RestrictedDashboardFragment.

This cl also make DeviceListPreferenceFragment as child of
RestrictedDashboardFragment, which enfluences the bluetooth page.

Bug: 38041586
Test: Build
Change-Id: I01395d506176c5cc584948478f7ca16c1c7c7045
This commit is contained in:
jackqdyulei
2017-05-05 16:07:48 -07:00
parent 910f69c62a
commit e407e67a3b
6 changed files with 303 additions and 7 deletions

View File

@@ -45,6 +45,7 @@ import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.LinkifyUtils;
import com.android.settings.R;
import com.android.settings.SettingsActivity;
import com.android.settings.core.PreferenceController;
import com.android.settings.dashboard.SummaryLoader;
import com.android.settings.location.ScanningSettings;
import com.android.settings.search.BaseSearchIndexProvider;
@@ -168,7 +169,6 @@ public final class BluetoothSettings extends DeviceListPreferenceFragment implem
@Override
void addPreferencesForActivity() {
addPreferencesFromResource(R.xml.bluetooth_settings);
final Context prefContext = getPrefContext();
mPairedDevicesCategory = new PreferenceCategory(prefContext);
mPairedDevicesCategory.setKey(KEY_PAIRED_DEVICES);
@@ -517,6 +517,21 @@ public final class BluetoothSettings extends DeviceListPreferenceFragment implem
return R.string.help_url_bluetooth;
}
@Override
protected String getLogTag() {
return TAG;
}
@Override
protected int getPreferenceScreenResId() {
return R.xml.bluetooth_settings;
}
@Override
protected List<PreferenceController> getPreferenceControllers(Context context) {
return null;
}
@VisibleForTesting
static class SummaryProvider implements SummaryLoader.SummaryProvider, OnSummaryChangeListener {