• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2017 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License
15  */
16 
17 package com.android.voicemail.stub;
18 
19 import android.content.Context;
20 import android.content.Intent;
21 import android.telecom.PhoneAccountHandle;
22 import android.telephony.TelephonyManager;
23 import com.android.voicemail.VoicemailClient;
24 import java.util.List;
25 import javax.inject.Inject;
26 
27 /**
28  * A no-op version of the voicemail module for build targets that don't support the new OTMP client.
29  */
30 public final class StubVoicemailClient implements VoicemailClient {
31   @Inject
StubVoicemailClient()32   public StubVoicemailClient() {}
33 
34   @Override
isVoicemailModuleEnabled()35   public boolean isVoicemailModuleEnabled() {
36     return false;
37   }
38 
39   @Override
isVoicemailEnabled(Context context, PhoneAccountHandle phoneAccountHandle)40   public boolean isVoicemailEnabled(Context context, PhoneAccountHandle phoneAccountHandle) {
41     return false;
42   }
43 
44   @Override
setVoicemailEnabled( Context context, PhoneAccountHandle phoneAccountHandle, boolean enabled)45   public void setVoicemailEnabled(
46       Context context, PhoneAccountHandle phoneAccountHandle, boolean enabled) {}
47 
48   @Override
appendOmtpVoicemailSelectionClause( Context context, StringBuilder where, List<String> selectionArgs)49   public void appendOmtpVoicemailSelectionClause(
50       Context context, StringBuilder where, List<String> selectionArgs) {}
51 
52   @Override
appendOmtpVoicemailStatusSelectionClause( Context context, StringBuilder where, List<String> selectionArgs)53   public void appendOmtpVoicemailStatusSelectionClause(
54       Context context, StringBuilder where, List<String> selectionArgs) {}
55 
56   @Override
getSettingsFragment()57   public String getSettingsFragment() {
58     return null;
59   }
60 
61   @Override
isVoicemailArchiveEnabled(Context context, PhoneAccountHandle phoneAccountHandle)62   public boolean isVoicemailArchiveEnabled(Context context, PhoneAccountHandle phoneAccountHandle) {
63     return false;
64   }
65 
66   @Override
isVoicemailArchiveAvailable(Context context)67   public boolean isVoicemailArchiveAvailable(Context context) {
68     return false;
69   }
70 
71   @Override
setVoicemailArchiveEnabled( Context context, PhoneAccountHandle phoneAccountHandle, boolean value)72   public void setVoicemailArchiveEnabled(
73       Context context, PhoneAccountHandle phoneAccountHandle, boolean value) {}
74 
75   @Override
getSetPinIntent(Context context, PhoneAccountHandle phoneAccountHandle)76   public Intent getSetPinIntent(Context context, PhoneAccountHandle phoneAccountHandle) {
77     return new Intent(TelephonyManager.ACTION_CONFIGURE_VOICEMAIL);
78   }
79 
80   @Override
isActivated(Context context, PhoneAccountHandle phoneAccountHandle)81   public boolean isActivated(Context context, PhoneAccountHandle phoneAccountHandle) {
82     return false;
83   }
84 }
85