diff options
author | John Spurlock <jspurlock@google.com> | 2013-06-14 16:31:48 -0400 |
---|---|---|
committer | John Spurlock <jspurlock@google.com> | 2013-06-14 16:31:48 -0400 |
commit | 027e6f5800c07c6a50efbdf86b7d4d1ff69bf95d (patch) | |
tree | 979e8c8946267c2fdddff8a7b52114a7436ae174 /packages | |
parent | 77b7c33a7a4e79022529ae18e39789adbcc86159 (diff) | |
download | frameworks_base-027e6f5800c07c6a50efbdf86b7d4d1ff69bf95d.zip frameworks_base-027e6f5800c07c6a50efbdf86b7d4d1ff69bf95d.tar.gz frameworks_base-027e6f5800c07c6a50efbdf86b7d4d1ff69bf95d.tar.bz2 |
Remove unused VolumeController.
Change-Id: I23279c9c2f152bd9182487ce30da14078d108ff7
Diffstat (limited to 'packages')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/policy/VolumeController.java | 72 |
1 files changed, 0 insertions, 72 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/VolumeController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/VolumeController.java deleted file mode 100644 index d3707f2..0000000 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/VolumeController.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (C) 2010 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.systemui.statusbar.policy; - -import android.content.Context; -import android.media.AudioManager; -import android.os.Vibrator; - -import com.android.systemui.settings.ToggleSlider; - -public class VolumeController implements ToggleSlider.Listener { - private static final String TAG = "StatusBar.VolumeController"; - private static final int STREAM = AudioManager.STREAM_NOTIFICATION; - - private Context mContext; - private ToggleSlider mControl; - private AudioManager mAudioManager; - - private boolean mMute; - private int mVolume; - // Is there a vibrator - private final boolean mHasVibrator; - - public VolumeController(Context context, ToggleSlider control) { - mContext = context; - mControl = control; - - Vibrator vibrator = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE); - mHasVibrator = vibrator == null ? false : vibrator.hasVibrator(); - - mAudioManager = (AudioManager)context.getSystemService(Context.AUDIO_SERVICE); - - mMute = mAudioManager.getRingerMode() != AudioManager.RINGER_MODE_NORMAL; - mVolume = mAudioManager.getStreamVolume(STREAM); - - control.setOnChangedListener(this); - } - - @Override - public void onInit(ToggleSlider control) { - control.setMax(mAudioManager.getStreamMaxVolume(STREAM)); - control.setValue(mVolume); - control.setChecked(mMute); - } - - public void onChanged(ToggleSlider view, boolean tracking, boolean mute, int level) { - if (!tracking) { - if (mute) { - mAudioManager.setRingerMode( - mHasVibrator ? AudioManager.RINGER_MODE_VIBRATE - : AudioManager.RINGER_MODE_SILENT); - } else { - mAudioManager.setRingerMode(AudioManager.RINGER_MODE_NORMAL); - mAudioManager.setStreamVolume(STREAM, level, AudioManager.FLAG_PLAY_SOUND); - } - } - } -} |