16c2cf0dbc58caced6803a77e055e19b614dd2148Doris Ling/* 26c2cf0dbc58caced6803a77e055e19b614dd2148Doris Ling * Copyright (C) 2016 The Android Open Source Project 36c2cf0dbc58caced6803a77e055e19b614dd2148Doris Ling * 46c2cf0dbc58caced6803a77e055e19b614dd2148Doris Ling * Licensed under the Apache License, Version 2.0 (the "License"); 56c2cf0dbc58caced6803a77e055e19b614dd2148Doris Ling * you may not use this file except in compliance with the License. 66c2cf0dbc58caced6803a77e055e19b614dd2148Doris Ling * You may obtain a copy of the License at 76c2cf0dbc58caced6803a77e055e19b614dd2148Doris Ling * 86c2cf0dbc58caced6803a77e055e19b614dd2148Doris Ling * http://www.apache.org/licenses/LICENSE-2.0 96c2cf0dbc58caced6803a77e055e19b614dd2148Doris Ling * 106c2cf0dbc58caced6803a77e055e19b614dd2148Doris Ling * Unless required by applicable law or agreed to in writing, software 116c2cf0dbc58caced6803a77e055e19b614dd2148Doris Ling * distributed under the License is distributed on an "AS IS" BASIS, 126c2cf0dbc58caced6803a77e055e19b614dd2148Doris Ling * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 136c2cf0dbc58caced6803a77e055e19b614dd2148Doris Ling * See the License for the specific language governing permissions and 146c2cf0dbc58caced6803a77e055e19b614dd2148Doris Ling * limitations under the License. 156c2cf0dbc58caced6803a77e055e19b614dd2148Doris Ling */ 166c2cf0dbc58caced6803a77e055e19b614dd2148Doris Ling 176c2cf0dbc58caced6803a77e055e19b614dd2148Doris Lingpackage com.android.settings.notification; 186c2cf0dbc58caced6803a77e055e19b614dd2148Doris Ling 196c2cf0dbc58caced6803a77e055e19b614dd2148Doris Lingimport android.content.Context; 206c2cf0dbc58caced6803a77e055e19b614dd2148Doris Lingimport android.media.RingtoneManager; 216c2cf0dbc58caced6803a77e055e19b614dd2148Doris Lingimport com.android.settings.Utils; 226c2cf0dbc58caced6803a77e055e19b614dd2148Doris Ling 236c2cf0dbc58caced6803a77e055e19b614dd2148Doris Lingpublic class PhoneRingtonePreferenceController extends RingtonePreferenceControllerBase { 246c2cf0dbc58caced6803a77e055e19b614dd2148Doris Ling 256c2cf0dbc58caced6803a77e055e19b614dd2148Doris Ling private static final String KEY_PHONE_RINGTONE = "ringtone"; 266c2cf0dbc58caced6803a77e055e19b614dd2148Doris Ling 276c2cf0dbc58caced6803a77e055e19b614dd2148Doris Ling public PhoneRingtonePreferenceController(Context context) { 286c2cf0dbc58caced6803a77e055e19b614dd2148Doris Ling super(context); 296c2cf0dbc58caced6803a77e055e19b614dd2148Doris Ling } 306c2cf0dbc58caced6803a77e055e19b614dd2148Doris Ling 316c2cf0dbc58caced6803a77e055e19b614dd2148Doris Ling @Override 326c2cf0dbc58caced6803a77e055e19b614dd2148Doris Ling public String getPreferenceKey() { 336c2cf0dbc58caced6803a77e055e19b614dd2148Doris Ling return KEY_PHONE_RINGTONE; 346c2cf0dbc58caced6803a77e055e19b614dd2148Doris Ling } 356c2cf0dbc58caced6803a77e055e19b614dd2148Doris Ling 366c2cf0dbc58caced6803a77e055e19b614dd2148Doris Ling @Override 376c2cf0dbc58caced6803a77e055e19b614dd2148Doris Ling public boolean isAvailable() { 386c2cf0dbc58caced6803a77e055e19b614dd2148Doris Ling return Utils.isVoiceCapable(mContext); 396c2cf0dbc58caced6803a77e055e19b614dd2148Doris Ling } 406c2cf0dbc58caced6803a77e055e19b614dd2148Doris Ling 416c2cf0dbc58caced6803a77e055e19b614dd2148Doris Ling @Override 426c2cf0dbc58caced6803a77e055e19b614dd2148Doris Ling public int getRingtoneType() { 436c2cf0dbc58caced6803a77e055e19b614dd2148Doris Ling return RingtoneManager.TYPE_RINGTONE; 446c2cf0dbc58caced6803a77e055e19b614dd2148Doris Ling } 456c2cf0dbc58caced6803a77e055e19b614dd2148Doris Ling} 46