Fix preference
This commit is contained in:
parent
4578884dce
commit
7bc3aa7ea8
3 changed files with 9 additions and 9 deletions
|
@ -265,7 +265,7 @@ public class MapActivity extends AccessibleActivity implements
|
||||||
}
|
}
|
||||||
|
|
||||||
private void changeKeyguardFlags() {
|
private void changeKeyguardFlags() {
|
||||||
if (settings.WAKE_ON_VOICE.get() > 0) {
|
if (settings.WAKE_ON_VOICE_INT.get() > 0) {
|
||||||
getWindow().setFlags(
|
getWindow().setFlags(
|
||||||
WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD
|
WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD
|
||||||
| WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED,
|
| WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED,
|
||||||
|
@ -589,7 +589,7 @@ public class MapActivity extends AccessibleActivity implements
|
||||||
progressDlg.dismiss();
|
progressDlg.dismiss();
|
||||||
progressDlg = null;
|
progressDlg = null;
|
||||||
}
|
}
|
||||||
if (!isFinishing() && (settings.WAKE_ON_VOICE.get() > 0)) {
|
if (!isFinishing() && (settings.WAKE_ON_VOICE_INT.get() > 0)) {
|
||||||
VoiceRouter voiceRouter = app.getRoutingHelper().getVoiceRouter();
|
VoiceRouter voiceRouter = app.getRoutingHelper().getVoiceRouter();
|
||||||
voiceRouter.addVoiceMessageListener(this);
|
voiceRouter.addVoiceMessageListener(this);
|
||||||
}
|
}
|
||||||
|
@ -811,7 +811,7 @@ public class MapActivity extends AccessibleActivity implements
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onVoiceMessage() {
|
public void onVoiceMessage() {
|
||||||
final Integer screenPowerSave = settings.WAKE_ON_VOICE.get();
|
final Integer screenPowerSave = settings.WAKE_ON_VOICE_INT.get();
|
||||||
if (screenPowerSave > 0) {
|
if (screenPowerSave > 0) {
|
||||||
uiHandler.removeCallbacks(releaseWakeLocksRunnable);
|
uiHandler.removeCallbacks(releaseWakeLocksRunnable);
|
||||||
|
|
||||||
|
@ -835,7 +835,7 @@ public class MapActivity extends AccessibleActivity implements
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mDevicePolicyManager != null && mDeviceAdmin != null) {
|
if (mDevicePolicyManager != null && mDeviceAdmin != null) {
|
||||||
final Integer screenPowerSave = settings.WAKE_ON_VOICE.get();
|
final Integer screenPowerSave = settings.WAKE_ON_VOICE_INT.get();
|
||||||
if (screenPowerSave > 0) {
|
if (screenPowerSave > 0) {
|
||||||
if (mDevicePolicyManager.isAdminActive(mDeviceAdmin)) {
|
if (mDevicePolicyManager.isAdminActive(mDeviceAdmin)) {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -65,7 +65,7 @@ public class SettingsNavigationActivity extends SettingsBaseActivity {
|
||||||
if (resultCode == RESULT_OK) {
|
if (resultCode == RESULT_OK) {
|
||||||
// Log.d("DeviceAdmin", "Lock screen permission approved.");
|
// Log.d("DeviceAdmin", "Lock screen permission approved.");
|
||||||
} else {
|
} else {
|
||||||
settings.WAKE_ON_VOICE.set(0);
|
settings.WAKE_ON_VOICE_INT.set(0);
|
||||||
// Log.d("DeviceAdmin", "Lock screen permission refused.");
|
// Log.d("DeviceAdmin", "Lock screen permission refused.");
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
@ -140,7 +140,7 @@ public class SettingsNavigationActivity extends SettingsBaseActivity {
|
||||||
screenPowerSaveNames[i] = screenPowerSaveValues[i] + " "
|
screenPowerSaveNames[i] = screenPowerSaveValues[i] + " "
|
||||||
+ getString(R.string.int_seconds);
|
+ getString(R.string.int_seconds);
|
||||||
}
|
}
|
||||||
registerListPreference(settings.WAKE_ON_VOICE, screen, screenPowerSaveNames, screenPowerSaveValues);
|
registerListPreference(settings.WAKE_ON_VOICE_INT, screen, screenPowerSaveNames, screenPowerSaveValues);
|
||||||
|
|
||||||
registerBooleanPreference(settings.SHOW_ZOOM_BUTTONS_NAVIGATION, screen);
|
registerBooleanPreference(settings.SHOW_ZOOM_BUTTONS_NAVIGATION, screen);
|
||||||
|
|
||||||
|
@ -298,7 +298,7 @@ public class SettingsNavigationActivity extends SettingsBaseActivity {
|
||||||
+ settings.ROUTER_SERVICE.get() + "]");
|
+ settings.ROUTER_SERVICE.get() + "]");
|
||||||
prepareRoutingPrefs(getPreferenceScreen());
|
prepareRoutingPrefs(getPreferenceScreen());
|
||||||
super.updateAllSettings();
|
super.updateAllSettings();
|
||||||
} else if (id.equals(settings.WAKE_ON_VOICE.getId())) {
|
} else if (id.equals(settings.WAKE_ON_VOICE_INT.getId())) {
|
||||||
Integer value;
|
Integer value;
|
||||||
try {
|
try {
|
||||||
value = Integer.parseInt(newValue.toString());
|
value = Integer.parseInt(newValue.toString());
|
||||||
|
|
|
@ -871,11 +871,11 @@ public class VoiceRouter {
|
||||||
for (final VoiceMessageListener voiceMessageListener : voiceMessageListeners) {
|
for (final VoiceMessageListener voiceMessageListener : voiceMessageListeners) {
|
||||||
Runnable closure = new Runnable() {
|
Runnable closure = new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
if (settings.WAKE_ON_VOICE.get() > 0) {
|
if (settings.WAKE_ON_VOICE_INT.get() > 0) {
|
||||||
synchronized (voiceMessageListeners) {
|
synchronized (voiceMessageListeners) {
|
||||||
if (voiceMessageListeners
|
if (voiceMessageListeners
|
||||||
.contains(voiceMessageListener)
|
.contains(voiceMessageListener)
|
||||||
&& (settings.WAKE_ON_VOICE.get() > 0)) {
|
&& (settings.WAKE_ON_VOICE_INT.get() > 0)) {
|
||||||
voiceMessageListener
|
voiceMessageListener
|
||||||
.onVoiceMessage();
|
.onVoiceMessage();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue