cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject cordova-plugin-media git commit: CB-11085 Fix error output using println to LOG.e
Date Tue, 30 Aug 2016 05:50:04 GMT
Repository: cordova-plugin-media
Updated Branches:
  refs/heads/master 22f99bcc8 -> 1dc6ecfbb


CB-11085 Fix error output using println to LOG.e

This closes #110


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/commit/1dc6ecfb
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/tree/1dc6ecfb
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/diff/1dc6ecfb

Branch: refs/heads/master
Commit: 1dc6ecfbb4473401bdafd2ae4271da9a0b45ad7e
Parents: 22f99bc
Author: sanjeewa894 <sanjeewaapp@gmail.com>
Authored: Tue Aug 23 23:14:29 2016 +0530
Committer: Steve Gill <stevengill97@gmail.com>
Committed: Mon Aug 29 22:49:13 2016 -0700

----------------------------------------------------------------------
 src/android/AudioHandler.java | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/blob/1dc6ecfb/src/android/AudioHandler.java
----------------------------------------------------------------------
diff --git a/src/android/AudioHandler.java b/src/android/AudioHandler.java
index 40c5442..1c473a6 100644
--- a/src/android/AudioHandler.java
+++ b/src/android/AudioHandler.java
@@ -386,6 +386,8 @@ public class AudioHandler extends CordovaPlugin {
      */
     @SuppressWarnings("deprecation")
     public void setAudioOutputDevice(int output) {
+        private static final String TAG1 = "AudioHandler.setAudioOutputDevice(): Error :
";
+
         AudioManager audiMgr = (AudioManager) this.cordova.getActivity().getSystemService(Context.AUDIO_SERVICE);
         if (output == 2) {
             audiMgr.setRouting(AudioManager.MODE_NORMAL, AudioManager.ROUTE_SPEAKER, AudioManager.ROUTE_ALL);
@@ -394,7 +396,7 @@ public class AudioHandler extends CordovaPlugin {
             audiMgr.setRouting(AudioManager.MODE_NORMAL, AudioManager.ROUTE_EARPIECE, AudioManager.ROUTE_ALL);
         }
         else {
-            System.out.println("AudioHandler.setAudioOutputDevice() Error: Unknown output
device.");
+             LOG.e(TAG1," Unknown output device");
         }
     }
 
@@ -435,13 +437,15 @@ public class AudioHandler extends CordovaPlugin {
         };
 
     public void getAudioFocus() {
+        private static final String TAG2 = "AudioHandler.getAudioFocus(): Error : ";
+
         AudioManager am = (AudioManager) this.cordova.getActivity().getSystemService(Context.AUDIO_SERVICE);
         int result = am.requestAudioFocus(focusChangeListener,
                                           AudioManager.STREAM_MUSIC,
                                           AudioManager.AUDIOFOCUS_GAIN);
 
         if (result != AudioManager.AUDIOFOCUS_REQUEST_GRANTED) {
-            System.out.println("AudioHandler.getAudioFocus() Error: Got " + result + " instead
of " + AudioManager.AUDIOFOCUS_REQUEST_GRANTED);
+            LOG.e(TAG2,result + " instead of " + AudioManager.AUDIOFOCUS_REQUEST_GRANTED);
         }
 
     }
@@ -473,11 +477,13 @@ public class AudioHandler extends CordovaPlugin {
      * @param volume            Volume to adjust to 0.0f - 1.0f
      */
     public void setVolume(String id, float volume) {
+        private static final String TAG3 = "AudioHandler.setVolume(): Error : ";
+
         AudioPlayer audio = this.players.get(id);
         if (audio != null) {
             audio.setVolume(volume);
         } else {
-            System.out.println("AudioHandler.setVolume() Error: Unknown Audio Player " +
id);
+          LOG.e(TAG3,"Unknown Audio Player " + id);
         }
     }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message