From 49238698667310136e077f4a26db613d4f80dc63 Mon Sep 17 00:00:00 2001 From: Morgan Pretty Date: Mon, 24 Aug 2026 11:54:24 +1000 Subject: [PATCH] Notifications: report fast mode unavailable on the website flavour MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The de-googled build has no FCM at all — `firebase-messaging` is only added to the `play` and `fdroid` variants and `FirebasePushService` only appears in their manifests, so `website` binds `NoOpTokenFetcher` and its token is permanently null. But this function returned an unconditional `true`, so onboarding and Notification settings both offered "Fast Mode (Recommended)" and let it be switched on, after which no push was ever registered and nothing said so. Confirmed on an emulator with Play Services present: flavour is a build-time choice, so a fully Google-serviced device gains nothing. Worse, choosing it set PUSH_ENABLED, which suppresses HomeViewModel's battery-optimisation prompt — removing the one mitigation that helps a user who is actually depending on 15-minute background polling. Note this does not migrate existing installs: a website user who already enabled fast mode keeps PUSH_ENABLED set, so their prompt stays suppressed until that pref is also taken into account. --- .../messagenotifications/FastModeAvailability.kt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/src/website/kotlin/org/thoughtcrime/securesms/onboarding/messagenotifications/FastModeAvailability.kt b/app/src/website/kotlin/org/thoughtcrime/securesms/onboarding/messagenotifications/FastModeAvailability.kt index 43d8485bc0..0e12d72699 100644 --- a/app/src/website/kotlin/org/thoughtcrime/securesms/onboarding/messagenotifications/FastModeAvailability.kt +++ b/app/src/website/kotlin/org/thoughtcrime/securesms/onboarding/messagenotifications/FastModeAvailability.kt @@ -2,4 +2,11 @@ package org.thoughtcrime.securesms.onboarding.messagenotifications import android.app.Application -internal fun Application.isFastModeAvailable(): Boolean = true +/** + * Fast mode can never work on this flavour, however capable the device is: it binds + * `NoOpTokenFetcher`, whose token is permanently null, and `PushRegistrationHandler` combines on + * `token.filterNotNull()` — so registration is never even attempted. Reporting it unavailable also + * preserves the battery-optimisation prompt in `HomeViewModel`, which is gated on the user not being + * in fast mode and is the only mitigation left once delivery depends on `BackgroundPollWorker`. + */ +internal fun Application.isFastModeAvailable(): Boolean = false