diff --git a/play-services-base-core/src/main/java/org/microg/gms/common/ForegroundServiceContext.java b/play-services-base-core/src/main/java/org/microg/gms/common/ForegroundServiceContext.java index 9ff1b5d2..c0faf313 100644 --- a/play-services-base-core/src/main/java/org/microg/gms/common/ForegroundServiceContext.java +++ b/play-services-base-core/src/main/java/org/microg/gms/common/ForegroundServiceContext.java @@ -54,6 +54,7 @@ public class ForegroundServiceContext extends ContextWrapper { context.getSystemService(NotificationManager.class).createNotificationChannel(channel); return new Notification.Builder(context, channel.getId()) .setOngoing(true) + .setSmallIcon(android.R.drawable.stat_notify_error) .setContentTitle("Running in background") .setContentText("microG " + context.getClass().getSimpleName() + " is running in background.") .build(); diff --git a/play-services-nearby-core-ui/src/main/AndroidManifest.xml b/play-services-nearby-core-ui/src/main/AndroidManifest.xml index 2fa37285..d7ac93e7 100644 --- a/play-services-nearby-core-ui/src/main/AndroidManifest.xml +++ b/play-services-nearby-core-ui/src/main/AndroidManifest.xml @@ -9,6 +9,9 @@ + + + + diff --git a/play-services-nearby-core-ui/src/main/kotlin/org/microg/gms/nearby/core/ui/ExposureNotificationsAppPreferencesFragment.kt b/play-services-nearby-core-ui/src/main/kotlin/org/microg/gms/nearby/core/ui/ExposureNotificationsAppPreferencesFragment.kt index d1ae47f5..f6883c22 100644 --- a/play-services-nearby-core-ui/src/main/kotlin/org/microg/gms/nearby/core/ui/ExposureNotificationsAppPreferencesFragment.kt +++ b/play-services-nearby-core-ui/src/main/kotlin/org/microg/gms/nearby/core/ui/ExposureNotificationsAppPreferencesFragment.kt @@ -92,9 +92,11 @@ class ExposureNotificationsAppPreferencesFragment : PreferenceFragmentCompat() { } reportedExposures.removeAll() + reportedExposures.addPreference(reportedExposuresNone) if (mergedExposures.isNullOrEmpty()) { - reportedExposures.addPreference(reportedExposuresNone) + reportedExposuresNone.isVisible = true } else { + reportedExposuresNone.isVisible = false for (exposure in mergedExposures) { val minAttenuation = exposure.subs.map { it.attenuation }.minOrNull() ?: exposure.attenuation val nearby = exposure.attenuation < 63 || minAttenuation < 55 diff --git a/play-services-nearby-core-ui/src/main/kotlin/org/microg/gms/nearby/core/ui/ExposureNotificationsConfirmActivity.kt b/play-services-nearby-core-ui/src/main/kotlin/org/microg/gms/nearby/core/ui/ExposureNotificationsConfirmActivity.kt index a6eb168a..6ec05250 100644 --- a/play-services-nearby-core-ui/src/main/kotlin/org/microg/gms/nearby/core/ui/ExposureNotificationsConfirmActivity.kt +++ b/play-services-nearby-core-ui/src/main/kotlin/org/microg/gms/nearby/core/ui/ExposureNotificationsConfirmActivity.kt @@ -5,18 +5,26 @@ package org.microg.gms.nearby.core.ui +import android.bluetooth.BluetoothAdapter +import android.content.Context +import android.content.Intent import android.content.pm.PackageManager +import android.location.LocationManager import android.os.Build import android.os.Bundle import android.os.ResultReceiver +import android.provider.Settings import android.view.View import android.widget.Button import android.widget.TextView import androidx.appcompat.app.AppCompatActivity import androidx.core.content.ContextCompat +import androidx.core.location.LocationManagerCompat +import androidx.lifecycle.lifecycleScope import org.microg.gms.nearby.exposurenotification.* import org.microg.gms.ui.getApplicationInfoIfExists + class ExposureNotificationsConfirmActivity : AppCompatActivity() { private var resultCode: Int = RESULT_CANCELED set(value) { @@ -44,6 +52,8 @@ class ExposureNotificationsConfirmActivity : AppCompatActivity() { findViewById(R.id.grant_permission_summary).text = getString(R.string.exposure_confirm_permission_description, selfApplicationInfo?.loadLabel(packageManager) ?: packageName) checkPermissions() + checkBluetooth() + checkLocation() } CONFIRM_ACTION_STOP -> { findViewById(android.R.id.title).text = getString(R.string.exposure_confirm_stop_title) @@ -72,8 +82,28 @@ class ExposureNotificationsConfirmActivity : AppCompatActivity() { findViewById