Skip to content

Commit

Permalink
Merge tag 'v7.29.2' into molly-7.29
Browse files Browse the repository at this point in the history
  • Loading branch information
valldrac committed Jan 10, 2025
2 parents 053009c + 81af290 commit 563b38f
Show file tree
Hide file tree
Showing 77 changed files with 10,716 additions and 10,904 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ plugins {
id("molly")
}

val canonicalVersionCode = 1498
val canonicalVersionName = "7.29.1"
val canonicalVersionCode = 1499
val canonicalVersionName = "7.29.2"
val currentHotfixVersion = 0
val maxHotfixVersions = 100
val mollyRevision = 1
Expand Down
190 changes: 90 additions & 100 deletions app/src/main/baseline-prof.txt

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -203,19 +203,23 @@ public void onCreate(Bundle savedInstanceState, boolean ready) {

lifecycleDisposable.add(controlsAndInfo);

logIntent(callIntent);
if (savedInstanceState == null) {
logIntent(callIntent);

if (callIntent.getAction() == CallIntent.Action.ANSWER_VIDEO) {
enableVideoIfAvailable = true;
} else if (callIntent.getAction() == CallIntent.Action.ANSWER_AUDIO || callIntent.isStartedFromFullScreen()) {
enableVideoIfAvailable = false;
if (callIntent.getAction() == CallIntent.Action.ANSWER_VIDEO) {
enableVideoIfAvailable = true;
} else if (callIntent.getAction() == CallIntent.Action.ANSWER_AUDIO || callIntent.isStartedFromFullScreen()) {
enableVideoIfAvailable = false;
} else {
enableVideoIfAvailable = callIntent.shouldEnableVideoIfAvailable();
callIntent.setShouldEnableVideoIfAvailable(false);
}

processIntent(callIntent);
} else {
enableVideoIfAvailable = callIntent.shouldEnableVideoIfAvailable();
callIntent.setShouldEnableVideoIfAvailable(false);
Log.d(TAG, "Activity likely rotated, not processing intent");
}

processIntent(callIntent);

registerSystemPipChangeListeners();

windowLayoutInfoConsumer = new WindowLayoutInfoConsumer();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import org.thoughtcrime.securesms.compose.ComposeBottomSheetDialogFragment
/**
* Education sheet shown before biometrics when linking a device
*/
class LinkDeviceEducationSheet : ComposeBottomSheetDialogFragment() {
class LinkDeviceAuthEducationSheet : ComposeBottomSheetDialogFragment() {

override val peekHeightPercentage: Float = 0.67f

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,15 @@ class LinkDeviceFragment : ComposeFragment() {
}
}

LaunchedEffect(state.seenBioAuthEducationSheet) {
if (state.seenBioAuthEducationSheet) {
if (!biometricAuth.authenticate(requireContext(), true) { biometricDeviceLockLauncher.launch(getString(R.string.LinkDeviceFragment__unlock_to_link)) }) {
navController.safeNavigate(R.id.action_linkDeviceFragment_to_linkDeviceIntroBottomSheet)
}
viewModel.markBioAuthEducationSheetSeen(false)
}
}

Scaffolds.Settings(
title = stringResource(id = R.string.preferences__linked_devices),
onNavigationClick = { navController.popOrFinish() },
Expand All @@ -167,7 +176,7 @@ class LinkDeviceFragment : ComposeFragment() {
state = state,
modifier = Modifier.padding(contentPadding),
onLearnMoreClicked = { navController.safeNavigate(R.id.action_linkDeviceFragment_to_linkDeviceLearnMoreBottomSheet) },
onLinkNewDeviceClicked = { navController.navigateToQrScannerIfAuthed(state.seenBioAuthEducationSheet) },
onLinkNewDeviceClicked = { navController.navigateToQrScannerIfAuthed(!state.needsBioAuthEducationSheet) },
onDeviceSelectedForRemoval = { device -> viewModel.setDeviceToRemove(device) },
onDeviceRemovalConfirmed = { device -> viewModel.removeDevice(device) },
onSyncFailureRetryRequested = { viewModel.onSyncErrorRetryRequested() },
Expand All @@ -181,8 +190,10 @@ class LinkDeviceFragment : ComposeFragment() {
}

private fun NavController.navigateToQrScannerIfAuthed(seenEducation: Boolean) {
if (seenEducation) {
this.safeNavigate(R.id.action_linkDeviceFragment_to_linkDeviceIntroBottomSheet)
if (seenEducation && biometricAuth.canAuthenticate(requireContext())) {
if (!biometricAuth.authenticate(requireContext(), true) { biometricDeviceLockLauncher.launch(getString(R.string.LinkDeviceFragment__unlock_to_link)) }) {
this.safeNavigate(R.id.action_linkDeviceFragment_to_linkDeviceIntroBottomSheet)
}
} else if (biometricAuth.canAuthenticate(requireContext())) {
this.safeNavigate(R.id.action_linkDeviceFragment_to_linkDeviceEducationSheet)
} else {
Expand Down Expand Up @@ -290,7 +301,9 @@ fun DeviceListScreen(

Buttons.LargeTonal(
onClick = onLinkNewDeviceClicked,
modifier = Modifier.defaultMinSize(300.dp).padding(bottom = 8.dp)
modifier = Modifier
.defaultMinSize(300.dp)
.padding(bottom = 8.dp)
) {
Text(stringResource(id = R.string.LinkDeviceFragment__link_a_new_device))
}
Expand Down Expand Up @@ -394,7 +407,10 @@ fun DeviceRow(device: Device, setDeviceToRemove: (Device) -> Unit, onEditDevice:
)

Column(
modifier = Modifier.align(Alignment.CenterVertically).padding(start = 16.dp).weight(1f)
modifier = Modifier
.align(Alignment.CenterVertically)
.padding(start = 16.dp)
.weight(1f)
) {
Text(text = titleString, style = MaterialTheme.typography.bodyLarge)
Text(stringResource(R.string.DeviceListItem_linked_s, linkedDate), style = MaterialTheme.typography.bodyMedium, color = MaterialTheme.colorScheme.onSurfaceVariant)
Expand All @@ -405,7 +421,9 @@ fun DeviceRow(device: Device, setDeviceToRemove: (Device) -> Unit, onEditDevice:
Icon(
painterResource(id = R.drawable.symbol_more_vertical),
contentDescription = null,
modifier = Modifier.padding(top = 16.dp, end = 16.dp).clickable { menuController.show() }
modifier = Modifier
.padding(top = 16.dp, end = 16.dp)
.clickable { menuController.show() }
)

DropdownMenus.Menu(controller = menuController, offsetX = 16.dp, offsetY = 4.dp) { controller ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ data class LinkDeviceSettingsState(
val linkUri: Uri? = null,
val linkDeviceResult: LinkDeviceResult = LinkDeviceResult.None,
val linkWithoutQrCode: Boolean = false,
val seenBioAuthEducationSheet: Boolean = SignalStore.uiHints.hasSeenLinkDeviceAuthSheet() || SignalStore.account.hasLinkedDevices,
val seenBioAuthEducationSheet: Boolean = false,
val needsBioAuthEducationSheet: Boolean = !seenBioAuthEducationSheet && !SignalStore.uiHints.hasSeenLinkDeviceAuthSheet() && !SignalStore.account.hasLinkedDevices,
val bottomSheetVisible: Boolean = false,
val deviceToEdit: Device? = null
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,10 @@ class LinkDeviceViewModel : ViewModel() {
fun markBioAuthEducationSheetSeen(seen: Boolean) {
SignalStore.uiHints.markHasSeenLinkDeviceAuthSheet()
_state.update {
it.copy(seenBioAuthEducationSheet = seen)
it.copy(
seenBioAuthEducationSheet = seen,
needsBioAuthEducationSheet = false
)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@
android:name="org.thoughtcrime.securesms.linkdevice.LinkDeviceLearnMoreBottomSheetFragment" />
<dialog
android:id="@+id/linkDeviceEducationSheet"
android:name="org.thoughtcrime.securesms.linkdevice.LinkDeviceEducationSheet" />
android:name="org.thoughtcrime.securesms.linkdevice.LinkDeviceAuthEducationSheet" />

<fragment
android:id="@+id/editDeviceNameFragment"
Expand Down
Loading

0 comments on commit 563b38f

Please sign in to comment.