@Implements(value=android.telecom.TelecomManager.class, minSdk=21) public class ShadowTelecomManager extends Object
Modifier and Type | Class | Description |
---|---|---|
static class |
ShadowTelecomManager.CallRecord |
Deprecated.
|
static class |
ShadowTelecomManager.CallRequestMode |
Mode describing how the shadow handles incoming (
TelecomManager.addNewIncomingCall(android.telecom.PhoneAccountHandle, android.os.Bundle) ) and
outgoing (TelecomManager.placeCall(android.net.Uri, android.os.Bundle) ) call requests. |
static class |
ShadowTelecomManager.IncomingCallRecord |
Details about an incoming call request made via
TelecomManager.addNewIncomingCall(android.telecom.PhoneAccountHandle, android.os.Bundle) . |
static class |
ShadowTelecomManager.OutgoingCallRecord |
Details about an outgoing call request made via
TelecomManager.placeCall(android.net.Uri, android.os.Bundle) . |
static class |
ShadowTelecomManager.UnknownCallRecord |
Details about an unknown call request made via
TelecomManager.addNewUnknownCall(android.telecom.PhoneAccountHandle, android.os.Bundle) . |
Constructor | Description |
---|---|
ShadowTelecomManager() |
public ShadowTelecomManager.CallRequestMode getCallRequestMode()
public void setCallRequestMode(ShadowTelecomManager.CallRequestMode callRequestMode)
public void setDefaultOutgoingPhoneAccount(String uriScheme, PhoneAccountHandle handle)
getDefaultOutgoingPhoneAccount(String)
for corresponding uriScheme
.public void removeDefaultOutgoingPhoneAccount(String uriScheme)
uriScheme
.@Implementation protected PhoneAccountHandle getDefaultOutgoingPhoneAccount(String uriScheme)
setDefaultOutgoingPhoneAccount(String, PhoneAccountHandle)
for corresponding
uriScheme
.@Implementation @HiddenApi public PhoneAccountHandle getUserSelectedOutgoingPhoneAccount()
@Implementation @HiddenApi public void setUserSelectedOutgoingPhoneAccount(PhoneAccountHandle accountHandle)
@Implementation protected PhoneAccountHandle getSimCallManager()
@Implementation(minSdk=23) @HiddenApi public PhoneAccountHandle getSimCallManager(int userId)
@Implementation @HiddenApi public PhoneAccountHandle getConnectionManager()
@Implementation @HiddenApi public List<PhoneAccountHandle> getPhoneAccountsSupportingScheme(String uriScheme)
@Implementation(minSdk=23) protected List<PhoneAccountHandle> getCallCapablePhoneAccounts()
@Implementation(minSdk=23) @HiddenApi public List<PhoneAccountHandle> getCallCapablePhoneAccounts(boolean includeDisabledAccounts)
@Implementation @HiddenApi public List<PhoneAccountHandle> getPhoneAccountsForPackage()
@Implementation protected PhoneAccount getPhoneAccount(PhoneAccountHandle account)
@Implementation @HiddenApi public int getAllPhoneAccountsCount()
@Implementation @HiddenApi public List<PhoneAccount> getAllPhoneAccounts()
@Implementation @HiddenApi public List<PhoneAccountHandle> getAllPhoneAccountHandles()
@Implementation protected void registerPhoneAccount(PhoneAccount account)
@Implementation protected void unregisterPhoneAccount(PhoneAccountHandle accountHandle)
@Deprecated @Implementation @HiddenApi public void clearAccounts()
@Implementation(minSdk=22) @HiddenApi public void clearAccountsForPackage(String packageName)
@Deprecated @Implementation @HiddenApi public ComponentName getDefaultPhoneApp()
@Implementation(minSdk=23) protected String getDefaultDialerPackage()
@Deprecated @Implementation(minSdk=23) @HiddenApi public boolean setDefaultDialer(String packageName)
public void setDefaultDialerPackage(String packageName)
getDefaultDialerPackage()
.@Implementation(minSdk=23) @HiddenApi protected String getSystemDialerPackage()
public void setSystemDialerPackage(String packageName)
getSystemDialerPackage()
.@Implementation(minSdk=22) protected boolean isVoiceMailNumber(PhoneAccountHandle accountHandle, String number)
@Implementation(minSdk=23) protected String getVoiceMailNumber(PhoneAccountHandle accountHandle)
@Implementation(minSdk=22) protected String getLine1Number(PhoneAccountHandle accountHandle)
public void setIsInCall(boolean isInCall)
TelecomManager.isInCall()
.@Implementation protected boolean isInCall()
TelecomManager.isInCall()
to return pre-set result.setIsInCall(boolean)
. If setIsInCall has not
previously been called, will return false.@Implementation @HiddenApi public int getCallState()
@Implementation @HiddenApi public boolean isRinging()
@Implementation @HiddenApi public boolean endCall()
@Implementation protected void acceptRingingCall()
@Implementation protected void silenceRinger()
@Implementation protected boolean isTtySupported()
@Implementation @HiddenApi public int getCurrentTtyMode()
@Implementation protected void addNewIncomingCall(PhoneAccountHandle phoneAccount, Bundle extras)
public List<ShadowTelecomManager.IncomingCallRecord> getAllIncomingCalls()
public ShadowTelecomManager.IncomingCallRecord getLastIncomingCall()
public ShadowTelecomManager.IncomingCallRecord getOnlyIncomingCall()
@Nullable public Connection allowIncomingCall(ShadowTelecomManager.IncomingCallRecord call)
ShadowTelecomManager.IncomingCallRecord
created via TelecomManager.addNewIncomingCall(android.telecom.PhoneAccountHandle, android.os.Bundle)
.
Specifically, this method sets up the relevant ConnectionService
and returns the
result of ConnectionService.onCreateIncomingConnection(android.telecom.PhoneAccountHandle, android.telecom.ConnectionRequest)
.
public void denyIncomingCall(ShadowTelecomManager.IncomingCallRecord call)
ShadowTelecomManager.IncomingCallRecord
created via TelecomManager.addNewIncomingCall(android.telecom.PhoneAccountHandle, android.os.Bundle)
.
Specifically, this method sets up the relevant ConnectionService
and calls ConnectionService.onCreateIncomingConnectionFailed(android.telecom.PhoneAccountHandle, android.telecom.ConnectionRequest)
.
@Implementation(minSdk=23) protected void placeCall(Uri address, Bundle extras)
public List<ShadowTelecomManager.OutgoingCallRecord> getAllOutgoingCalls()
public ShadowTelecomManager.OutgoingCallRecord getLastOutgoingCall()
public ShadowTelecomManager.OutgoingCallRecord getOnlyOutgoingCall()
@Nullable public Connection allowOutgoingCall(ShadowTelecomManager.OutgoingCallRecord call)
ShadowTelecomManager.OutgoingCallRecord
created via TelecomManager.placeCall(android.net.Uri, android.os.Bundle)
.
Specifically, this method sets up the relevant ConnectionService
and returns the
result of ConnectionService.onCreateOutgoingConnection(android.telecom.PhoneAccountHandle, android.telecom.ConnectionRequest)
.
public void denyOutgoingCall(ShadowTelecomManager.OutgoingCallRecord call)
ShadowTelecomManager.OutgoingCallRecord
created via TelecomManager.placeCall(android.net.Uri, android.os.Bundle)
.
Specifically, this method sets up the relevant ConnectionService
and calls ConnectionService.onCreateOutgoingConnectionFailed(android.telecom.PhoneAccountHandle, android.telecom.ConnectionRequest)
.
@Implementation @HiddenApi public void addNewUnknownCall(PhoneAccountHandle phoneAccount, Bundle extras)
public List<ShadowTelecomManager.UnknownCallRecord> getAllUnknownCalls()
public ShadowTelecomManager.UnknownCallRecord getLastUnknownCall()
public ShadowTelecomManager.UnknownCallRecord getOnlyUnknownCall()
@Implementation protected boolean handleMmi(String dialString)
@Implementation(minSdk=23) protected boolean handleMmi(String dialString, PhoneAccountHandle accountHandle)
@Implementation(minSdk=22) protected Uri getAdnUriForPhoneAccount(PhoneAccountHandle accountHandle)
@Implementation protected void cancelMissedCallsNotification()
@Implementation protected void showInCallScreen(boolean showDialpad)
@Implementation(minSdk=23) @HiddenApi public void enablePhoneAccount(PhoneAccountHandle handle, boolean isEnabled)
public void setSimCallManager(PhoneAccountHandle simCallManager)