Loading InCallUI/res/values/strings.xml +4 −0 Original line number Diff line number Diff line Loading @@ -460,4 +460,8 @@ <!-- Used to inform the user that a call was received via a number other than the primary phone number associated with their device. [CHAR LIMIT=16] --> <string name="child_number">via <xliff:g id="child_number" example="650-555-1212">%s</xliff:g></string> <!-- Used to inform the user that the note associated with an outgoing call has been sent. [CHAR LIMIT=32] --> <string name="note_sent">Note sent</string> </resources> InCallUI/src/com/android/incallui/CallCardFragment.java +6 −0 Original line number Diff line number Diff line Loading @@ -47,6 +47,7 @@ import android.view.animation.AnimationUtils; import android.widget.ImageButton; import android.widget.ImageView; import android.widget.TextView; import android.widget.Toast; import com.android.contacts.common.util.MaterialColorMapUtils.MaterialPalette; import com.android.contacts.common.widget.FloatingActionButtonController; Loading Loading @@ -1088,6 +1089,11 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr }); } @Override public void showNoteSentToast() { Toast.makeText(getContext(), R.string.note_sent, Toast.LENGTH_LONG).show(); } public void onDialpadVisibilityChange(boolean isShown) { mIsDialpadShowing = isShown; updateFabPosition(); Loading InCallUI/src/com/android/incallui/CallCardPresenter.java +26 −0 Original line number Diff line number Diff line Loading @@ -76,6 +76,7 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> private CallTimer mCallTimer; private Context mContext; private boolean mSpinnerShowing = false; private boolean mHasShownToast = false; public static class ContactLookupCallback implements ContactInfoCacheCallback { private final WeakReference<CallCardPresenter> mCallCardPresenter; Loading Loading @@ -120,6 +121,12 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> // Call may be null if disconnect happened already. if (call != null) { mPrimary = call; if (shouldShowNoteSentToast(mPrimary)) { final CallCardUi ui = getUi(); if (ui != null) { ui.showNoteSentToast(); } } CallList.getInstance().addCallUpdateListener(call.getId(), this); // start processing lookups right away. Loading Loading @@ -213,6 +220,10 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> Call previousPrimary = mPrimary; mPrimary = primary; if (primaryChanged && shouldShowNoteSentToast(primary)) { ui.showNoteSentToast(); } // Refresh primary call information if either: // 1. Primary call changed. // 2. The call's ability to manage conference has changed. Loading Loading @@ -915,6 +926,20 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> return isIncomingOrWaiting && !TextUtils.isEmpty(call.getCallSubject()); } /** * Determines whether the "note sent" toast should be shown. It should be shown for a new * outgoing call with a subject. * * @param call The call * @return {@code true} if the toast should be shown, {@code false} otherwise. */ private boolean shouldShowNoteSentToast(Call call) { return call != null && !TextUtils .isEmpty(call.getTelecommCall().getDetails().getIntentExtras().getString( TelecomManager.EXTRA_CALL_SUBJECT)) && (call.getState() == Call.State.DIALING || call.getState() == Call.State.CONNECTING); } public interface CallCardUi extends Ui { void setVisible(boolean on); void setCallCardVisible(boolean visible); Loading Loading @@ -942,5 +967,6 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> boolean isCallSubjectVisible(); void animateForNewOutgoingCall(); void sendAccessibilityAnnouncement(); void showNoteSentToast(); } } InCallUI/src/com/android/incallui/CallList.java +3 −1 Original line number Diff line number Diff line Loading @@ -161,7 +161,9 @@ public class CallList { } /** * Called when a single call has changed session modification state. * Called when the last forwarded number changes for a call. With IMS, the last forwarded * number changes due to a supplemental service notification, so it is not pressent at the * start of the call. * * @param call The call. */ Loading Loading
InCallUI/res/values/strings.xml +4 −0 Original line number Diff line number Diff line Loading @@ -460,4 +460,8 @@ <!-- Used to inform the user that a call was received via a number other than the primary phone number associated with their device. [CHAR LIMIT=16] --> <string name="child_number">via <xliff:g id="child_number" example="650-555-1212">%s</xliff:g></string> <!-- Used to inform the user that the note associated with an outgoing call has been sent. [CHAR LIMIT=32] --> <string name="note_sent">Note sent</string> </resources>
InCallUI/src/com/android/incallui/CallCardFragment.java +6 −0 Original line number Diff line number Diff line Loading @@ -47,6 +47,7 @@ import android.view.animation.AnimationUtils; import android.widget.ImageButton; import android.widget.ImageView; import android.widget.TextView; import android.widget.Toast; import com.android.contacts.common.util.MaterialColorMapUtils.MaterialPalette; import com.android.contacts.common.widget.FloatingActionButtonController; Loading Loading @@ -1088,6 +1089,11 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr }); } @Override public void showNoteSentToast() { Toast.makeText(getContext(), R.string.note_sent, Toast.LENGTH_LONG).show(); } public void onDialpadVisibilityChange(boolean isShown) { mIsDialpadShowing = isShown; updateFabPosition(); Loading
InCallUI/src/com/android/incallui/CallCardPresenter.java +26 −0 Original line number Diff line number Diff line Loading @@ -76,6 +76,7 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> private CallTimer mCallTimer; private Context mContext; private boolean mSpinnerShowing = false; private boolean mHasShownToast = false; public static class ContactLookupCallback implements ContactInfoCacheCallback { private final WeakReference<CallCardPresenter> mCallCardPresenter; Loading Loading @@ -120,6 +121,12 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> // Call may be null if disconnect happened already. if (call != null) { mPrimary = call; if (shouldShowNoteSentToast(mPrimary)) { final CallCardUi ui = getUi(); if (ui != null) { ui.showNoteSentToast(); } } CallList.getInstance().addCallUpdateListener(call.getId(), this); // start processing lookups right away. Loading Loading @@ -213,6 +220,10 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> Call previousPrimary = mPrimary; mPrimary = primary; if (primaryChanged && shouldShowNoteSentToast(primary)) { ui.showNoteSentToast(); } // Refresh primary call information if either: // 1. Primary call changed. // 2. The call's ability to manage conference has changed. Loading Loading @@ -915,6 +926,20 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> return isIncomingOrWaiting && !TextUtils.isEmpty(call.getCallSubject()); } /** * Determines whether the "note sent" toast should be shown. It should be shown for a new * outgoing call with a subject. * * @param call The call * @return {@code true} if the toast should be shown, {@code false} otherwise. */ private boolean shouldShowNoteSentToast(Call call) { return call != null && !TextUtils .isEmpty(call.getTelecommCall().getDetails().getIntentExtras().getString( TelecomManager.EXTRA_CALL_SUBJECT)) && (call.getState() == Call.State.DIALING || call.getState() == Call.State.CONNECTING); } public interface CallCardUi extends Ui { void setVisible(boolean on); void setCallCardVisible(boolean visible); Loading Loading @@ -942,5 +967,6 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> boolean isCallSubjectVisible(); void animateForNewOutgoingCall(); void sendAccessibilityAnnouncement(); void showNoteSentToast(); } }
InCallUI/src/com/android/incallui/CallList.java +3 −1 Original line number Diff line number Diff line Loading @@ -161,7 +161,9 @@ public class CallList { } /** * Called when a single call has changed session modification state. * Called when the last forwarded number changes for a call. With IMS, the last forwarded * number changes due to a supplemental service notification, so it is not pressent at the * start of the call. * * @param call The call. */ Loading