1 /*
2  * Copyright (C) 2018 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.incallui.speakeasy;
18 
19 import android.content.Context;
20 import android.support.annotation.NonNull;
21 import android.support.annotation.Nullable;
22 import android.support.v4.app.Fragment;
23 import com.android.incallui.call.DialerCall;
24 import com.google.common.util.concurrent.Futures;
25 import com.google.common.util.concurrent.ListenableFuture;
26 import java.util.Optional;
27 import javax.inject.Inject;
28 
29 /** Default implementation of SpeakEasyCallManager. */
30 public class SpeakEasyCallManagerStub implements SpeakEasyCallManager {
31 
32   @Inject
SpeakEasyCallManagerStub()33   public SpeakEasyCallManagerStub() {}
34 
35   /** Returns an absent optional. */
36   @Override
37   @Nullable
getSpeakEasyFragment(DialerCall call)38   public Optional<Fragment> getSpeakEasyFragment(DialerCall call) {
39     return Optional.empty();
40   }
41 
42   /** Always inert in the stub. */
43   @Override
onCallRemoved(DialerCall call)44   public void onCallRemoved(DialerCall call) {}
45 
46   @Override
onNewIncomingCall(@onNull DialerCall call)47   public ListenableFuture<Void> onNewIncomingCall(@NonNull DialerCall call) {
48     return Futures.immediateFuture(null);
49   }
50 
51   /** Always returns false. */
52   @Override
isAvailable(@onNull Context unused)53   public boolean isAvailable(@NonNull Context unused) {
54     return false;
55   }
56 
57   /** Always returns a stub string. */
58   @NonNull
59   @Override
getConfigProviderFlag()60   public String getConfigProviderFlag() {
61     return "not_yet_implmented";
62   }
63 }
64