Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Verified Commit 4158e719 authored by Thomas Lambertz's avatar Thomas Lambertz Committed by Marvin W.
Browse files

EN: Add database export feature. Only exports the advertisements table.

parent 879b4c13
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ class ExposureNotificationsRpisFragment : PreferenceFragmentCompat() {
    private lateinit var histogramCategory: PreferenceCategory
    private lateinit var histogram: BarChartPreference
    private lateinit var deleteAll: Preference
    private lateinit var exportDb: Preference

    override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
        addPreferencesFromResource(R.xml.preferences_exposure_notifications_rpis)
@@ -33,6 +34,7 @@ class ExposureNotificationsRpisFragment : PreferenceFragmentCompat() {
        histogramCategory = preferenceScreen.findPreference("prefcat_exposure_rpi_histogram") ?: histogramCategory
        histogram = preferenceScreen.findPreference("pref_exposure_rpi_histogram") ?: histogram
        deleteAll = preferenceScreen.findPreference("pref_exposure_rpi_delete_all") ?: deleteAll
        exportDb = preferenceScreen.findPreference("pref_exposure_export_database") ?: exportDb
        deleteAll.onPreferenceClickListener = Preference.OnPreferenceClickListener {
            AlertDialog.Builder(requireContext())
                    .setTitle(R.string.pref_exposure_rpi_delete_all_title)
@@ -48,6 +50,10 @@ class ExposureNotificationsRpisFragment : PreferenceFragmentCompat() {
                    .show()
            true
        }
        exportDb.onPreferenceClickListener = Preference.OnPreferenceClickListener {
            ExposureDatabase.export(requireContext())
            true
        }
    }

    override fun onResume() {
+2 −0
Original line number Diff line number Diff line
@@ -33,6 +33,8 @@
    <string name="pref_exposure_rpi_delete_all_title">Alle gesammelten IDs löschen</string>
    <string name="pref_exposure_rpi_delete_all_warning">Nach dem Löschen der gesammelten IDs kannst du nicht mehr informiert werden, falls einer deiner Kontakte der letzten 14 Tage positiv getested wurde.</string>
    <string name="pref_exposure_rpi_delete_all_warning_confirm_button">Trotzdem löschen</string>
    <string name="pref_exposure_rpi_export_title">Datenbank Export</string>
    <string name="pref_exposure_rpi_export_summary">Exportiere die aktuelle Datenbank um sie mit einer anderen App zu analysieren.</string>
    <string name="pref_exposure_info_summary">"Die Exposure Notifications API ermöglicht es Apps, dich zu warnen, falls du Kontakt zu einer positiv getesteten Person hattest.

Das Datum, die Zeitdauer und die Signalstärke, die dem Kontakt zugeordnet sind, werden mit der zugehörigen App geteilt."</string>
+2 −0
Original line number Diff line number Diff line
@@ -43,6 +43,8 @@
    <string name="pref_exposure_rpi_delete_all_title">Delete all collected IDs</string>
    <string name="pref_exposure_rpi_delete_all_warning">Deleting collected IDs will make it impossible to notify you in case any of your contacts of the last 14 days is diagnosed.</string>
    <string name="pref_exposure_rpi_delete_all_warning_confirm_button">Delete anyways</string>
    <string name="pref_exposure_rpi_export_title">Export Database</string>
    <string name="pref_exposure_rpi_export_summary">Export the current database for analysis with another app.</string>
    <string name="pref_exposure_info_summary">"Exposure Notifications API allows apps to notify you if you were exposed to someone who reported to be diagnosed positive.

The date, duration, and signal strength associated with an exposure will be shared with the corresponding app."</string>
+6 −0
Original line number Diff line number Diff line
@@ -18,6 +18,12 @@
            android:key="pref_exposure_rpi_delete_all"
            android:title="@string/pref_exposure_rpi_delete_all_title" />
    </PreferenceCategory>
    <PreferenceCategory android:layout="@layout/preference_category_no_label">
        <Preference
            android:key="pref_exposure_export_database"
            android:title="@string/pref_exposure_rpi_export_title"
            android:summary="@string/pref_exposure_rpi_export_summary" />
    </PreferenceCategory>
    <PreferenceCategory android:layout="@layout/preference_category_no_label">
        <org.microg.gms.ui.TextPreference
            android:icon="@drawable/ic_info_outline"
+10 −0
Original line number Diff line number Diff line
@@ -42,5 +42,15 @@
                <action android:name="android.intent.action.PACKAGE_RESTARTED" />
            </intent-filter>
        </receiver>

        <provider
            android:name="androidx.core.content.FileProvider"
            android:authorities="org.microg.gms.nearby.exposurenotification.export"
            android:grantUriPermissions="true"
            android:exported="false">
            <meta-data
                android:name="android.support.FILE_PROVIDER_PATHS"
                android:resource="@xml/preferences_exposure_notifications_exportedfiles" />
        </provider>
    </application>
</manifest>
Loading