diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/soundrecorder/Recorder.java | 19 | ||||
-rw-r--r-- | src/com/android/soundrecorder/SoundRecorder.java | 25 | ||||
-rw-r--r-- | src/com/android/soundrecorder/VUMeter.java | 16 |
3 files changed, 53 insertions, 7 deletions
diff --git a/src/com/android/soundrecorder/Recorder.java b/src/com/android/soundrecorder/Recorder.java index cc24741..b9654cd 100644 --- a/src/com/android/soundrecorder/Recorder.java +++ b/src/com/android/soundrecorder/Recorder.java @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2011 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.android.soundrecorder; import java.io.File; @@ -164,7 +180,8 @@ public class Recorder implements OnCompletionListener, OnErrorListener { mRecorder.start(); } catch (RuntimeException exception) { AudioManager audioMngr = (AudioManager)context.getSystemService(Context.AUDIO_SERVICE); - boolean isInCall = audioMngr.getMode() == AudioManager.MODE_IN_CALL; + boolean isInCall = ((audioMngr.getMode() == AudioManager.MODE_IN_CALL) || + (audioMngr.getMode() == AudioManager.MODE_IN_COMMUNICATION)); if (isInCall) { setError(IN_CALL_RECORD_ERROR); } else { diff --git a/src/com/android/soundrecorder/SoundRecorder.java b/src/com/android/soundrecorder/SoundRecorder.java index 0fa48e7..14a896d 100644 --- a/src/com/android/soundrecorder/SoundRecorder.java +++ b/src/com/android/soundrecorder/SoundRecorder.java @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2011 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.android.soundrecorder; import java.io.File; @@ -711,10 +727,8 @@ public class SoundRecorder extends Activity mRecordButton.requestFocus(); mStateMessage1.setVisibility(View.INVISIBLE); - mStateLED.setVisibility(View.VISIBLE); - mStateLED.setImageResource(R.drawable.idle_led); - mStateMessage2.setVisibility(View.VISIBLE); - mStateMessage2.setText(res.getString(R.string.press_record)); + mStateLED.setVisibility(View.INVISIBLE); + mStateMessage2.setVisibility(View.INVISIBLE); mExitButtons.setVisibility(View.INVISIBLE); mVUMeter.setVisibility(View.VISIBLE); @@ -745,8 +759,7 @@ public class SoundRecorder extends Activity if (mSampleInterrupted) { mStateMessage2.setVisibility(View.VISIBLE); mStateMessage2.setText(res.getString(R.string.recording_stopped)); - mStateLED.setImageResource(R.drawable.idle_led); - mStateLED.setVisibility(View.VISIBLE); + mStateLED.setVisibility(View.INVISIBLE); } if (mErrorUiMessage != null) { diff --git a/src/com/android/soundrecorder/VUMeter.java b/src/com/android/soundrecorder/VUMeter.java index 6aee87d..0396284 100644 --- a/src/com/android/soundrecorder/VUMeter.java +++ b/src/com/android/soundrecorder/VUMeter.java @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2011 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.android.soundrecorder; import java.util.Map; |