Repository: element-hq/element-x-android (language: kotlin)

Issue:
Firebase Error on LineageOS
### Steps to reproduce

1. Install Element X on a LineageOS mobile phone
2. Start it and login to your homeserver
3. After logging in, an error appears that push notifications might not be available because of "other error"
4. Click on "Settings" and click on "Fix" (i translated them myself from german -> english, so maybe they are not 100% the same wordings)
5. Error will appear


### Outcome
![signal-2024-12-20-121052](https://github.com/user-attachments/assets/5550ff7e-249a-4788-9ec8-1edb38bd6c8d)

#### What did you expect?
No error at all

#### What happened instead?
An error and probably no push notifications at all


### Your phone model

OnePlus 11

### Operating system version

LineageOS 21

### Application version and app store

0.7.5

### Homeserver

Synapse 1.121.1 on debian trixie

### Will you send logs?

Yes

### Are you willing to provide a PR?

No


Discussion hints:
Yes, so what is the exact problem? If you have LineageOS without google apps installed, there will be no Google push available. If you do have the whole Google shebang installed, it should be working.
It says firebase is available and a line below it says firebase not available. My assumption is that the text is misleading, if thats the correct behaviour.
I am not familiar with the push magic behind all those apps, so i assume firebase is the google push server. I installed ntfy as alternative, because thats the non-google push service, right? when firebase is not available, i would expect that to be used. Without an error. 
In the troubleshoot notification test suite, this test:

<img width="400" alt="image" src="https://github.com/user-attachments/assets/831abfd6-a76b-4ab0-b850-5fa80740ce6d" />

(in English)

<img width="400" alt="image" src="https://github.com/user-attachments/assets/899934a4-9a60-42df-92b7-20244eb3bac8" />

is actually confirming that the application is able to use Firebase, if it is installed on the device. It is a check that our internal module interacting with Firebase is included in the build.

I also think that the wording may be a bit confusing.

We may want to change the wording `Detect push providers` to something else like `Detect push provider plugins` or something else.
Thanks, that makes a bit more sense then. 
If my text is correct from https://github.com/element-hq/element-x-android/issues/4079#issuecomment-2558454340, it is still somehow confusing because i use LineageOS without any google services. Why is firebase available at all when its "google-free"? Is this a problem in LineageOS? The other thing is, firebase is available but seems like non-functioning? Why is UnifiedPush then not used? And why cant i change that in element x on android?
Only the code in Element X Android is available to manage Firebase Push for you. But Firebase is not available, conformed by this other test:

<img width="400" alt="image" src="https://github.com/user-attachments/assets/4b8cea61-9b8b-42a7-9655-8d76171fb31e" />

For instance, if a user installs Element X Android from F-Droid (https://f-droid.org/packages/io.element.android.x/), the application will not have the code to manage Firebase, even if Firebase (Google Play Service) is available on their device.
I see, so firebase is available when i install element x from google play store but when i use fdroid, that function is not available at all? so why list it then there? for me, as a bit more technical user, i am highly confused by that and it looks like something is wrong with my mobile phone. Also, i would not say "Firebase ist nicht verfügbar" which means its not there at all, i would use something like "Firebase inkompatibel mit Custom-ROM" or so. 
I installed it from fdroid on a google-free phone, why is there firebase then and those checks? i am now really confused.
I will install it with aurora (google play store wrapper) and see how that behaves. 

Edit: installed it now with aurora and get the same error. Just to be sure i will install it later again from fdroid
Would it bit clearer with this wording?

<img width="395" alt="image" src="https://github.com/user-attachments/assets/c7913c97-7901-46d7-a065-498b5b44dc4e" />

Absolutely! Just a bit much text but it makes now 100% more sense (imo).
Or maybe "The application was built with support for: Firebase, UnifiedPush" ? Reminds me a bit of -configure flags in the linux c world :)
`support` is the word I was looking for, thanks!

Pull request: Update wording for push provider support test. (#4079)
<!-- Please read [CONTRIBUTING.md](https://github.com/element-hq/element-x-android/blob/develop/CONTRIBUTING.md) before submitting your pull request -->
 
## Content

<!-- Describe shortly what has been changed -->
Update wording of the notification test about push provider support.
The text is quite similar, so its OK if translations are updated later. Created a `success_2` though, since we do not need a plural anymore.

## Motivation and context

<!-- Provide link to the corresponding issue if applicable or explain the context -->
Closes #4079

## Screenshots / GIFs

<!--
We have screenshot tests in the project, so attaching screenshots to a PR is not mandatory, as far as there
is a Composable Preview covering the changes. In this case, the change will appear in the file diff.
Note that all the UI composables should be covered by a Composable Preview.

Providing a video of the change is still very useful for the reviewer and for the history of the project.

You can use a table like this to show screenshots comparison.
Uncomment this markdown table below and edit the last line `|||`:
|copy screenshot of before here|copy screenshot of after here|

|Before|After|
|-|-|
|||
 -->

|Before|After|
|-|-|
|<img width="400" alt="image" src="https://github.com/user-attachments/assets/899934a4-9a60-42df-92b7-20244eb3bac8" />|<img width="377" alt="image" src="https://github.com/user-attachments/assets/ea3b8ac3-5762-4b0c-b618-abb2dbab863e" />|


## Tests

<!-- Explain how you tested your development -->

- Step 1
- Step 2
- Step ...

## Tested devices

- [ ] Physical
- [ ] Emulator
- OS version(s):

## Checklist

<!-- Depending on the Pull Request content, it can be acceptable if some of the following checkboxes stay unchecked. -->

- [ ] Changes have been tested on an Android device or Android emulator with API 24
- [ ] UI change has been tested on both light and dark themes
- [ ] Accessibility has been taken into account. See https://github.com/element-hq/element-x-android/blob/develop/CONTRIBUTING.md#accessibility
- [ ] Pull request is based on the develop branch
- [ ] Pull request title will be used in the release note, it clearly define what will change for the user
- [ ] Pull request includes screenshots or videos if containing UI changes
- [ ] You've made a self review of your PR


Test command: ./gradlew :libraries:push:impl:testDebugUnitTest --tests "io.element.android.libraries.push.impl.troubleshoot.PushProvidersTestTest"

Fix patch:
diff --git a/libraries/push/impl/src/main/res/values/localazy.xml b/libraries/push/impl/src/main/res/values/localazy.xml
index 5c6c852f145..9860c8bef7f 100644
--- a/libraries/push/impl/src/main/res/values/localazy.xml
+++ b/libraries/push/impl/src/main/res/values/localazy.xml
@@ -58,13 +58,14 @@
   <string name="troubleshoot_notifications_test_current_push_provider_failure">"No push providers selected."</string>
   <string name="troubleshoot_notifications_test_current_push_provider_success">"Current push provider: %1$s."</string>
   <string name="troubleshoot_notifications_test_current_push_provider_title">"Current push provider"</string>
-  <string name="troubleshoot_notifications_test_detect_push_provider_description">"Ensure that the application has at least one push provider."</string>
-  <string name="troubleshoot_notifications_test_detect_push_provider_failure">"No push providers found."</string>
+  <string name="troubleshoot_notifications_test_detect_push_provider_description">"Ensure that the application supports at least one push provider."</string>
+  <string name="troubleshoot_notifications_test_detect_push_provider_failure">"No push provider support found."</string>
   <plurals name="troubleshoot_notifications_test_detect_push_provider_success">
     <item quantity="one">"Found %1$d push provider: %2$s"</item>
     <item quantity="other">"Found %1$d push providers: %2$s"</item>
   </plurals>
-  <string name="troubleshoot_notifications_test_detect_push_provider_title">"Detect push providers"</string>
+  <string name="troubleshoot_notifications_test_detect_push_provider_success_2">"The application was built with support for: %1$s"</string>
+  <string name="troubleshoot_notifications_test_detect_push_provider_title">"Push provider support"</string>
   <string name="troubleshoot_notifications_test_display_notification_description">"Check that the application can display notification."</string>
   <string name="troubleshoot_notifications_test_display_notification_failure">"The notification has not been clicked."</string>
   <string name="troubleshoot_notifications_test_display_notification_permission_failure">"Cannot display the notification."</string>


Test patch:
diff --git a/libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/troubleshoot/PushProvidersTest.kt b/libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/troubleshoot/PushProvidersTest.kt
index d75c4f4d590..5a30db6f59e 100644
--- a/libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/troubleshoot/PushProvidersTest.kt
+++ b/libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/troubleshoot/PushProvidersTest.kt
@@ -38,10 +38,8 @@ class PushProvidersTest @Inject constructor(
         val result = sortedPushProvider.isNotEmpty()
         if (result) {
             delegate.updateState(
-                description = stringProvider.getQuantityString(
-                    resId = R.plurals.troubleshoot_notifications_test_detect_push_provider_success,
-                    quantity = sortedPushProvider.size,
-                    sortedPushProvider.size,
+                description = stringProvider.getString(
+                    resId = R.string.troubleshoot_notifications_test_detect_push_provider_success_2,
                     sortedPushProvider.joinToString { it.name }
                 ),
                 status = NotificationTroubleshootTestState.Status.Success
diff --git a/libraries/push/impl/src/test/kotlin/io/element/android/libraries/push/impl/troubleshoot/PushProvidersTestTest.kt b/libraries/push/impl/src/test/kotlin/io/element/android/libraries/push/impl/troubleshoot/PushProvidersTestTest.kt
index cc4df51b556..8947b646a69 100644
--- a/libraries/push/impl/src/test/kotlin/io/element/android/libraries/push/impl/troubleshoot/PushProvidersTestTest.kt
+++ b/libraries/push/impl/src/test/kotlin/io/element/android/libraries/push/impl/troubleshoot/PushProvidersTestTest.kt
@@ -53,7 +53,6 @@ class PushProvidersTestTest {
             assertThat(awaitItem().status).isEqualTo(NotificationTroubleshootTestState.Status.InProgress)
             val lastItem = awaitItem()
             assertThat(lastItem.status).isEqualTo(NotificationTroubleshootTestState.Status.Success)
-            assertThat(lastItem.description).contains("2")
             assertThat(lastItem.description).contains("foo")
             assertThat(lastItem.description).contains("bar")
         }