DeviceInfo: Wrap prefereces in PreferenceController

Bug: 34774945
Test: make RunSettingsRoboTests
Change-Id: I8bf56b436064684f4d2010e6899548249af69fc3
This commit is contained in:
Fan Zhang
2017-02-23 16:05:30 -08:00
parent 7e0df1e48c
commit 69e95c6e75
7 changed files with 193 additions and 78 deletions

View File

@@ -0,0 +1,28 @@
package com.android.settings.deviceinfo;
import android.content.Context;
import android.os.SystemProperties;
import android.text.TextUtils;
import com.android.settings.core.PreferenceController;
public class SafetyLegalPreferenceController extends PreferenceController {
private static final String KEY_SAFETY_LEGAL = "safetylegal";
private static final String PROPERTY_URL_SAFETYLEGAL = "ro.url.safetylegal";
public SafetyLegalPreferenceController(Context context) {
super(context);
}
@Override
public boolean isAvailable() {
return !TextUtils.isEmpty(SystemProperties.get(PROPERTY_URL_SAFETYLEGAL));
}
@Override
public String getPreferenceKey() {
return KEY_SAFETY_LEGAL;
}
}