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() {
|
||||
if (settings.WAKE_ON_VOICE.get() > 0) {
|
||||
if (settings.WAKE_ON_VOICE_INT.get() > 0) {
|
||||
getWindow().setFlags(
|
||||
WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD
|
||||
| WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED,
|
||||
|
@ -589,7 +589,7 @@ public class MapActivity extends AccessibleActivity implements
|
|||
progressDlg.dismiss();
|
||||
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.addVoiceMessageListener(this);
|
||||
}
|
||||
|
@ -811,7 +811,7 @@ public class MapActivity extends AccessibleActivity implements
|
|||
|
||||
@Override
|
||||
public void onVoiceMessage() {
|
||||
final Integer screenPowerSave = settings.WAKE_ON_VOICE.get();
|
||||
final Integer screenPowerSave = settings.WAKE_ON_VOICE_INT.get();
|
||||
if (screenPowerSave > 0) {
|
||||
uiHandler.removeCallbacks(releaseWakeLocksRunnable);
|
||||
|
||||
|
@ -835,7 +835,7 @@ public class MapActivity extends AccessibleActivity implements
|
|||
}
|
||||
|
||||
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 (mDevicePolicyManager.isAdminActive(mDeviceAdmin)) {
|
||||
try {
|
||||
|
|
|
@ -65,7 +65,7 @@ public class SettingsNavigationActivity extends SettingsBaseActivity {
|
|||
if (resultCode == RESULT_OK) {
|
||||
// Log.d("DeviceAdmin", "Lock screen permission approved.");
|
||||
} else {
|
||||
settings.WAKE_ON_VOICE.set(0);
|
||||
settings.WAKE_ON_VOICE_INT.set(0);
|
||||
// Log.d("DeviceAdmin", "Lock screen permission refused.");
|
||||
}
|
||||
return;
|
||||
|
@ -140,7 +140,7 @@ public class SettingsNavigationActivity extends SettingsBaseActivity {
|
|||
screenPowerSaveNames[i] = screenPowerSaveValues[i] + " "
|
||||
+ 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);
|
||||
|
||||
|
@ -298,7 +298,7 @@ public class SettingsNavigationActivity extends SettingsBaseActivity {
|
|||
+ settings.ROUTER_SERVICE.get() + "]");
|
||||
prepareRoutingPrefs(getPreferenceScreen());
|
||||
super.updateAllSettings();
|
||||
} else if (id.equals(settings.WAKE_ON_VOICE.getId())) {
|
||||
} else if (id.equals(settings.WAKE_ON_VOICE_INT.getId())) {
|
||||
Integer value;
|
||||
try {
|
||||
value = Integer.parseInt(newValue.toString());
|
||||
|
|
|
@ -871,11 +871,11 @@ public class VoiceRouter {
|
|||
for (final VoiceMessageListener voiceMessageListener : voiceMessageListeners) {
|
||||
Runnable closure = new Runnable() {
|
||||
public void run() {
|
||||
if (settings.WAKE_ON_VOICE.get() > 0) {
|
||||
if (settings.WAKE_ON_VOICE_INT.get() > 0) {
|
||||
synchronized (voiceMessageListeners) {
|
||||
if (voiceMessageListeners
|
||||
.contains(voiceMessageListener)
|
||||
&& (settings.WAKE_ON_VOICE.get() > 0)) {
|
||||
&& (settings.WAKE_ON_VOICE_INT.get() > 0)) {
|
||||
voiceMessageListener
|
||||
.onVoiceMessage();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue