Moving compatibilty mode option to spare parts
This commit is contained in:
@@ -64,4 +64,11 @@
|
|||||||
<string name="summary_off_maps_compass">Compass is not displayed in Maps</string>
|
<string name="summary_off_maps_compass">Compass is not displayed in Maps</string>
|
||||||
|
|
||||||
<string name="development_settings_show_maps_compass_text">Show compass in Maps</string>
|
<string name="development_settings_show_maps_compass_text">Show compass in Maps</string>
|
||||||
|
|
||||||
|
<!-- Sound & display settings screen, compatibility mode check box label -->
|
||||||
|
<string name="compatibility_mode_title">Compatibility Mode</string>
|
||||||
|
<!-- Sound & display settings screen, compatibility mode option summary text when check box is selected -->
|
||||||
|
<string name="compatibility_mode_summary_on">Run older apps in Compatibility mode. This require rebooting. </string>
|
||||||
|
<!-- Sound & display settings screen, compatibility mode option summary text when check box is clear -->
|
||||||
|
<string name="compatibility_mode_summary_off">Run older apps in Compatibility mode. This require rebooting. </string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -94,6 +94,12 @@
|
|||||||
android:summaryOn="@string/summary_on_haptic_feedback"
|
android:summaryOn="@string/summary_on_haptic_feedback"
|
||||||
android:summaryOff="@string/summary_off_haptic_feedback"/>
|
android:summaryOff="@string/summary_off_haptic_feedback"/>
|
||||||
|
|
||||||
|
|
||||||
|
<CheckBoxPreference
|
||||||
|
android:key="compatibility_mode"
|
||||||
|
android:title="@string/compatibility_mode_title"
|
||||||
|
android:summaryOn="@string/compatibility_mode_summary_on"
|
||||||
|
android:summaryOff="@string/compatibility_mode_summary_off" />
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
|
|
||||||
<PreferenceCategory
|
<PreferenceCategory
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ public class SpareParts extends PreferenceActivity
|
|||||||
private static final String FONT_SIZE_PREF = "font_size";
|
private static final String FONT_SIZE_PREF = "font_size";
|
||||||
private static final String END_BUTTON_PREF = "end_button";
|
private static final String END_BUTTON_PREF = "end_button";
|
||||||
private static final String MAPS_COMPASS_PREF = "maps_compass";
|
private static final String MAPS_COMPASS_PREF = "maps_compass";
|
||||||
|
private static final String KEY_COMPATIBILITY_MODE = "compatibility_mode";
|
||||||
|
|
||||||
private final Configuration mCurConfig = new Configuration();
|
private final Configuration mCurConfig = new Configuration();
|
||||||
|
|
||||||
@@ -68,6 +69,7 @@ public class SpareParts extends PreferenceActivity
|
|||||||
private ListPreference mFontSizePref;
|
private ListPreference mFontSizePref;
|
||||||
private ListPreference mEndButtonPref;
|
private ListPreference mEndButtonPref;
|
||||||
private CheckBoxPreference mShowMapsCompassPref;
|
private CheckBoxPreference mShowMapsCompassPref;
|
||||||
|
private CheckBoxPreference mCompatibilityMode;
|
||||||
|
|
||||||
private IWindowManager mWindowManager;
|
private IWindowManager mWindowManager;
|
||||||
|
|
||||||
@@ -124,6 +126,10 @@ public class SpareParts extends PreferenceActivity
|
|||||||
mEndButtonPref = (ListPreference) prefSet.findPreference(END_BUTTON_PREF);
|
mEndButtonPref = (ListPreference) prefSet.findPreference(END_BUTTON_PREF);
|
||||||
mEndButtonPref.setOnPreferenceChangeListener(this);
|
mEndButtonPref.setOnPreferenceChangeListener(this);
|
||||||
mShowMapsCompassPref = (CheckBoxPreference) prefSet.findPreference(MAPS_COMPASS_PREF);
|
mShowMapsCompassPref = (CheckBoxPreference) prefSet.findPreference(MAPS_COMPASS_PREF);
|
||||||
|
mCompatibilityMode = (CheckBoxPreference) findPreference(KEY_COMPATIBILITY_MODE);
|
||||||
|
mCompatibilityMode.setPersistent(false);
|
||||||
|
mCompatibilityMode.setChecked(Settings.System.getInt(getContentResolver(),
|
||||||
|
Settings.System.COMPATIBILITY_MODE, 1) != 0);
|
||||||
|
|
||||||
mWindowManager = IWindowManager.Stub.asInterface(ServiceManager.getService("window"));
|
mWindowManager = IWindowManager.Stub.asInterface(ServiceManager.getService("window"));
|
||||||
|
|
||||||
@@ -165,11 +171,21 @@ public class SpareParts extends PreferenceActivity
|
|||||||
} else if (preference == mEndButtonPref) {
|
} else if (preference == mEndButtonPref) {
|
||||||
writeEndButtonPreference(objValue);
|
writeEndButtonPreference(objValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
// always let the preference setting proceed.
|
// always let the preference setting proceed.
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) {
|
||||||
|
if (preference == mCompatibilityMode) {
|
||||||
|
Settings.System.putInt(getContentResolver(),
|
||||||
|
Settings.System.COMPATIBILITY_MODE,
|
||||||
|
mCompatibilityMode.isChecked() ? 1 : 0);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public void writeAnimationPreference(int which, Object objValue) {
|
public void writeAnimationPreference(int which, Object objValue) {
|
||||||
try {
|
try {
|
||||||
float val = Float.parseFloat(objValue.toString());
|
float val = Float.parseFloat(objValue.toString());
|
||||||
|
|||||||
Reference in New Issue
Block a user