Home | History | Annotate | Download | only in stub
      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
     32   public StubVoicemailClient() {}
     33 
     34   @Override
     35   public boolean isVoicemailModuleEnabled() {
     36     return false;
     37   }
     38 
     39   @Override
     40   public boolean isVoicemailEnabled(Context context, PhoneAccountHandle phoneAccountHandle) {
     41     return false;
     42   }
     43 
     44   @Override
     45   public void setVoicemailEnabled(
     46       Context context, PhoneAccountHandle phoneAccountHandle, boolean enabled) {}
     47 
     48   @Override
     49   public void appendOmtpVoicemailSelectionClause(
     50       Context context, StringBuilder where, List<String> selectionArgs) {}
     51 
     52   @Override
     53   public void appendOmtpVoicemailStatusSelectionClause(
     54       Context context, StringBuilder where, List<String> selectionArgs) {}
     55 
     56   @Override
     57   public String getSettingsFragment() {
     58     return null;
     59   }
     60 
     61   @Override
     62   public boolean isVoicemailArchiveEnabled(Context context, PhoneAccountHandle phoneAccountHandle) {
     63     return false;
     64   }
     65 
     66   @Override
     67   public boolean isVoicemailArchiveAvailable(Context context) {
     68     return false;
     69   }
     70 
     71   @Override
     72   public void setVoicemailArchiveEnabled(
     73       Context context, PhoneAccountHandle phoneAccountHandle, boolean value) {}
     74 
     75   @Override
     76   public Intent getSetPinIntent(Context context, PhoneAccountHandle phoneAccountHandle) {
     77     return new Intent(TelephonyManager.ACTION_CONFIGURE_VOICEMAIL);
     78   }
     79 
     80   @Override
     81   public boolean isActivated(Context context, PhoneAccountHandle phoneAccountHandle) {
     82     return false;
     83   }
     84 }
     85