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