11b3ec0474875ce754c3f7cd80f762b091d48b627Doris Ling/*
21b3ec0474875ce754c3f7cd80f762b091d48b627Doris Ling * Copyright (C) 2016 The Android Open Source Project
31b3ec0474875ce754c3f7cd80f762b091d48b627Doris Ling *
41b3ec0474875ce754c3f7cd80f762b091d48b627Doris Ling * Licensed under the Apache License, Version 2.0 (the "License");
51b3ec0474875ce754c3f7cd80f762b091d48b627Doris Ling * you may not use this file except in compliance with the License.
61b3ec0474875ce754c3f7cd80f762b091d48b627Doris Ling * You may obtain a copy of the License at
71b3ec0474875ce754c3f7cd80f762b091d48b627Doris Ling *
81b3ec0474875ce754c3f7cd80f762b091d48b627Doris Ling *      http://www.apache.org/licenses/LICENSE-2.0
91b3ec0474875ce754c3f7cd80f762b091d48b627Doris Ling *
101b3ec0474875ce754c3f7cd80f762b091d48b627Doris Ling * Unless required by applicable law or agreed to in writing, software
111b3ec0474875ce754c3f7cd80f762b091d48b627Doris Ling * distributed under the License is distributed on an "AS IS" BASIS,
121b3ec0474875ce754c3f7cd80f762b091d48b627Doris Ling * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
131b3ec0474875ce754c3f7cd80f762b091d48b627Doris Ling * See the License for the specific language governing permissions and
141b3ec0474875ce754c3f7cd80f762b091d48b627Doris Ling * limitations under the License.
151b3ec0474875ce754c3f7cd80f762b091d48b627Doris Ling */
161b3ec0474875ce754c3f7cd80f762b091d48b627Doris Ling
171b3ec0474875ce754c3f7cd80f762b091d48b627Doris Lingpackage com.android.settings.notification;
181b3ec0474875ce754c3f7cd80f762b091d48b627Doris Ling
191b3ec0474875ce754c3f7cd80f762b091d48b627Doris Lingimport android.content.Context;
201b3ec0474875ce754c3f7cd80f762b091d48b627Doris Lingimport android.media.AudioManager;
211b3ec0474875ce754c3f7cd80f762b091d48b627Doris Lingimport com.android.settings.notification.VolumeSeekBarPreference.Callback;
22777ed2535a7fd6f618a0d12f381af99252283574Juan Langimport com.android.settingslib.core.lifecycle.Lifecycle;
231b3ec0474875ce754c3f7cd80f762b091d48b627Doris Ling
241b3ec0474875ce754c3f7cd80f762b091d48b627Doris Lingpublic class MediaVolumePreferenceController extends
251b3ec0474875ce754c3f7cd80f762b091d48b627Doris Ling    VolumeSeekBarPreferenceController {
261b3ec0474875ce754c3f7cd80f762b091d48b627Doris Ling
271b3ec0474875ce754c3f7cd80f762b091d48b627Doris Ling    private static final String KEY_MEDIA_VOLUME = "media_volume";
281b3ec0474875ce754c3f7cd80f762b091d48b627Doris Ling
291b3ec0474875ce754c3f7cd80f762b091d48b627Doris Ling    public MediaVolumePreferenceController(Context context, Callback callback, Lifecycle lifecycle) {
301b3ec0474875ce754c3f7cd80f762b091d48b627Doris Ling        super(context, callback, lifecycle);
311b3ec0474875ce754c3f7cd80f762b091d48b627Doris Ling    }
321b3ec0474875ce754c3f7cd80f762b091d48b627Doris Ling
331b3ec0474875ce754c3f7cd80f762b091d48b627Doris Ling    @Override
341b3ec0474875ce754c3f7cd80f762b091d48b627Doris Ling    public boolean isAvailable() {
351b3ec0474875ce754c3f7cd80f762b091d48b627Doris Ling        return true;
361b3ec0474875ce754c3f7cd80f762b091d48b627Doris Ling    }
371b3ec0474875ce754c3f7cd80f762b091d48b627Doris Ling
381b3ec0474875ce754c3f7cd80f762b091d48b627Doris Ling    @Override
391b3ec0474875ce754c3f7cd80f762b091d48b627Doris Ling    public String getPreferenceKey() {
401b3ec0474875ce754c3f7cd80f762b091d48b627Doris Ling        return KEY_MEDIA_VOLUME;
411b3ec0474875ce754c3f7cd80f762b091d48b627Doris Ling    }
421b3ec0474875ce754c3f7cd80f762b091d48b627Doris Ling
431b3ec0474875ce754c3f7cd80f762b091d48b627Doris Ling    @Override
441b3ec0474875ce754c3f7cd80f762b091d48b627Doris Ling    public int getAudioStream() {
451b3ec0474875ce754c3f7cd80f762b091d48b627Doris Ling        return AudioManager.STREAM_MUSIC;
461b3ec0474875ce754c3f7cd80f762b091d48b627Doris Ling    }
471b3ec0474875ce754c3f7cd80f762b091d48b627Doris Ling
481b3ec0474875ce754c3f7cd80f762b091d48b627Doris Ling    @Override
491b3ec0474875ce754c3f7cd80f762b091d48b627Doris Ling    public int getMuteIcon() {
501b3ec0474875ce754c3f7cd80f762b091d48b627Doris Ling        return com.android.internal.R.drawable.ic_audio_media_mute;
511b3ec0474875ce754c3f7cd80f762b091d48b627Doris Ling    }
521b3ec0474875ce754c3f7cd80f762b091d48b627Doris Ling
531b3ec0474875ce754c3f7cd80f762b091d48b627Doris Ling}
54