wifi-display: add certification options

- Checkbox to show certification menu in "Developer options"

- Certification menu to Wireless Display Settings, providing
  misc control options required to certify

Bug: 9371882
Change-Id: Icf74d1122a9dc813b2cf95b6606a8a600a6b9cd1
This commit is contained in:
Chong Zhang
2013-06-06 12:42:24 -07:00
parent 55fe056d96
commit 6c607384c4
4 changed files with 285 additions and 1 deletions

View File

@@ -136,6 +136,7 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
private static final String OVERLAY_DISPLAY_DEVICES_KEY = "overlay_display_devices";
private static final String DEBUG_DEBUGGING_CATEGORY_KEY = "debug_debugging_category";
private static final String DEBUG_APPLICATIONS_CATEGORY_KEY = "debug_applications_category";
private static final String WIFI_DISPLAY_CERTIFICATION_KEY = "wifi_display_certification";
private static final String OPENGL_TRACES_KEY = "enable_opengl_traces";
@@ -179,6 +180,7 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
private Preference mDebugAppPref;
private CheckBoxPreference mWaitForDebugger;
private CheckBoxPreference mVerifyAppsOverUsb;
private CheckBoxPreference mWifiDisplayCertification;
private CheckBoxPreference mStrictMode;
private CheckBoxPreference mPointerLocation;
@@ -307,6 +309,7 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
mDebugLayout = findAndInitCheckboxPref(DEBUG_LAYOUT_KEY);
mForceRtlLayout = findAndInitCheckboxPref(FORCE_RTL_LAYOUT_KEY);
mDebugHwOverdraw = addListPreference(DEBUG_HW_OVERDRAW_KEY);
mWifiDisplayCertification = findAndInitCheckboxPref(WIFI_DISPLAY_CERTIFICATION_KEY);
mWindowAnimationScale = addListPreference(WINDOW_ANIMATION_SCALE_KEY);
mTransitionAnimationScale = addListPreference(TRANSITION_ANIMATION_SCALE_KEY);
mAnimatorDurationScale = addListPreference(ANIMATOR_DURATION_SCALE_KEY);
@@ -527,6 +530,7 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
updateVerifyAppsOverUsbOptions();
updateBugreportOptions();
updateForceRtlOptions();
updateWifiDisplayCertificationOptions();
}
private void resetDangerousOptions() {
@@ -976,6 +980,18 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
LocalePicker.updateLocale(getActivity().getResources().getConfiguration().locale);
}
private void updateWifiDisplayCertificationOptions() {
updateCheckBox(mWifiDisplayCertification, Settings.Global.getInt(
getActivity().getContentResolver(),
Settings.Global.WIFI_DISPLAY_CERTIFICATION_ON, 0) != 0);
}
private void writeWifiDisplayCertificationOptions() {
Settings.Global.putInt(getActivity().getContentResolver(),
Settings.Global.WIFI_DISPLAY_CERTIFICATION_ON,
mWifiDisplayCertification.isChecked() ? 1 : 0);
}
private void updateCpuUsageOptions() {
updateCheckBox(mShowCpuUsage, Settings.Global.getInt(getActivity().getContentResolver(),
Settings.Global.SHOW_PROCESSES, 0) != 0);
@@ -1283,6 +1299,8 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
writeDebugLayoutOptions();
} else if (preference == mForceRtlLayout) {
writeForceRtlOptions();
} else if (preference == mWifiDisplayCertification) {
writeWifiDisplayCertificationOptions();
} else {
return super.onPreferenceTreeClick(preferenceScreen, preference);
}