• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2016 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.dialer.enrichedcall.stub;
18 
19 import android.support.annotation.MainThread;
20 import android.support.annotation.NonNull;
21 import android.support.annotation.Nullable;
22 import com.android.dialer.calldetails.CallDetailsEntries;
23 import com.android.dialer.calldetails.CallDetailsEntries.CallDetailsEntry;
24 import com.android.dialer.common.Assert;
25 import com.android.dialer.enrichedcall.EnrichedCallCapabilities;
26 import com.android.dialer.enrichedcall.EnrichedCallManager;
27 import com.android.dialer.enrichedcall.Session;
28 import com.android.dialer.enrichedcall.historyquery.proto.HistoryResult;
29 import com.android.dialer.enrichedcall.videoshare.VideoShareListener;
30 import com.android.dialer.multimedia.MultimediaData;
31 import java.util.Collections;
32 import java.util.List;
33 import java.util.Map;
34 
35 /** Stub implementation of {@link EnrichedCallManager}. */
36 public final class EnrichedCallManagerStub implements EnrichedCallManager {
37 
38   @Override
registerCapabilitiesListener(@onNull CapabilitiesListener listener)39   public void registerCapabilitiesListener(@NonNull CapabilitiesListener listener) {}
40 
41   @Override
requestCapabilities(@onNull String number)42   public void requestCapabilities(@NonNull String number) {}
43 
44   @Override
unregisterCapabilitiesListener(@onNull CapabilitiesListener listener)45   public void unregisterCapabilitiesListener(@NonNull CapabilitiesListener listener) {}
46 
47   @Override
getCapabilities(@onNull String number)48   public EnrichedCallCapabilities getCapabilities(@NonNull String number) {
49     return null;
50   }
51 
52   @Override
clearCachedData()53   public void clearCachedData() {}
54 
55   @Override
startCallComposerSession(@onNull String number)56   public long startCallComposerSession(@NonNull String number) {
57     return Session.NO_SESSION_ID;
58   }
59 
60   @Override
sendCallComposerData(long sessionId, @NonNull MultimediaData data)61   public void sendCallComposerData(long sessionId, @NonNull MultimediaData data) {}
62 
63   @Override
endCallComposerSession(long sessionId)64   public void endCallComposerSession(long sessionId) {}
65 
66   @Override
sendPostCallNote(@onNull String number, @NonNull String message)67   public void sendPostCallNote(@NonNull String number, @NonNull String message) {}
68 
69   @Override
onCapabilitiesReceived( @onNull String number, @NonNull EnrichedCallCapabilities capabilities)70   public void onCapabilitiesReceived(
71       @NonNull String number, @NonNull EnrichedCallCapabilities capabilities) {}
72 
73   @Override
registerStateChangedListener(@onNull StateChangedListener listener)74   public void registerStateChangedListener(@NonNull StateChangedListener listener) {}
75 
76   @Nullable
77   @Override
getSession( @onNull String uniqueCallId, @NonNull String number, @Nullable Filter filter)78   public Session getSession(
79       @NonNull String uniqueCallId, @NonNull String number, @Nullable Filter filter) {
80     return null;
81   }
82 
83   @Nullable
84   @Override
getSession(long sessionId)85   public Session getSession(long sessionId) {
86     return null;
87   }
88 
89   @MainThread
90   @NonNull
91   @Override
getAllSessionsForDisplay()92   public List<String> getAllSessionsForDisplay() {
93     Assert.isMainThread();
94     return Collections.emptyList();
95   }
96 
97   @NonNull
98   @Override
createIncomingCallComposerFilter()99   public Filter createIncomingCallComposerFilter() {
100     return session -> false;
101   }
102 
103   @NonNull
104   @Override
createOutgoingCallComposerFilter()105   public Filter createOutgoingCallComposerFilter() {
106     return session -> false;
107   }
108 
109   @Nullable
110   @Override
111   @MainThread
getAllHistoricalData( @onNull String number, @NonNull CallDetailsEntries entries)112   public Map<CallDetailsEntry, List<HistoryResult>> getAllHistoricalData(
113       @NonNull String number, @NonNull CallDetailsEntries entries) {
114     Assert.isMainThread();
115     return null;
116   }
117 
118   @Override
hasStoredData()119   public boolean hasStoredData() {
120     Assert.isMainThread();
121     return false;
122   }
123 
124   @MainThread
125   @Override
requestAllHistoricalData( @onNull String number, @NonNull CallDetailsEntries entries)126   public void requestAllHistoricalData(
127       @NonNull String number, @NonNull CallDetailsEntries entries) {
128     Assert.isMainThread();
129   }
130 
131   @Override
unregisterStateChangedListener(@onNull StateChangedListener listener)132   public void unregisterStateChangedListener(@NonNull StateChangedListener listener) {}
133 
134   @Override
onSessionStatusUpdate(long sessionId, @NonNull String number, int state)135   public void onSessionStatusUpdate(long sessionId, @NonNull String number, int state) {}
136 
137   @Override
onMessageUpdate(long sessionId, @NonNull String messageId, int state)138   public void onMessageUpdate(long sessionId, @NonNull String messageId, int state) {}
139 
140   @Override
onIncomingCallComposerData(long sessionId, @NonNull MultimediaData multimediaData)141   public void onIncomingCallComposerData(long sessionId, @NonNull MultimediaData multimediaData) {}
142 
143   @Override
onIncomingPostCallData(long sessionId, @NonNull MultimediaData multimediaData)144   public void onIncomingPostCallData(long sessionId, @NonNull MultimediaData multimediaData) {}
145 
146   @Override
registerVideoShareListener(@onNull VideoShareListener listener)147   public void registerVideoShareListener(@NonNull VideoShareListener listener) {}
148 
149   @Override
unregisterVideoShareListener(@onNull VideoShareListener listener)150   public void unregisterVideoShareListener(@NonNull VideoShareListener listener) {}
151 
152   @Override
onIncomingVideoShareInvite(long sessionId, @NonNull String number)153   public boolean onIncomingVideoShareInvite(long sessionId, @NonNull String number) {
154     return false;
155   }
156 
157   @Override
startVideoShareSession(String number)158   public long startVideoShareSession(String number) {
159     return Session.NO_SESSION_ID;
160   }
161 
162   @Override
acceptVideoShareSession(long sessionId)163   public boolean acceptVideoShareSession(long sessionId) {
164     return false;
165   }
166 
167   @Override
getVideoShareInviteSessionId(@onNull String number)168   public long getVideoShareInviteSessionId(@NonNull String number) {
169     return Session.NO_SESSION_ID;
170   }
171 
172   @Override
endVideoShareSession(long sessionId)173   public void endVideoShareSession(long sessionId) {}
174 }
175