* commit '98f5e1861da4d708e7199b5d563895cf4d2c8db7': Move a line into try block
This commit is contained in:
@@ -71,7 +71,7 @@ public class DisplaySettings extends SettingsPreferenceFragment implements
|
|||||||
private CheckBoxPreference mNotificationPulse;
|
private CheckBoxPreference mNotificationPulse;
|
||||||
|
|
||||||
private final Configuration mCurConfig = new Configuration();
|
private final Configuration mCurConfig = new Configuration();
|
||||||
|
|
||||||
private ListPreference mScreenTimeoutPreference;
|
private ListPreference mScreenTimeoutPreference;
|
||||||
private Preference mScreenSaverPreference;
|
private Preference mScreenSaverPreference;
|
||||||
|
|
||||||
@@ -226,7 +226,7 @@ public class DisplaySettings extends SettingsPreferenceFragment implements
|
|||||||
}
|
}
|
||||||
return indices.length-1;
|
return indices.length-1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void readFontSizePreference(ListPreference pref) {
|
public void readFontSizePreference(ListPreference pref) {
|
||||||
try {
|
try {
|
||||||
mCurConfig.updateFrom(ActivityManagerNative.getDefault().getConfiguration());
|
mCurConfig.updateFrom(ActivityManagerNative.getDefault().getConfiguration());
|
||||||
@@ -244,7 +244,7 @@ public class DisplaySettings extends SettingsPreferenceFragment implements
|
|||||||
pref.setSummary(String.format(res.getString(R.string.summary_font_size),
|
pref.setSummary(String.format(res.getString(R.string.summary_font_size),
|
||||||
fontSizeNames[index]));
|
fontSizeNames[index]));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onResume() {
|
public void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
@@ -350,8 +350,8 @@ public class DisplaySettings extends SettingsPreferenceFragment implements
|
|||||||
public boolean onPreferenceChange(Preference preference, Object objValue) {
|
public boolean onPreferenceChange(Preference preference, Object objValue) {
|
||||||
final String key = preference.getKey();
|
final String key = preference.getKey();
|
||||||
if (KEY_SCREEN_TIMEOUT.equals(key)) {
|
if (KEY_SCREEN_TIMEOUT.equals(key)) {
|
||||||
int value = Integer.parseInt((String) objValue);
|
|
||||||
try {
|
try {
|
||||||
|
int value = Integer.parseInt((String) objValue);
|
||||||
Settings.System.putInt(getContentResolver(), SCREEN_OFF_TIMEOUT, value);
|
Settings.System.putInt(getContentResolver(), SCREEN_OFF_TIMEOUT, value);
|
||||||
updateTimeoutPreferenceDescription(value);
|
updateTimeoutPreferenceDescription(value);
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
|
Reference in New Issue
Block a user