Home | History | Annotate | Download | only in contactgrid

Lines Matching refs:state

28 import com.android.incallui.call.DialerCall.State;
63 public static Info getInfo(Context context, PrimaryCallState state, PrimaryInfo primaryInfo) {
65 Drawable icon = state.connectionIcon();
68 if (state.isWifi() && icon == null) {
72 if (state.state() == State.INCOMING || state.state() == State.CALL_WAITING) {
76 if (!TextUtils.isEmpty(state.callSubject())) {
77 label = state.callSubject();
80 label = getLabelForIncoming(context, state);
87 } else if (VideoUtils.hasSentVideoUpgradeRequest(state.sessionModificationState())
88 || VideoUtils.hasReceivedVideoUpgradeRequest(state.sessionModificationState())) {
89 label = getLabelForVideoRequest(context, state);
90 } else if (state.state() == State.PULLING) {
92 } else if (state.state() == State.DIALING || state.state() == State.CONNECTING) {
95 label = getLabelForDialing(context, state);
96 } else if (state.state() == State.ACTIVE && state.isRemotelyHeld()) {
98 } else if (state.state() == State.ACTIVE
101 } else if (state.state() == State.CALL_PENDING && !TextUtils.isEmpty(state.customLabel())) {
102 label = state.customLabel();
106 label = getConnectionLabel(state);
135 private static CharSequence getLabelForIncoming(Context context, PrimaryCallState state) {
136 if (state.isVideoCall()) {
137 return getLabelForIncomingVideo(context, state.sessionModificationState(), state.isWifi());
138 } else if (state.isWifi() && !TextUtils.isEmpty(state.connectionLabel())) {
139 return state.connectionLabel();
140 } else if (isAccount(state)) {
142 R.string.contact_grid_incoming_via_template, state.connectionLabel());
143 } else if (state.isWorkCall()) {
167 private static CharSequence getLabelForDialing(Context context, PrimaryCallState state) {
168 if (!TextUtils.isEmpty(state.connectionLabel()) && !state.isWifi()) {
169 return context.getString(R.string.incall_calling_via_template, state.connectionLabel());
171 if (state.isVideoCall()) {
172 if (state.isWifi()) {
179 if (state.isAssistedDialed() && state.assistedDialingExtras() != null) {
182 String.valueOf(state.assistedDialingExtras().transformedNumberCountryCallingCode());
186 state.assistedDialingExtras().userHomeCountryCode());
192 private static CharSequence getConnectionLabel(PrimaryCallState state) {
193 if (!TextUtils.isEmpty(state.connectionLabel())
194 && (isAccount(state) || state.isWifi() || state.isConference())) {
195 // We normally don't show a "call state label" at all when active
196 // (but we can use the call state label to display the provider name).
197 return state.connectionLabel();
203 private static CharSequence getLabelForVideoRequest(Context context, PrimaryCallState state) {
204 switch (state.sessionModificationState()) {
215 return getLabelForIncomingVideo(context, state.sessionModificationState(), state.isWifi());
223 private static boolean isAccount(PrimaryCallState state) {
224 return !TextUtils.isEmpty(state.connectionLabel()) && TextUtils.isEmpty(state.gatewayNumber());