show verified shield in rtp session activity
This commit is contained in:
parent
e4b2bb4a42
commit
3ee70b1d48
|
@ -389,6 +389,7 @@ public class RtpSessionActivity extends XmppActivity implements XmppConnectionSe
|
||||||
if (state != null) {
|
if (state != null) {
|
||||||
Log.d(Config.LOGTAG, "restored last state from intent extra");
|
Log.d(Config.LOGTAG, "restored last state from intent extra");
|
||||||
updateButtonConfiguration(state);
|
updateButtonConfiguration(state);
|
||||||
|
updateVerifiedShield(false);
|
||||||
updateStateDisplay(state);
|
updateStateDisplay(state);
|
||||||
updateProfilePicture(state);
|
updateProfilePicture(state);
|
||||||
invalidateOptionsMenu();
|
invalidateOptionsMenu();
|
||||||
|
@ -558,6 +559,7 @@ public class RtpSessionActivity extends XmppActivity implements XmppConnectionSe
|
||||||
}
|
}
|
||||||
this.rtpConnectionReference = reference;
|
this.rtpConnectionReference = reference;
|
||||||
final RtpEndUserState currentState = requireRtpConnection().getEndUserState();
|
final RtpEndUserState currentState = requireRtpConnection().getEndUserState();
|
||||||
|
final boolean verified = requireRtpConnection().isVerified();
|
||||||
if (currentState == RtpEndUserState.ENDED) {
|
if (currentState == RtpEndUserState.ENDED) {
|
||||||
reference.get().throwStateTransitionException();
|
reference.get().throwStateTransitionException();
|
||||||
finish();
|
finish();
|
||||||
|
@ -573,6 +575,7 @@ public class RtpSessionActivity extends XmppActivity implements XmppConnectionSe
|
||||||
binding.with.setText(getWith().getDisplayName());
|
binding.with.setText(getWith().getDisplayName());
|
||||||
updateVideoViews(currentState);
|
updateVideoViews(currentState);
|
||||||
updateStateDisplay(currentState, media);
|
updateStateDisplay(currentState, media);
|
||||||
|
updateVerifiedShield(verified && STATES_SHOWING_SWITCH_TO_CHAT.contains(currentState));
|
||||||
updateButtonConfiguration(currentState, media);
|
updateButtonConfiguration(currentState, media);
|
||||||
updateProfilePicture(currentState);
|
updateProfilePicture(currentState);
|
||||||
invalidateOptionsMenu();
|
invalidateOptionsMenu();
|
||||||
|
@ -591,6 +594,7 @@ public class RtpSessionActivity extends XmppActivity implements XmppConnectionSe
|
||||||
updateStateDisplay(state);
|
updateStateDisplay(state);
|
||||||
updateProfilePicture(state);
|
updateProfilePicture(state);
|
||||||
updateCallDuration();
|
updateCallDuration();
|
||||||
|
updateVerifiedShield(false);
|
||||||
invalidateOptionsMenu();
|
invalidateOptionsMenu();
|
||||||
binding.with.setText(account.getRoster().getContact(with).getDisplayName());
|
binding.with.setText(account.getRoster().getContact(with).getDisplayName());
|
||||||
}
|
}
|
||||||
|
@ -672,6 +676,14 @@ public class RtpSessionActivity extends XmppActivity implements XmppConnectionSe
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void updateVerifiedShield(final boolean verified) {
|
||||||
|
if (isPictureInPicture()) {
|
||||||
|
this.binding.verified.setVisibility(View.GONE);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.binding.verified.setVisibility(verified ? View.VISIBLE : View.GONE);
|
||||||
|
}
|
||||||
|
|
||||||
private void updateProfilePicture(final RtpEndUserState state) {
|
private void updateProfilePicture(final RtpEndUserState state) {
|
||||||
updateProfilePicture(state, null);
|
updateProfilePicture(state, null);
|
||||||
}
|
}
|
||||||
|
@ -1075,6 +1087,7 @@ public class RtpSessionActivity extends XmppActivity implements XmppConnectionSe
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final AbstractJingleConnection.Id id = requireRtpConnection().getId();
|
final AbstractJingleConnection.Id id = requireRtpConnection().getId();
|
||||||
|
final boolean verified = requireRtpConnection().isVerified();
|
||||||
final Set<Media> media = getMedia();
|
final Set<Media> media = getMedia();
|
||||||
final Contact contact = getWith();
|
final Contact contact = getWith();
|
||||||
if (account == id.account && id.with.equals(with) && id.sessionId.equals(sessionId)) {
|
if (account == id.account && id.with.equals(with) && id.sessionId.equals(sessionId)) {
|
||||||
|
@ -1084,6 +1097,7 @@ public class RtpSessionActivity extends XmppActivity implements XmppConnectionSe
|
||||||
}
|
}
|
||||||
runOnUiThread(() -> {
|
runOnUiThread(() -> {
|
||||||
updateStateDisplay(state, media);
|
updateStateDisplay(state, media);
|
||||||
|
updateVerifiedShield(verified && STATES_SHOWING_SWITCH_TO_CHAT.contains(state));
|
||||||
updateButtonConfiguration(state, media);
|
updateButtonConfiguration(state, media);
|
||||||
updateVideoViews(state);
|
updateVideoViews(state);
|
||||||
updateProfilePicture(state, contact);
|
updateProfilePicture(state, contact);
|
||||||
|
@ -1133,6 +1147,7 @@ public class RtpSessionActivity extends XmppActivity implements XmppConnectionSe
|
||||||
}
|
}
|
||||||
if (Jid.ofEscaped(withExtra).asBareJid().equals(with)) {
|
if (Jid.ofEscaped(withExtra).asBareJid().equals(with)) {
|
||||||
runOnUiThread(() -> {
|
runOnUiThread(() -> {
|
||||||
|
updateVerifiedShield(false);
|
||||||
updateStateDisplay(state);
|
updateStateDisplay(state);
|
||||||
updateButtonConfiguration(state);
|
updateButtonConfiguration(state);
|
||||||
updateProfilePicture(state);
|
updateProfilePicture(state);
|
||||||
|
|
|
@ -32,6 +32,7 @@ import java.util.concurrent.TimeUnit;
|
||||||
import eu.siacs.conversations.Config;
|
import eu.siacs.conversations.Config;
|
||||||
import eu.siacs.conversations.crypto.axolotl.AxolotlService;
|
import eu.siacs.conversations.crypto.axolotl.AxolotlService;
|
||||||
import eu.siacs.conversations.crypto.axolotl.CryptoFailedException;
|
import eu.siacs.conversations.crypto.axolotl.CryptoFailedException;
|
||||||
|
import eu.siacs.conversations.crypto.axolotl.FingerprintStatus;
|
||||||
import eu.siacs.conversations.entities.Account;
|
import eu.siacs.conversations.entities.Account;
|
||||||
import eu.siacs.conversations.entities.Conversation;
|
import eu.siacs.conversations.entities.Conversation;
|
||||||
import eu.siacs.conversations.entities.Conversational;
|
import eu.siacs.conversations.entities.Conversational;
|
||||||
|
@ -967,6 +968,15 @@ public class JingleRtpConnection extends AbstractJingleConnection implements Web
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public boolean isVerified() {
|
||||||
|
final String fingerprint = this.omemoVerification.getFingerprint();
|
||||||
|
if (fingerprint == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
final FingerprintStatus status = id.account.getAxolotlService().getFingerprintTrust(fingerprint);
|
||||||
|
return status != null && status.getTrust() == FingerprintStatus.Trust.VERIFIED;
|
||||||
|
}
|
||||||
|
|
||||||
public synchronized void acceptCall() {
|
public synchronized void acceptCall() {
|
||||||
switch (this.state) {
|
switch (this.state) {
|
||||||
case PROPOSED:
|
case PROPOSED:
|
||||||
|
|
|
@ -86,17 +86,14 @@
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
|
|
||||||
<org.webrtc.SurfaceViewRenderer
|
<org.webrtc.SurfaceViewRenderer
|
||||||
android:id="@+id/local_video"
|
android:id="@+id/local_video"
|
||||||
android:layout_width="@dimen/local_video_preview_width"
|
android:layout_width="@dimen/local_video_preview_width"
|
||||||
android:layout_height="@dimen/local_video_preview_height"
|
android:layout_height="@dimen/local_video_preview_height"
|
||||||
android:layout_below="@+id/app_bar_layout"
|
android:layout_below="@+id/app_bar_layout"
|
||||||
android:layout_alignParentEnd="true"
|
android:layout_alignParentEnd="true"
|
||||||
android:layout_alignParentRight="true"
|
|
||||||
android:layout_marginTop="24dp"
|
android:layout_marginTop="24dp"
|
||||||
android:layout_marginEnd="24dp"
|
android:layout_marginEnd="24dp"
|
||||||
android:layout_marginRight="24dp"
|
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
app:elevation="4dp" />
|
app:elevation="4dp" />
|
||||||
|
|
||||||
|
@ -106,22 +103,31 @@
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_below="@+id/app_bar_layout"
|
android:layout_below="@+id/app_bar_layout"
|
||||||
android:layout_alignParentStart="true"
|
android:layout_alignParentStart="true"
|
||||||
android:layout_alignParentLeft="true"
|
|
||||||
android:layout_alignParentBottom="true"
|
android:layout_alignParentBottom="true"
|
||||||
android:visibility="gone" />
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/verified"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@+id/app_bar_layout"
|
||||||
|
android:layout_alignParentStart="true"
|
||||||
|
android:layout_marginTop="24dp"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:alpha="0.7"
|
||||||
|
android:src="@drawable/ic_verified_fingerprint" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/pip_local_mic_off_indicator"
|
android:id="@+id/pip_local_mic_off_indicator"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignParentEnd="true"
|
android:layout_alignParentEnd="true"
|
||||||
android:layout_alignParentRight="true"
|
|
||||||
android:layout_alignParentBottom="true"
|
android:layout_alignParentBottom="true"
|
||||||
android:layout_margin="8dp"
|
android:layout_margin="8dp"
|
||||||
android:alpha="0.7"
|
android:alpha="0.7"
|
||||||
android:src="@drawable/ic_mic_off_black_24dp"
|
android:src="@drawable/ic_mic_off_black_24dp"
|
||||||
android:tint="@color/white"
|
android:visibility="gone"
|
||||||
android:visibility="gone" />
|
app:tint="@color/white" />
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:id="@+id/button_row"
|
android:id="@+id/button_row"
|
||||||
|
@ -141,7 +147,6 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignParentStart="true"
|
android:layout_alignParentStart="true"
|
||||||
android:layout_alignParentLeft="true"
|
|
||||||
android:layout_margin="16dp"
|
android:layout_margin="16dp"
|
||||||
android:src="@drawable/ic_call_end_white_48dp"
|
android:src="@drawable/ic_call_end_white_48dp"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
|
@ -156,7 +161,6 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignParentEnd="true"
|
android:layout_alignParentEnd="true"
|
||||||
android:layout_alignParentRight="true"
|
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
android:layout_margin="16dp"
|
android:layout_margin="16dp"
|
||||||
android:src="@drawable/ic_call_white_48dp"
|
android:src="@drawable/ic_call_white_48dp"
|
||||||
|
@ -176,7 +180,6 @@
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
android:layout_margin="@dimen/in_call_fab_margin"
|
android:layout_margin="@dimen/in_call_fab_margin"
|
||||||
android:layout_toStartOf="@+id/end_call"
|
android:layout_toStartOf="@+id/end_call"
|
||||||
android:layout_toLeftOf="@+id/end_call"
|
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
app:backgroundTint="?color_background_primary"
|
app:backgroundTint="?color_background_primary"
|
||||||
app:elevation="4dp"
|
app:elevation="4dp"
|
||||||
|
@ -203,7 +206,6 @@
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
android:layout_margin="@dimen/in_call_fab_margin"
|
android:layout_margin="@dimen/in_call_fab_margin"
|
||||||
android:layout_toEndOf="@+id/end_call"
|
android:layout_toEndOf="@+id/end_call"
|
||||||
android:layout_toRightOf="@+id/end_call"
|
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
app:backgroundTint="?color_background_primary"
|
app:backgroundTint="?color_background_primary"
|
||||||
app:elevation="4dp"
|
app:elevation="4dp"
|
||||||
|
@ -217,7 +219,6 @@
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
android:layout_margin="@dimen/in_call_fab_margin"
|
android:layout_margin="@dimen/in_call_fab_margin"
|
||||||
android:layout_toEndOf="@+id/in_call_action_right"
|
android:layout_toEndOf="@+id/in_call_action_right"
|
||||||
android:layout_toRightOf="@+id/in_call_action_right"
|
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
app:backgroundTint="?color_background_primary"
|
app:backgroundTint="?color_background_primary"
|
||||||
app:elevation="4dp"
|
app:elevation="4dp"
|
||||||
|
|
Loading…
Reference in New Issue