Begin re-architecture of calling screen.

This commit is contained in:
Alex Hart
2024-08-19 15:32:11 -03:00
committed by mtang-signal
parent 71b5a9f865
commit 26e79db057
29 changed files with 2860 additions and 245 deletions

View File

@@ -31,6 +31,7 @@ import org.signal.ringrtc.CallLinkRootKey;
import org.thoughtcrime.securesms.R;
import org.thoughtcrime.securesms.WebRtcCallActivity;
import org.thoughtcrime.securesms.calls.links.CallLinks;
import org.thoughtcrime.securesms.components.webrtc.v2.CallActivity;
import org.thoughtcrime.securesms.contacts.sync.ContactDiscovery;
import org.thoughtcrime.securesms.conversation.ConversationIntents;
import org.thoughtcrime.securesms.database.CallLinkTable;
@@ -396,7 +397,7 @@ public class CommunicationActions {
MessageSender.onMessageSent();
Intent activityIntent = new Intent(callContext.getContext(), WebRtcCallActivity.class);
Intent activityIntent = new Intent(callContext.getContext(), getCallActivityClass());
activityIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
@@ -408,7 +409,7 @@ public class CommunicationActions {
private static void startVideoCallInternal(@NonNull CallContext callContext, @NonNull Recipient recipient, boolean fromCallLink) {
AppDependencies.getSignalCallManager().startPreJoinCall(recipient);
Intent activityIntent = new Intent(callContext.getContext(), WebRtcCallActivity.class);
Intent activityIntent = new Intent(callContext.getContext(), getCallActivityClass());
activityIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
.putExtra(WebRtcCallActivity.EXTRA_ENABLE_VIDEO_IF_AVAILABLE, true)
@@ -478,6 +479,10 @@ public class CommunicationActions {
});
}
private static Class<? extends Activity> getCallActivityClass() {
return RemoteConfig.useNewCallApi() ? CallActivity.class : WebRtcCallActivity.class;
}
private interface CallContext {
@NonNull Permissions.PermissionsBuilder getPermissionsBuilder();
void startActivity(@NonNull Intent intent);

View File

@@ -1111,5 +1111,13 @@ object RemoteConfig {
hotSwappable = true
)
@JvmStatic
@get:JvmName("useNewCallApi")
val newCallUi: Boolean by remoteBoolean(
key = "android.newCallUi",
defaultValue = false,
hotSwappable = false
)
// endregion
}