aboutsummaryrefslogtreecommitdiffstats
path: root/app/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main')
-rw-r--r--app/src/main/java/org/connectbot/service/TerminalManager.java13
1 files changed, 4 insertions, 9 deletions
diff --git a/app/src/main/java/org/connectbot/service/TerminalManager.java b/app/src/main/java/org/connectbot/service/TerminalManager.java
index e716094..73eb4d1 100644
--- a/app/src/main/java/org/connectbot/service/TerminalManager.java
+++ b/app/src/main/java/org/connectbot/service/TerminalManager.java
@@ -53,7 +53,6 @@ import android.content.res.Configuration;
import android.content.res.Resources;
import android.media.AudioManager;
import android.media.MediaPlayer;
-import android.media.MediaPlayer.OnCompletionListener;
import android.net.Uri;
import android.os.Binder;
import android.os.IBinder;
@@ -560,10 +559,10 @@ public class TerminalManager extends Service implements BridgeDisconnectedListen
PreferenceConstants.DEFAULT_BELL_VOLUME);
mediaPlayer.setAudioStreamType(AudioManager.STREAM_NOTIFICATION);
- mediaPlayer.setOnCompletionListener(new BeepListener());
AssetFileDescriptor file = res.openRawResourceFd(R.raw.bell);
try {
+ mediaPlayer.setLooping(false);
mediaPlayer.setDataSource(file.getFileDescriptor(), file
.getStartOffset(), file.getLength());
file.close();
@@ -582,19 +581,15 @@ public class TerminalManager extends Service implements BridgeDisconnectedListen
}
public void playBeep() {
- if (mediaPlayer != null)
+ if (mediaPlayer != null) {
+ mediaPlayer.seekTo(0);
mediaPlayer.start();
+ }
if (wantBellVibration)
vibrate();
}
- private static class BeepListener implements OnCompletionListener {
- public void onCompletion(MediaPlayer mp) {
- mp.seekTo(0);
- }
- }
-
/**
* Send system notification to user for a certain host. When user selects
* the notification, it will bring them directly to the ConsoleActivity