Add storage dashborad page.
Refactor shared dashboard page display logic between storage and system page. Bug: 31800690 Test: RunSettingsRoboTests Change-Id: I7eb86f590b79ab871bdb383fb2f5326790beb193
This commit is contained in:
@@ -27,29 +27,27 @@ import android.util.Log;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.Utils;
|
||||
import com.android.settings.core.PreferenceController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static android.content.Context.CARRIER_CONFIG_SERVICE;
|
||||
|
||||
public class SystemUpdatePreferenceController {
|
||||
public class SystemUpdatePreferenceController extends PreferenceController {
|
||||
|
||||
private static final String TAG = "SysUpdatePrefContr";
|
||||
|
||||
static final String KEY_SYSTEM_UPDATE_SETTINGS = "system_update_settings";
|
||||
static final String KEY_UPDATE_SETTING = "additional_system_update_settings";
|
||||
|
||||
private final Context mContext;
|
||||
private final UserManager mUm;
|
||||
|
||||
public SystemUpdatePreferenceController(Context context, UserManager um) {
|
||||
mContext = context;
|
||||
super(context);
|
||||
mUm = um;
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays preference in this controller.
|
||||
*/
|
||||
@Override
|
||||
public void displayPreference(PreferenceScreen screen) {
|
||||
if (isAvailable(mContext, KEY_SYSTEM_UPDATE_SETTINGS)) {
|
||||
Utils.updatePreferenceToSpecificActivityOrRemove(mContext, screen,
|
||||
@@ -79,12 +77,7 @@ public class SystemUpdatePreferenceController {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles preference tree click
|
||||
*
|
||||
* @param preference the preference being clicked
|
||||
* @return true if click is handled
|
||||
*/
|
||||
@Override
|
||||
public boolean handlePreferenceTreeClick(Preference preference) {
|
||||
if (KEY_SYSTEM_UPDATE_SETTINGS.equals(preference.getKey())) {
|
||||
CarrierConfigManager configManager =
|
||||
@@ -113,16 +106,6 @@ public class SystemUpdatePreferenceController {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes preference from screen.
|
||||
*/
|
||||
private void removePreference(PreferenceScreen screen, String key) {
|
||||
Preference pref = screen.findPreference(key);
|
||||
if (pref != null) {
|
||||
screen.removePreference(pref);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Trigger client initiated action (send intent) on system update
|
||||
*/
|
||||
|
Reference in New Issue
Block a user