diff options
Diffstat (limited to 'java/com/android/incallui/call/DialerCall.java')
-rw-r--r-- | java/com/android/incallui/call/DialerCall.java | 395 |
1 files changed, 197 insertions, 198 deletions
diff --git a/java/com/android/incallui/call/DialerCall.java b/java/com/android/incallui/call/DialerCall.java index 94c79e904..543cc3f07 100644 --- a/java/com/android/incallui/call/DialerCall.java +++ b/java/com/android/incallui/call/DialerCall.java @@ -102,14 +102,14 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa private static final String ID_PREFIX = "DialerCall_"; private static final String CONFIG_EMERGENCY_CALLBACK_WINDOW_MILLIS = "emergency_callback_window_millis"; - private static int sIdCounter = 0; + private static int idCounter = 0; /** * A counter used to append to restricted/private/hidden calls so that users can identify them in * a conversation. This value is reset in {@link CallList#onCallRemoved(Context, Call)} when there * are no live calls. */ - private static int sHiddenCounter; + private static int hiddenCounter; /** * The unique call ID for every call. This will help us to identify each call and allow us the @@ -117,34 +117,34 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa */ private final String uniqueCallId = UUID.randomUUID().toString(); - private final Call mTelecomCall; - private final LatencyReport mLatencyReport; - private final String mId; - private final int mHiddenId; - private final List<String> mChildCallIds = new ArrayList<>(); - private final LogState mLogState = new LogState(); - private final Context mContext; - private final DialerCallDelegate mDialerCallDelegate; - private final List<DialerCallListener> mListeners = new CopyOnWriteArrayList<>(); - private final List<CannedTextResponsesLoadedListener> mCannedTextResponsesLoadedListeners = + private final Call telecomCall; + private final LatencyReport latencyReport; + private final String id; + private final int hiddenId; + private final List<String> childCallIds = new ArrayList<>(); + private final LogState logState = new LogState(); + private final Context context; + private final DialerCallDelegate dialerCallDelegate; + private final List<DialerCallListener> listeners = new CopyOnWriteArrayList<>(); + private final List<CannedTextResponsesLoadedListener> cannedTextResponsesLoadedListeners = new CopyOnWriteArrayList<>(); - private final VideoTechManager mVideoTechManager; + private final VideoTechManager videoTechManager; - private boolean mIsEmergencyCall; - private Uri mHandle; - private int mState = State.INVALID; - private DisconnectCause mDisconnectCause; + private boolean isEmergencyCall; + private Uri handle; + private int state = State.INVALID; + private DisconnectCause disconnectCause; private boolean hasShownWiFiToLteHandoverToast; private boolean doNotShowDialogForHandoffToWifiFailure; - private String mChildNumber; - private String mLastForwardedNumber; - private String mCallSubject; - private PhoneAccountHandle mPhoneAccountHandle; - @CallHistoryStatus private int mCallHistoryStatus = CALL_HISTORY_STATUS_UNKNOWN; - private boolean mIsSpam; - private boolean mIsBlocked; + private String childNumber; + private String lastForwardedNumber; + private String callSubject; + private PhoneAccountHandle phoneAccountHandle; + @CallHistoryStatus private int callHistoryStatus = CALL_HISTORY_STATUS_UNKNOWN; + private boolean isSpam; + private boolean isBlocked; @Nullable private Boolean isInUserSpamList; @@ -154,9 +154,9 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa private boolean didShowCameraPermission; private String callProviderLabel; private String callbackNumber; - private int mCameraDirection = CameraDirection.CAMERA_DIRECTION_UNKNOWN; - private EnrichedCallCapabilities mEnrichedCallCapabilities; - private Session mEnrichedCallSession; + private int cameraDirection = CameraDirection.CAMERA_DIRECTION_UNKNOWN; + private EnrichedCallCapabilities enrichedCallCapabilities; + private Session enrichedCallSession; private int answerAndReleaseButtonDisplayedTimes = 0; private boolean releasedByAnsweringSecondCall = false; @@ -188,9 +188,9 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa * Indicates whether the phone account associated with this call supports specifying a call * subject. */ - private boolean mIsCallSubjectSupported; + private boolean isCallSubjectSupported; - private final Call.Callback mTelecomCallCallback = + private final Call.Callback telecomCallCallback = new Call.Callback() { @Override public void onStateChanged(Call call, int newState) { @@ -222,7 +222,7 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa LogUtil.v( "TelecomCallCallback.onCannedTextResponsesLoaded", "call=" + call + " cannedTextResponses=" + cannedTextResponses); - for (CannedTextResponsesLoadedListener listener : mCannedTextResponsesLoadedListeners) { + for (CannedTextResponsesLoadedListener listener : cannedTextResponsesLoadedListeners) { listener.onCannedTextResponsesLoaded(DialerCall.this); } } @@ -301,7 +301,7 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa } }; - private long mTimeAddedMs; + private long timeAddedMs; public DialerCall( Context context, @@ -310,27 +310,27 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa LatencyReport latencyReport, boolean registerCallback) { Assert.isNotNull(context); - mContext = context; - mDialerCallDelegate = dialerCallDelegate; - mTelecomCall = telecomCall; - mLatencyReport = latencyReport; - mId = ID_PREFIX + Integer.toString(sIdCounter++); + this.context = context; + this.dialerCallDelegate = dialerCallDelegate; + this.telecomCall = telecomCall; + this.latencyReport = latencyReport; + id = ID_PREFIX + Integer.toString(idCounter++); // Must be after assigning mTelecomCall - mVideoTechManager = new VideoTechManager(this); + videoTechManager = new VideoTechManager(this); updateFromTelecomCall(); if (isHiddenNumber() && TextUtils.isEmpty(getNumber())) { - mHiddenId = ++sHiddenCounter; + hiddenId = ++hiddenCounter; } else { - mHiddenId = 0; + hiddenId = 0; } if (registerCallback) { - mTelecomCall.registerCallback(mTelecomCallCallback); + this.telecomCall.registerCallback(telecomCallCallback); } - mTimeAddedMs = System.currentTimeMillis(); + timeAddedMs = System.currentTimeMillis(); parseCallSpecificAppData(); updateEnrichedCallSession(); @@ -339,13 +339,13 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa /** Test only constructor to avoid initializing dependencies. */ @VisibleForTesting DialerCall(Context context) { - mContext = context; - mTelecomCall = null; - mLatencyReport = null; - mId = null; - mHiddenId = 0; - mDialerCallDelegate = null; - mVideoTechManager = null; + this.context = context; + telecomCall = null; + latencyReport = null; + id = null; + hiddenId = 0; + dialerCallDelegate = null; + videoTechManager = null; } private static int translateState(int state) { @@ -398,68 +398,68 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa public void addListener(DialerCallListener listener) { Assert.isMainThread(); - mListeners.add(listener); + listeners.add(listener); } public void removeListener(DialerCallListener listener) { Assert.isMainThread(); - mListeners.remove(listener); + listeners.remove(listener); } public void addCannedTextResponsesLoadedListener(CannedTextResponsesLoadedListener listener) { Assert.isMainThread(); - mCannedTextResponsesLoadedListeners.add(listener); + cannedTextResponsesLoadedListeners.add(listener); } public void removeCannedTextResponsesLoadedListener(CannedTextResponsesLoadedListener listener) { Assert.isMainThread(); - mCannedTextResponsesLoadedListeners.remove(listener); + cannedTextResponsesLoadedListeners.remove(listener); } public void notifyWiFiToLteHandover() { LogUtil.i("DialerCall.notifyWiFiToLteHandover", ""); - for (DialerCallListener listener : mListeners) { + for (DialerCallListener listener : listeners) { listener.onWiFiToLteHandover(); } } public void notifyHandoverToWifiFailed() { LogUtil.i("DialerCall.notifyHandoverToWifiFailed", ""); - for (DialerCallListener listener : mListeners) { + for (DialerCallListener listener : listeners) { listener.onHandoverToWifiFailure(); } } public void notifyInternationalCallOnWifi() { LogUtil.enterBlock("DialerCall.notifyInternationalCallOnWifi"); - for (DialerCallListener dialerCallListener : mListeners) { + for (DialerCallListener dialerCallListener : listeners) { dialerCallListener.onInternationalCallOnWifi(); } } /* package-private */ Call getTelecomCall() { - return mTelecomCall; + return telecomCall; } public StatusHints getStatusHints() { - return mTelecomCall.getDetails().getStatusHints(); + return telecomCall.getDetails().getStatusHints(); } public int getCameraDir() { - return mCameraDirection; + return cameraDirection; } public void setCameraDir(int cameraDir) { if (cameraDir == CameraDirection.CAMERA_DIRECTION_FRONT_FACING || cameraDir == CameraDirection.CAMERA_DIRECTION_BACK_FACING) { - mCameraDirection = cameraDir; + cameraDirection = cameraDir; } else { - mCameraDirection = CameraDirection.CAMERA_DIRECTION_UNKNOWN; + cameraDirection = CameraDirection.CAMERA_DIRECTION_UNKNOWN; } } public boolean wasParentCall() { - return mLogState.conferencedCalls != 0; + return logState.conferencedCalls != 0; } public boolean isVoiceMailNumber() { @@ -479,11 +479,11 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa isVoicemailNumber = true; } - if (!PermissionsUtil.hasPermission(mContext, permission.READ_PHONE_STATE)) { + if (!PermissionsUtil.hasPermission(context, permission.READ_PHONE_STATE)) { isVoicemailNumber = false; } - isVoicemailNumber = TelecomUtil.isVoicemailNumber(mContext, getAccountHandle(), getNumber()); + isVoicemailNumber = TelecomUtil.isVoicemailNumber(context, getAccountHandle(), getNumber()); } private void update() { @@ -494,17 +494,17 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa // We want to potentially register a video call callback here. updateFromTelecomCall(); if (oldState != getState() && getState() == DialerCall.State.DISCONNECTED) { - for (DialerCallListener listener : mListeners) { + for (DialerCallListener listener : listeners) { listener.onDialerCallDisconnect(); } - EnrichedCallComponent.get(mContext) + EnrichedCallComponent.get(context) .getEnrichedCallManager() .unregisterCapabilitiesListener(this); - EnrichedCallComponent.get(mContext) + EnrichedCallComponent.get(context) .getEnrichedCallManager() .unregisterStateChangedListener(this); } else { - for (DialerCallListener listener : mListeners) { + for (DialerCallListener listener : listeners) { listener.onDialerCallUpdate(); } } @@ -514,58 +514,58 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa @SuppressWarnings("MissingPermission") private void updateFromTelecomCall() { Trace.beginSection("DialerCall.updateFromTelecomCall"); - LogUtil.v("DialerCall.updateFromTelecomCall", mTelecomCall.toString()); + LogUtil.v("DialerCall.updateFromTelecomCall", telecomCall.toString()); - mVideoTechManager.dispatchCallStateChanged(mTelecomCall.getState()); + videoTechManager.dispatchCallStateChanged(telecomCall.getState()); - final int translatedState = translateState(mTelecomCall.getState()); - if (mState != State.BLOCKED) { + final int translatedState = translateState(telecomCall.getState()); + if (state != State.BLOCKED) { setState(translatedState); - setDisconnectCause(mTelecomCall.getDetails().getDisconnectCause()); + setDisconnectCause(telecomCall.getDetails().getDisconnectCause()); } - mChildCallIds.clear(); - final int numChildCalls = mTelecomCall.getChildren().size(); + childCallIds.clear(); + final int numChildCalls = telecomCall.getChildren().size(); for (int i = 0; i < numChildCalls; i++) { - mChildCallIds.add( - mDialerCallDelegate - .getDialerCallFromTelecomCall(mTelecomCall.getChildren().get(i)) + childCallIds.add( + dialerCallDelegate + .getDialerCallFromTelecomCall(telecomCall.getChildren().get(i)) .getId()); } // The number of conferenced calls can change over the course of the call, so use the // maximum number of conferenced child calls as the metric for conference call usage. - mLogState.conferencedCalls = Math.max(numChildCalls, mLogState.conferencedCalls); + logState.conferencedCalls = Math.max(numChildCalls, logState.conferencedCalls); - updateFromCallExtras(mTelecomCall.getDetails().getExtras()); + updateFromCallExtras(telecomCall.getDetails().getExtras()); // If the handle of the call has changed, update state for the call determining if it is an // emergency call. - Uri newHandle = mTelecomCall.getDetails().getHandle(); - if (!Objects.equals(mHandle, newHandle)) { - mHandle = newHandle; + Uri newHandle = telecomCall.getDetails().getHandle(); + if (!Objects.equals(handle, newHandle)) { + handle = newHandle; updateEmergencyCallState(); } - TelecomManager telecomManager = mContext.getSystemService(TelecomManager.class); + TelecomManager telecomManager = context.getSystemService(TelecomManager.class); // If the phone account handle of the call is set, cache capability bit indicating whether // the phone account supports call subjects. - PhoneAccountHandle newPhoneAccountHandle = mTelecomCall.getDetails().getAccountHandle(); - if (!Objects.equals(mPhoneAccountHandle, newPhoneAccountHandle)) { - mPhoneAccountHandle = newPhoneAccountHandle; + PhoneAccountHandle newPhoneAccountHandle = telecomCall.getDetails().getAccountHandle(); + if (!Objects.equals(phoneAccountHandle, newPhoneAccountHandle)) { + phoneAccountHandle = newPhoneAccountHandle; - if (mPhoneAccountHandle != null) { - PhoneAccount phoneAccount = telecomManager.getPhoneAccount(mPhoneAccountHandle); + if (phoneAccountHandle != null) { + PhoneAccount phoneAccount = telecomManager.getPhoneAccount(phoneAccountHandle); if (phoneAccount != null) { - mIsCallSubjectSupported = + isCallSubjectSupported = phoneAccount.hasCapabilities(PhoneAccount.CAPABILITY_CALL_SUBJECT); } } } - if (PermissionsUtil.hasPermission(mContext, permission.READ_PHONE_STATE)) { + if (PermissionsUtil.hasPermission(context, permission.READ_PHONE_STATE)) { updateIsVoiceMailNumber(); callCapableAccounts = telecomManager.getCallCapablePhoneAccounts(); - countryIso = GeoUtil.getCurrentCountryIso(mContext); + countryIso = GeoUtil.getCurrentCountryIso(context); } Trace.endSection(); } @@ -605,9 +605,9 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa // Check for a change in the child address and notify any listeners. if (callExtras.containsKey(Connection.EXTRA_CHILD_ADDRESS)) { String childNumber = callExtras.getString(Connection.EXTRA_CHILD_ADDRESS); - if (!Objects.equals(childNumber, mChildNumber)) { - mChildNumber = childNumber; - for (DialerCallListener listener : mListeners) { + if (!Objects.equals(childNumber, this.childNumber)) { + this.childNumber = childNumber; + for (DialerCallListener listener : listeners) { listener.onDialerCallChildNumberChange(); } } @@ -626,9 +626,9 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa lastForwardedNumber = lastForwardedNumbers.get(lastForwardedNumbers.size() - 1); } - if (!Objects.equals(lastForwardedNumber, mLastForwardedNumber)) { - mLastForwardedNumber = lastForwardedNumber; - for (DialerCallListener listener : mListeners) { + if (!Objects.equals(lastForwardedNumber, this.lastForwardedNumber)) { + this.lastForwardedNumber = lastForwardedNumber; + for (DialerCallListener listener : listeners) { listener.onDialerCallLastForwardedNumberChange(); } } @@ -639,14 +639,14 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa // notify any other listeners of this. if (callExtras.containsKey(Connection.EXTRA_CALL_SUBJECT)) { String callSubject = callExtras.getString(Connection.EXTRA_CALL_SUBJECT); - if (!Objects.equals(mCallSubject, callSubject)) { - mCallSubject = callSubject; + if (!Objects.equals(this.callSubject, callSubject)) { + this.callSubject = callSubject; } } } public String getId() { - return mId; + return id; } /** @@ -655,14 +655,14 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa */ @Nullable public String updateNameIfRestricted(@Nullable String name) { - if (name != null && isHiddenNumber() && mHiddenId != 0 && sHiddenCounter > 1) { - return mContext.getString(R.string.unknown_counter, name, mHiddenId); + if (name != null && isHiddenNumber() && hiddenId != 0 && hiddenCounter > 1) { + return context.getString(R.string.unknown_counter, name, hiddenId); } return name; } public static void clearRestrictedCount() { - sHiddenCounter = 0; + hiddenCounter = 0; } private boolean isHiddenNumber() { @@ -687,26 +687,26 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa } public long getTimeAddedMs() { - return mTimeAddedMs; + return timeAddedMs; } @Nullable public String getNumber() { - return TelecomCallUtil.getNumber(mTelecomCall); + return TelecomCallUtil.getNumber(telecomCall); } public void blockCall() { - mTelecomCall.reject(false, null); + telecomCall.reject(false, null); setState(State.BLOCKED); } @Nullable public Uri getHandle() { - return mTelecomCall == null ? null : mTelecomCall.getDetails().getHandle(); + return telecomCall == null ? null : telecomCall.getDetails().getHandle(); } public boolean isEmergencyCall() { - return mIsEmergencyCall; + return isEmergencyCall; } public boolean isPotentialEmergencyCallback() { @@ -731,78 +731,78 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa boolean isInEmergencyCallbackWindow(long timestampMillis) { long emergencyCallbackWindowMillis = - ConfigProviderBindings.get(mContext) + ConfigProviderBindings.get(context) .getLong(CONFIG_EMERGENCY_CALLBACK_WINDOW_MILLIS, TimeUnit.MINUTES.toMillis(5)); return System.currentTimeMillis() - timestampMillis < emergencyCallbackWindowMillis; } public int getState() { - if (mTelecomCall != null && mTelecomCall.getParent() != null) { + if (telecomCall != null && telecomCall.getParent() != null) { return State.CONFERENCED; } else { - return mState; + return state; } } public int getNonConferenceState() { - return mState; + return state; } public void setState(int state) { if (state == State.INCOMING) { - mLogState.isIncoming = true; + logState.isIncoming = true; } else if (state == State.DISCONNECTED) { long newDuration = getConnectTimeMillis() == 0 ? 0 : System.currentTimeMillis() - getConnectTimeMillis(); - if (mState != state) { - mLogState.duration = newDuration; + if (this.state != state) { + logState.duration = newDuration; } else { LogUtil.i( "DialerCall.setState", "ignoring state transition from DISCONNECTED to DISCONNECTED." + " Duration would have changed from %s to %s", - mLogState.duration, + logState.duration, newDuration); } } - mState = state; + this.state = state; } public int getNumberPresentation() { - return mTelecomCall == null ? -1 : mTelecomCall.getDetails().getHandlePresentation(); + return telecomCall == null ? -1 : telecomCall.getDetails().getHandlePresentation(); } public int getCnapNamePresentation() { - return mTelecomCall == null ? -1 : mTelecomCall.getDetails().getCallerDisplayNamePresentation(); + return telecomCall == null ? -1 : telecomCall.getDetails().getCallerDisplayNamePresentation(); } @Nullable public String getCnapName() { - return mTelecomCall == null ? null : getTelecomCall().getDetails().getCallerDisplayName(); + return telecomCall == null ? null : getTelecomCall().getDetails().getCallerDisplayName(); } public Bundle getIntentExtras() { - return mTelecomCall.getDetails().getIntentExtras(); + return telecomCall.getDetails().getIntentExtras(); } @Nullable public Bundle getExtras() { - return mTelecomCall == null ? null : mTelecomCall.getDetails().getExtras(); + return telecomCall == null ? null : telecomCall.getDetails().getExtras(); } /** @return The child number for the call, or {@code null} if none specified. */ public String getChildNumber() { - return mChildNumber; + return childNumber; } /** @return The last forwarded number for the call, or {@code null} if none specified. */ public String getLastForwardedNumber() { - return mLastForwardedNumber; + return lastForwardedNumber; } /** @return The call subject, or {@code null} if none specified. */ public String getCallSubject() { - return mCallSubject; + return callSubject; } /** @@ -810,36 +810,36 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa * otherwise. */ public boolean isCallSubjectSupported() { - return mIsCallSubjectSupported; + return isCallSubjectSupported; } /** Returns call disconnect cause, defined by {@link DisconnectCause}. */ public DisconnectCause getDisconnectCause() { - if (mState == State.DISCONNECTED || mState == State.IDLE) { - return mDisconnectCause; + if (state == State.DISCONNECTED || state == State.IDLE) { + return disconnectCause; } return new DisconnectCause(DisconnectCause.UNKNOWN); } public void setDisconnectCause(DisconnectCause disconnectCause) { - mDisconnectCause = disconnectCause; - mLogState.disconnectCause = mDisconnectCause; + this.disconnectCause = disconnectCause; + logState.disconnectCause = this.disconnectCause; } /** Returns the possible text message responses. */ public List<String> getCannedSmsResponses() { - return mTelecomCall.getCannedTextResponses(); + return telecomCall.getCannedTextResponses(); } /** Checks if the call supports the given set of capabilities supplied as a bit mask. */ public boolean can(int capabilities) { - int supportedCapabilities = mTelecomCall.getDetails().getCallCapabilities(); + int supportedCapabilities = telecomCall.getDetails().getCallCapabilities(); if ((capabilities & Call.Details.CAPABILITY_MERGE_CONFERENCE) != 0) { // We allow you to merge if the capabilities allow it or if it is a call with // conferenceable calls. - if (mTelecomCall.getConferenceableCalls().isEmpty() + if (telecomCall.getConferenceableCalls().isEmpty() && ((Call.Details.CAPABILITY_MERGE_CONFERENCE & supportedCapabilities) == 0)) { // Cannot merge calls if there are no calls to merge with. return false; @@ -850,7 +850,7 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa } public boolean hasProperty(int property) { - return mTelecomCall.getDetails().hasProperty(property); + return telecomCall.getDetails().hasProperty(property); } @NonNull @@ -860,7 +860,7 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa /** Gets the time when the call first became active. */ public long getConnectTimeMillis() { - return mTelecomCall.getDetails().getConnectTimeMillis(); + return telecomCall.getDetails().getConnectTimeMillis(); } public boolean isConferenceCall() { @@ -869,33 +869,33 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa @Nullable public GatewayInfo getGatewayInfo() { - return mTelecomCall == null ? null : mTelecomCall.getDetails().getGatewayInfo(); + return telecomCall == null ? null : telecomCall.getDetails().getGatewayInfo(); } @Nullable public PhoneAccountHandle getAccountHandle() { - return mTelecomCall == null ? null : mTelecomCall.getDetails().getAccountHandle(); + return telecomCall == null ? null : telecomCall.getDetails().getAccountHandle(); } /** @return The {@link VideoCall} instance associated with the {@link Call}. */ public VideoCall getVideoCall() { - return mTelecomCall == null ? null : mTelecomCall.getVideoCall(); + return telecomCall == null ? null : telecomCall.getVideoCall(); } public List<String> getChildCallIds() { - return mChildCallIds; + return childCallIds; } public String getParentId() { - Call parentCall = mTelecomCall.getParent(); + Call parentCall = telecomCall.getParent(); if (parentCall != null) { - return mDialerCallDelegate.getDialerCallFromTelecomCall(parentCall).getId(); + return dialerCallDelegate.getDialerCallFromTelecomCall(parentCall).getId(); } return null; } public int getVideoState() { - return mTelecomCall.getDetails().getVideoState(); + return telecomCall.getDetails().getVideoState(); } public boolean isVideoCall() { @@ -915,11 +915,11 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa * repeated calls to isEmergencyNumber. */ private void updateEmergencyCallState() { - mIsEmergencyCall = TelecomCallUtil.isEmergencyCall(mTelecomCall); + isEmergencyCall = TelecomCallUtil.isEmergencyCall(telecomCall); } public LogState getLogState() { - return mLogState; + return logState; } /** @@ -957,17 +957,17 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa return; } - mLogState.callSpecificAppData = CallIntentParser.getCallSpecificAppData(getIntentExtras()); - if (mLogState.callSpecificAppData == null) { + logState.callSpecificAppData = CallIntentParser.getCallSpecificAppData(getIntentExtras()); + if (logState.callSpecificAppData == null) { - mLogState.callSpecificAppData = + logState.callSpecificAppData = CallSpecificAppData.newBuilder() .setCallInitiationType(CallInitiationType.Type.EXTERNAL_INITIATION) .build(); } if (getState() == State.INCOMING) { - mLogState.callSpecificAppData = - mLogState + logState.callSpecificAppData = + logState .callSpecificAppData .toBuilder() .setCallInitiationType(CallInitiationType.Type.INCOMING_INITIATION) @@ -977,24 +977,24 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa @Override public String toString() { - if (mTelecomCall == null) { + if (telecomCall == null) { // This should happen only in testing since otherwise we would never have a null // Telecom call. - return String.valueOf(mId); + return String.valueOf(id); } return String.format( Locale.US, "[%s, %s, %s, %s, children:%s, parent:%s, " + "conferenceable:%s, videoState:%s, mSessionModificationState:%d, CameraDir:%s]", - mId, + id, State.toString(getState()), - Details.capabilitiesToString(mTelecomCall.getDetails().getCallCapabilities()), - Details.propertiesToString(mTelecomCall.getDetails().getCallProperties()), - mChildCallIds, + Details.capabilitiesToString(telecomCall.getDetails().getCallCapabilities()), + Details.propertiesToString(telecomCall.getDetails().getCallProperties()), + childCallIds, getParentId(), - this.mTelecomCall.getConferenceableCalls(), - VideoProfile.videoStateToString(mTelecomCall.getDetails().getVideoState()), + this.telecomCall.getConferenceableCalls(), + VideoProfile.videoStateToString(telecomCall.getDetails().getVideoState()), getVideoTech().getSessionModificationState(), getCameraDir()); } @@ -1005,11 +1005,11 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa @CallHistoryStatus public int getCallHistoryStatus() { - return mCallHistoryStatus; + return callHistoryStatus; } public void setCallHistoryStatus(@CallHistoryStatus int callHistoryStatus) { - mCallHistoryStatus = callHistoryStatus; + this.callHistoryStatus = callHistoryStatus; } public boolean didShowCameraPermission() { @@ -1048,19 +1048,19 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa } public boolean isSpam() { - return mIsSpam; + return isSpam; } public void setSpam(boolean isSpam) { - mIsSpam = isSpam; + this.isSpam = isSpam; } public boolean isBlocked() { - return mIsBlocked; + return isBlocked; } public void setBlockedStatus(boolean isBlocked) { - mIsBlocked = isBlocked; + this.isBlocked = isBlocked; } public boolean isRemotelyHeld() { @@ -1072,7 +1072,7 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa } public boolean isIncoming() { - return mLogState.isIncoming; + return logState.isIncoming; } /** @@ -1122,7 +1122,7 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa } public LatencyReport getLatencyReport() { - return mLatencyReport; + return latencyReport; } public int getAnswerAndReleaseButtonDisplayedTimes() { @@ -1151,25 +1151,25 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa @Nullable public EnrichedCallCapabilities getEnrichedCallCapabilities() { - return mEnrichedCallCapabilities; + return enrichedCallCapabilities; } public void setEnrichedCallCapabilities( @Nullable EnrichedCallCapabilities mEnrichedCallCapabilities) { - this.mEnrichedCallCapabilities = mEnrichedCallCapabilities; + this.enrichedCallCapabilities = mEnrichedCallCapabilities; } @Nullable public Session getEnrichedCallSession() { - return mEnrichedCallSession; + return enrichedCallSession; } public void setEnrichedCallSession(@Nullable Session mEnrichedCallSession) { - this.mEnrichedCallSession = mEnrichedCallSession; + this.enrichedCallSession = mEnrichedCallSession; } public void unregisterCallback() { - mTelecomCall.unregisterCallback(mTelecomCallCallback); + telecomCall.unregisterCallback(telecomCallCallback); } public void phoneAccountSelected(PhoneAccountHandle accountHandle, boolean setDefault) { @@ -1178,45 +1178,45 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa "accountHandle: %s, setDefault: %b", accountHandle, setDefault); - mTelecomCall.phoneAccountSelected(accountHandle, setDefault); + telecomCall.phoneAccountSelected(accountHandle, setDefault); } public void disconnect() { LogUtil.i("DialerCall.disconnect", ""); setState(DialerCall.State.DISCONNECTING); - for (DialerCallListener listener : mListeners) { + for (DialerCallListener listener : listeners) { listener.onDialerCallUpdate(); } - mTelecomCall.disconnect(); + telecomCall.disconnect(); } public void hold() { LogUtil.i("DialerCall.hold", ""); - mTelecomCall.hold(); + telecomCall.hold(); } public void unhold() { LogUtil.i("DialerCall.unhold", ""); - mTelecomCall.unhold(); + telecomCall.unhold(); } public void splitFromConference() { LogUtil.i("DialerCall.splitFromConference", ""); - mTelecomCall.splitFromConference(); + telecomCall.splitFromConference(); } public void answer(int videoState) { LogUtil.i("DialerCall.answer", "videoState: " + videoState); - mTelecomCall.answer(videoState); + telecomCall.answer(videoState); } public void answer() { - answer(mTelecomCall.getDetails().getVideoState()); + answer(telecomCall.getDetails().getVideoState()); } public void reject(boolean rejectWithMessage, String message) { LogUtil.i("DialerCall.reject", ""); - mTelecomCall.reject(rejectWithMessage, message); + telecomCall.reject(rejectWithMessage, message); } /** Return the string label to represent the call provider */ @@ -1240,12 +1240,12 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa if (accountHandle == null) { return null; } - return mContext.getSystemService(TelecomManager.class).getPhoneAccount(accountHandle); + return context.getSystemService(TelecomManager.class).getPhoneAccount(accountHandle); } public VideoTech getVideoTech() { if (videoTech == null) { - videoTech = mVideoTechManager.getVideoTech(); + videoTech = videoTechManager.getVideoTech(); // Only store the first video tech type found to be available during the life of the call. if (selectedAvailableVideoTechType == com.android.dialer.logging.VideoTech.Type.NONE) { @@ -1266,7 +1266,7 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa if (isEmergencyCall() || showCallbackNumber) { callbackNumber = - mContext.getSystemService(TelecomManager.class).getLine1Number(getAccountHandle()); + context.getSystemService(TelecomManager.class).getLine1Number(getAccountHandle()); } if (callbackNumber == null) { @@ -1278,8 +1278,7 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa public String getSimCountryIso() { String simCountryIso = - TelephonyManagerCompat.getTelephonyManagerForPhoneAccountHandle( - mContext, getAccountHandle()) + TelephonyManagerCompat.getTelephonyManagerForPhoneAccountHandle(context, getAccountHandle()) .getSimCountryIso(); if (!TextUtils.isEmpty(simCountryIso)) { simCountryIso = simCountryIso.toUpperCase(Locale.US); @@ -1295,7 +1294,7 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa @Override public void onSessionModificationStateChanged() { Trace.beginSection("DialerCall.onSessionModificationStateChanged"); - for (DialerCallListener listener : mListeners) { + for (DialerCallListener listener : listeners) { listener.onDialerCallSessionModificationStateChange(); } Trace.endSection(); @@ -1315,13 +1314,13 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa public void onVideoUpgradeRequestReceived() { LogUtil.enterBlock("DialerCall.onVideoUpgradeRequestReceived"); - for (DialerCallListener listener : mListeners) { + for (DialerCallListener listener : listeners) { listener.onDialerCallUpgradeToVideo(); } update(); - Logger.get(mContext) + Logger.get(context) .logCallImpression( DialerImpression.Type.VIDEO_CALL_REQUEST_RECEIVED, getUniqueCallId(), getTimeAddedMs()); } @@ -1356,7 +1355,7 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa return; } EnrichedCallCapabilities capabilities = - EnrichedCallComponent.get(mContext).getEnrichedCallManager().getCapabilities(getNumber()); + EnrichedCallComponent.get(context).getEnrichedCallManager().getCapabilities(getNumber()); if (capabilities != null) { setEnrichedCallCapabilities(capabilities); update(); @@ -1370,10 +1369,10 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa @Override public void onImpressionLoggingNeeded(DialerImpression.Type impressionType) { - Logger.get(mContext).logCallImpression(impressionType, getUniqueCallId(), getTimeAddedMs()); + Logger.get(context).logCallImpression(impressionType, getUniqueCallId(), getTimeAddedMs()); if (impressionType == DialerImpression.Type.LIGHTBRINGER_UPGRADE_REQUESTED) { if (getLogState().contactLookupResult == Type.NOT_FOUND) { - Logger.get(mContext) + Logger.get(context) .logCallImpression( DialerImpression.Type.LIGHTBRINGER_NON_CONTACT_UPGRADE_REQUESTED, getUniqueCallId(), @@ -1394,7 +1393,7 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa return; } - EnrichedCallManager manager = EnrichedCallComponent.get(mContext).getEnrichedCallManager(); + EnrichedCallManager manager = EnrichedCallComponent.get(context).getEnrichedCallManager(); Filter filter = isIncoming() @@ -1419,14 +1418,14 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa } private void dispatchOnEnrichedCallSessionUpdate() { - for (DialerCallListener listener : mListeners) { + for (DialerCallListener listener : listeners) { listener.onEnrichedCallSessionUpdate(); } } void onRemovedFromCallList() { // Ensure we clean up when this call is removed. - mVideoTechManager.dispatchRemovedFromCallList(); + videoTechManager.dispatchRemovedFromCallList(); } public com.android.dialer.logging.VideoTech.Type getSelectedAvailableVideoTechType() { @@ -1630,7 +1629,7 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa private VideoTech savedTech; VideoTechManager(DialerCall call) { - this.context = call.mContext; + this.context = call.context; String phoneNumber = call.getNumber(); phoneNumber = phoneNumber != null ? phoneNumber : ""; @@ -1639,13 +1638,13 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa // Insert order here determines the priority of that video tech option videoTechs = new ArrayList<>(); - videoTechs.add(new ImsVideoTech(Logger.get(call.mContext), call, call.mTelecomCall)); + videoTechs.add(new ImsVideoTech(Logger.get(call.context), call, call.telecomCall)); VideoTech rcsVideoTech = - EnrichedCallComponent.get(call.mContext) + EnrichedCallComponent.get(call.context) .getRcsVideoShareFactory() .newRcsVideoShare( - EnrichedCallComponent.get(call.mContext).getEnrichedCallManager(), + EnrichedCallComponent.get(call.context).getEnrichedCallManager(), call, phoneNumber); if (rcsVideoTech != null) { @@ -1654,7 +1653,7 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa videoTechs.add( new DuoVideoTech( - DuoComponent.get(call.mContext).getDuo(), call, call.mTelecomCall, phoneNumber)); + DuoComponent.get(call.context).getDuo(), call, call.telecomCall, phoneNumber)); } VideoTech getVideoTech() { |