summaryrefslogtreecommitdiff
path: root/java/com/android/incallui/incall/protocol
diff options
context:
space:
mode:
authorEric Erfanian <erfanian@google.com>2017-08-31 06:57:16 -0700
committerEric Erfanian <erfanian@google.com>2017-08-31 16:13:53 +0000
commit2ca4318cc1ee57dda907ba2069bd61d162b1baef (patch)
treee282668a9587cf6c1ec7b604dea860400c75c6c7 /java/com/android/incallui/incall/protocol
parent68038172793ee0e2ab3e2e56ddfbeb82879d1f58 (diff)
Update Dialer source to latest internal Google revision.
Previously, Android's Dialer app was developed in an internal Google source control system and only exported to public during AOSP drops. The Dialer team is now switching to a public development model similar to the telephony team. This CL represents all internal Google changes that were committed to Dialer between the public O release and today's tip of tree on internal master. This CL squashes those changes into a single commit. In subsequent changes, changes will be exported on a per-commit basis. Test: make, flash install, run Merged-In: I45270eaa8ce732d71a1bd84b08c7fa0e99af3160 Change-Id: I529aaeb88535b9533c0ae4ef4e6c1222d4e0f1c8 PiperOrigin-RevId: 167068436
Diffstat (limited to 'java/com/android/incallui/incall/protocol')
-rw-r--r--java/com/android/incallui/incall/protocol/InCallScreenDelegate.java4
-rw-r--r--java/com/android/incallui/incall/protocol/PrimaryCallState.java50
-rw-r--r--java/com/android/incallui/incall/protocol/PrimaryInfo.java9
3 files changed, 54 insertions, 9 deletions
diff --git a/java/com/android/incallui/incall/protocol/InCallScreenDelegate.java b/java/com/android/incallui/incall/protocol/InCallScreenDelegate.java
index 98c3e0f31..c491eab78 100644
--- a/java/com/android/incallui/incall/protocol/InCallScreenDelegate.java
+++ b/java/com/android/incallui/incall/protocol/InCallScreenDelegate.java
@@ -16,8 +16,6 @@
package com.android.incallui.incall.protocol;
-import android.graphics.drawable.Drawable;
-
/** Callbacks from the module out to the container. */
public interface InCallScreenDelegate {
@@ -40,6 +38,4 @@ public interface InCallScreenDelegate {
void onInCallScreenResumed();
void onInCallScreenPaused();
-
- Drawable getDefaultContactPhotoDrawable();
}
diff --git a/java/com/android/incallui/incall/protocol/PrimaryCallState.java b/java/com/android/incallui/incall/protocol/PrimaryCallState.java
index 2ae6a18e5..fe80276c9 100644
--- a/java/com/android/incallui/incall/protocol/PrimaryCallState.java
+++ b/java/com/android/incallui/incall/protocol/PrimaryCallState.java
@@ -17,13 +17,33 @@
package com.android.incallui.incall.protocol;
import android.graphics.drawable.Drawable;
+import android.support.annotation.IntDef;
+import android.support.annotation.Nullable;
import android.telecom.DisconnectCause;
+import android.text.TextUtils;
+import com.android.dialer.common.Assert;
import com.android.incallui.call.DialerCall;
+import com.android.incallui.call.DialerCall.State;
import com.android.incallui.videotech.utils.SessionModificationState;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
import java.util.Locale;
/** State of the primary call. */
public class PrimaryCallState {
+
+ /**
+ * Button state that will be invisible if not supported, visible but invalid if disabled, or
+ * visible if enabled.
+ */
+ @Retention(RetentionPolicy.SOURCE)
+ @IntDef({ButtonState.NOT_SUPPORT, ButtonState.DISABLED, ButtonState.ENABLED})
+ public @interface ButtonState {
+ int NOT_SUPPORT = 0;
+ int DISABLED = 1;
+ int ENABLED = 2;
+ }
+
public final int state;
public final boolean isVideoCall;
@SessionModificationState public final int sessionModificationState;
@@ -44,11 +64,20 @@ public class PrimaryCallState {
public final boolean isVoiceMailNumber;
public final boolean isRemotelyHeld;
public final boolean isBusinessNumber;
+ public final boolean supportsCallOnHold;
+ public final @ButtonState int swapToSecondaryButtonState;
+ public final boolean isAssistedDialed;
+ @Nullable public final String customLabel;
// TODO: Convert to autovalue. b/34502119
public static PrimaryCallState createEmptyPrimaryCallState() {
+ return createEmptyPrimaryCallStateWithState(DialerCall.State.IDLE, null);
+ }
+
+ public static PrimaryCallState createEmptyPrimaryCallStateWithState(
+ int state, String customLabel) {
return new PrimaryCallState(
- DialerCall.State.IDLE,
+ state,
false, /* isVideoCall */
SessionModificationState.NO_REQUEST,
new DisconnectCause(DisconnectCause.UNKNOWN),
@@ -67,7 +96,11 @@ public class PrimaryCallState {
0,
false /* isVoiceMailNumber */,
false /* isRemotelyHeld */,
- false /* isBusinessNumber */);
+ false /* isBusinessNumber */,
+ true /* supportsCallOnHold */,
+ ButtonState.NOT_SUPPORT /* swapToSecondaryButtonState */,
+ false /* isAssistedDialed */,
+ customLabel);
}
public PrimaryCallState(
@@ -90,7 +123,11 @@ public class PrimaryCallState {
long connectTimeMillis,
boolean isVoiceMailNumber,
boolean isRemotelyHeld,
- boolean isBusinessNumber) {
+ boolean isBusinessNumber,
+ boolean supportsCallOnHold,
+ @ButtonState int swapToSecondaryButtonState,
+ boolean isAssistedDialed,
+ @Nullable String customLabel) {
this.state = state;
this.isVideoCall = isVideoCall;
this.sessionModificationState = sessionModificationState;
@@ -111,6 +148,13 @@ public class PrimaryCallState {
this.isVoiceMailNumber = isVoiceMailNumber;
this.isRemotelyHeld = isRemotelyHeld;
this.isBusinessNumber = isBusinessNumber;
+ this.supportsCallOnHold = supportsCallOnHold;
+ this.swapToSecondaryButtonState = swapToSecondaryButtonState;
+ this.isAssistedDialed = isAssistedDialed;
+ if (!TextUtils.isEmpty(customLabel)) {
+ Assert.checkArgument(state == State.CALL_PENDING);
+ }
+ this.customLabel = customLabel;
}
@Override
diff --git a/java/com/android/incallui/incall/protocol/PrimaryInfo.java b/java/com/android/incallui/incall/protocol/PrimaryInfo.java
index c1709501d..7fe0a0f6a 100644
--- a/java/com/android/incallui/incall/protocol/PrimaryInfo.java
+++ b/java/com/android/incallui/incall/protocol/PrimaryInfo.java
@@ -41,6 +41,7 @@ public class PrimaryInfo {
// Used for consistent LetterTile coloring.
@Nullable public final String contactInfoLookupKey;
@Nullable public final MultimediaData multimediaData;
+ public final boolean showInCallButtonGrid;
public final int numberPresentation;
// TODO: Convert to autovalue. b/34502119
@@ -61,6 +62,7 @@ public class PrimaryInfo {
false,
null,
null,
+ true,
-1);
}
@@ -80,6 +82,7 @@ public class PrimaryInfo {
boolean shouldShowLocation,
@Nullable String contactInfoLookupKey,
@Nullable MultimediaData multimediaData,
+ boolean showInCallButtonGrid,
int numberPresentation) {
this.number = number;
this.name = name;
@@ -96,6 +99,7 @@ public class PrimaryInfo {
this.shouldShowLocation = shouldShowLocation;
this.contactInfoLookupKey = contactInfoLookupKey;
this.multimediaData = multimediaData;
+ this.showInCallButtonGrid = showInCallButtonGrid;
this.numberPresentation = numberPresentation;
}
@@ -104,13 +108,14 @@ public class PrimaryInfo {
return String.format(
Locale.US,
"PrimaryInfo, number: %s, name: %s, location: %s, label: %s, "
- + "photo: %s, photoType: %d, isPhotoVisible: %b",
+ + "photo: %s, photoType: %d, isPhotoVisible: %b, MultimediaData: %s",
LogUtil.sanitizePhoneNumber(number),
LogUtil.sanitizePii(name),
LogUtil.sanitizePii(location),
label,
photo,
photoType,
- isContactPhotoShown);
+ isContactPhotoShown,
+ multimediaData);
}
}