comparison app/src/main/java/com/five_ten_sg/connectbot/service/TerminalManager.java @ 470:2cc170e3fc9b stable-1.9.3-8

audible bell checkbox enables/disables bell volume setting; monitor init string is now a url socket://target/initstring
author Carl Byington <carl@five-ten-sg.com>
date Fri, 04 Oct 2019 16:44:44 -0700
parents d29cce60f393
children f698820bffdf
comparison
equal deleted inserted replaced
469:fbb1a98998fb 470:2cc170e3fc9b
104 104
105 private Vibrator vibrator; 105 private Vibrator vibrator;
106 private volatile boolean wantKeyVibration; 106 private volatile boolean wantKeyVibration;
107 public static final long VIBRATE_DURATION = 30; 107 public static final long VIBRATE_DURATION = 30;
108 108
109 private boolean wantBell;
109 private boolean wantBellVibration; 110 private boolean wantBellVibration;
110 111
111 private boolean resizeAllowed = true; 112 private boolean resizeAllowed = true;
112 113
113 private int fullScreen = 0; 114 private int fullScreen = 0;
144 } 145 }
145 } 146 }
146 147
147 vibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE); 148 vibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
148 wantKeyVibration = prefs.getBoolean(PreferenceConstants.BUMPY_ARROWS, true); 149 wantKeyVibration = prefs.getBoolean(PreferenceConstants.BUMPY_ARROWS, true);
150 wantBell = prefs.getBoolean(PreferenceConstants.BELL, true);
149 wantBellVibration = prefs.getBoolean(PreferenceConstants.BELL_VIBRATE, true); 151 wantBellVibration = prefs.getBoolean(PreferenceConstants.BELL_VIBRATE, true);
150 enableMediaPlayer(); 152 if (wantBell) enableMediaPlayer();
151 hardKeyboardHidden = (res.getConfiguration().hardKeyboardHidden == 153 hardKeyboardHidden = (res.getConfiguration().hardKeyboardHidden ==
152 Configuration.HARDKEYBOARDHIDDEN_YES); 154 Configuration.HARDKEYBOARDHIDDEN_YES);
153 final boolean lockingWifi = prefs.getBoolean(PreferenceConstants.WIFI_LOCK, true); 155 final boolean lockingWifi = prefs.getBoolean(PreferenceConstants.WIFI_LOCK, true);
154 connectivityManager = new ConnectivityReceiver(this, lockingWifi); 156 connectivityManager = new ConnectivityReceiver(this, lockingWifi);
155 } 157 }
600 * @see android.content.SharedPreferences.OnSharedPreferenceChangeListener#onSharedPreferenceChanged(android.content.SharedPreferences, java.lang.String) 602 * @see android.content.SharedPreferences.OnSharedPreferenceChangeListener#onSharedPreferenceChanged(android.content.SharedPreferences, java.lang.String)
601 */ 603 */
602 public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, 604 public void onSharedPreferenceChanged(SharedPreferences sharedPreferences,
603 String key) { 605 String key) {
604 if (PreferenceConstants.BELL.equals(key)) { 606 if (PreferenceConstants.BELL.equals(key)) {
605 boolean wantAudible = sharedPreferences.getBoolean( 607 wantBell = sharedPreferences.getBoolean(PreferenceConstants.BELL, true);
606 PreferenceConstants.BELL, true); 608
607 609 if (wantBell && mediaPlayer == null)
608 if (wantAudible && mediaPlayer == null)
609 enableMediaPlayer(); 610 enableMediaPlayer();
610 else if (!wantAudible && mediaPlayer != null) 611 else if (!wantBell && mediaPlayer != null)
611 disableMediaPlayer(); 612 disableMediaPlayer();
612 } 613 }
613 else if (PreferenceConstants.BELL_VOLUME.equals(key)) { 614 else if (PreferenceConstants.BELL_VOLUME.equals(key)) {
614 if (mediaPlayer != null) { 615 if (mediaPlayer != null) {
615 float volume = sharedPreferences.getFloat( 616 float volume = sharedPreferences.getFloat(