<p><a href="https://developer.android.com/reference/android/Manifest.permission.html#READ_PHONE_STATE">android.permission.<wbr>READ_<wbr>PHONE_<wbr>STATE</a></p>
<p>Benötigt, um die vom Mobilfunk-Netzwerk genutzten Protokolle zu ermitteln.</p>
- <h3>Show Notifications</h3>
+ <h3>Zeige Benachrichtigungen</h3>
<p><a href="https://developer.android.com/reference/android/Manifest.permission.html#POST_NOTIFICATIONS">android.permission.<wbr>POST_<wbr>NOTIFICATIONS</a></p>
<p>Erlaubt Privacy Cell, ein Benachrichtigungs-Icon für die Echtzeit-Überwachung in der Status-Zeile anzuzeigen.</p>
<h3>Vordergrund-Service ausführen</h3>
<p><a href="https://developer.android.com/reference/android/Manifest.permission#FOREGROUND_SERVICE">android.permission.<wbr>FOREGROUND_<wbr>SERVICE</a></p>
- <p>Allows Privacy Cell to update the realtime monitoring notification icon when the app is not in the foreground.</p>
+ <p>Erlaubt Privacy Cell, das Benachrichtigungs-Icon für die Echtzeit-Überwachung in der Status-Zeile zu aktualisieren, auch wenn die App im Hintergrund läuft.</p>
+ <h3>Spezieller Vordergrund-Service</h3>
<p><a href="https://developer.android.com/reference/android/Manifest.permission#FOREGROUND_SERVICE_SPECIAL_USE">android.permission.<wbr>FOREGROUND_<wbr>SERVICE_<wbr>SPECIAL_<wbr>USE</a></p>
- <p>Specifies the type of foreground service.
- Special Use is for services that don't fit into any of the <a href="https://developer.android.com/about/versions/14/changes/fgs-types-required">standard categories</a>.</p>
+ <p>Legt den Typ des verwendeten Vordergrund-Services fest. "Special Use" wird für Services verwendet, die nicht in die
+ <a href="https://developer.android.com/about/versions/14/changes/fgs-types-required">Standard-Kategorien</a> für Vordergrund-Services (z.B. Medienwiedergabe, Positionsbestimmung, etc.) fallen.</p>
<h3>Ausführung bei Systemstart</h3>
<p><a href="https://developer.android.com/reference/android/Manifest.permission#RECEIVE_BOOT_COMPLETED">android.permission.<wbr>RECEIVE_<wbr>BOOT_<wbr>COMPLETED</a></p>
<p><a href="https://developer.android.com/reference/android/Manifest.permission.html#READ_PHONE_STATE">android.permission.<wbr>READ_<wbr>PHONE_<wbr>STATE</a></p>
<p>Richiesta per determinare i protocolli utilizzati dalla rete.</p>
- <h3>Show Notifications</h3>
+ <h3>Mostra notifiche</h3>
<p><a href="https://developer.android.com/reference/android/Manifest.permission.html#POST_NOTIFICATIONS">android.permission.<wbr>POST_<wbr>NOTIFICATIONS</a></p>
- <p>Allows Privacy Cell to display a realtime monitoring notification icon in the status bar.</p>
+ <p>Permette a Privacy Cell di mostrare una icona di notifica di monitoraggio in tempo reale nella barra di stato.</p>
- <h3>Run foreground service</h3>
+ <h3>Esegui il servizio in primo piano</h3>
<p><a href="https://developer.android.com/reference/android/Manifest.permission#FOREGROUND_SERVICE">android.permission.<wbr>FOREGROUND_<wbr>SERVICE</a></p>
- <p>Allows Privacy Cell to update the realtime monitoring notification icon when the app is not in the foreground.</p>
+ <p>Permette a Privacy Cell di aggiornare licona di notifica di monitoraggio in tempo reale anche quando la app non è in primo piano.</p>
<p><a href="https://developer.android.com/reference/android/Manifest.permission#FOREGROUND_SERVICE_SPECIAL_USE">android.permission.<wbr>FOREGROUND_<wbr>SERVICE_<wbr>SPECIAL_<wbr>USE</a></p>
- <p>Specifies the type of foreground service.
- Special Use is for services that don't fit into any of the <a href="https://developer.android.com/about/versions/14/changes/fgs-types-required">standard categories</a>.</p>
+ <p>Specifica il tipo di servizio in primo piano.
+ L'utilizzo speciale è per i servizi che non ricadono in nessuna delle <a href="https://developer.android.com/about/versions/14/changes/fgs-types-required">categorie standard</a>.</p>
- <h3>Run at startup</h3>
+ <h3>Esegui all'avvio</h3>
<p><a href="https://developer.android.com/reference/android/Manifest.permission#RECEIVE_BOOT_COMPLETED">android.permission.<wbr>RECEIVE_<wbr>BOOT_<wbr>COMPLETED</a></p>
- <p>Allows Privacy Cell to enable the realtime monitoring service when the phone boots.</p>
+ <p>Permette a Privacy Cell di abilitare il servizio di monitoraggio in tempo reale durante l'avvio del dispositivo.</p>
<h3><a href="https://developer.android.com/about/versions/13/features#runtime-receivers">com.stoutner.privacycell.<wbr>DYNAMIC_<wbr>RECEIVER_<wbr>NOT_<wbr>EXPORTED_<wbr>PERMISSION</a></h3>
<p>Aggiunta automaticamente a tutte le App che hanno come target API >= 33 (Android 13) per impedire ad altre App di connettersi ai ricevitori dinamici senza una autorizzazione esplicita.</p>
<p><a href="https://developer.android.com/reference/android/Manifest.permission.html#READ_PHONE_STATE">android.permission.<wbr>READ_<wbr>PHONE_<wbr>STATE</a></p>
<p>Необходим для определения используемых протоколов в сети сотовой связи.</p>
- <h3>Show Notifications</h3>
+ <h3>Отображение уведомлений</h3>
<p><a href="https://developer.android.com/reference/android/Manifest.permission.html#POST_NOTIFICATIONS">android.permission.<wbr>POST_<wbr>NOTIFICATIONS</a></p>
<p>Разрешает Privacy Cell отображать значок уведомления о мониторинге в реальном времени в строке состояния.</p>
<h3>Запуск фоновой службы</h3>
<p><a href="https://developer.android.com/reference/android/Manifest.permission#FOREGROUND_SERVICE">android.permission.<wbr>FOREGROUND_<wbr>SERVICE</a></p>
- <p>Allows Privacy Cell to update the realtime monitoring notification icon when the app is not in the foreground.</p>
+ <p>Разрешает Privacy Cell обновлять значок уведомления о мониторинге в реальном времени при работе приложения в фоновом режиме.</p>
<p><a href="https://developer.android.com/reference/android/Manifest.permission#FOREGROUND_SERVICE_SPECIAL_USE">android.permission.<wbr>FOREGROUND_<wbr>SERVICE_<wbr>SPECIAL_<wbr>USE</a></p>
- <p>Specifies the type of foreground service.
- Special Use is for services that don't fit into any of the <a href="https://developer.android.com/about/versions/14/changes/fgs-types-required">standard categories</a>.</p>
+ <p>Определяет тип сервиса фонового режима.
+ Специальное использование предназначено для сервисов, которые не соответствуют ни одной из
+ <a href="https://developer.android.com/about/versions/14/changes/fgs-types-required">стандартных категорий</a>.</p>
<h3>Запуск при загрузке</h3>
<p><a href="https://developer.android.com/reference/android/Manifest.permission#RECEIVE_BOOT_COMPLETED">android.permission.<wbr>RECEIVE_<wbr>BOOT_<wbr>COMPLETED</a></p>
/*
- * Copyright 2021-2022 Soren Stoutner <soren@stoutner.com>.
+ * Copyright 2021-2023 Soren Stoutner <soren@stoutner.com>.
*
* This file is part of Privacy Cell <https://www.stoutner.com/privacy-cell>.
*
// Check to see if the read phone state permission has been granted.
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.READ_PHONE_STATE) == PackageManager.PERMISSION_GRANTED) {
- // Create a register realtime listener work request that fires every hour.
- // This periodic request will fire shortly after being created (it fires about every hour near the beginning of the hour) and will reregister the listener if it gets garbage collected.
- val registerRealtimeListenerWorkRequest = PeriodicWorkRequestBuilder<RegisterRealtimeListenerWorker>(1, TimeUnit.HOURS).build()
+ // Create a register realtime listener work request that fires every fifteen minutes.
+ // This periodic request will fire shortly after being created and will reregister the listener if it gets garbage collected.
+ val registerRealtimeListenerWorkRequest = PeriodicWorkRequestBuilder<RegisterRealtimeListenerWorker>(15, TimeUnit.MINUTES).build()
// Register the realtime listener work request.
WorkManager.getInstance(this).enqueueUniquePeriodicWork(getString(R.string.register_listener_work_request), ExistingPeriodicWorkPolicy.REPLACE, registerRealtimeListenerWorkRequest)
}
fun populateNotification() {
+ // Get the list of current notifications.
+ val activeNotificationsArray = notificationManager.activeNotifications
+
+ // Check to see if there is a current notification.
+ val noCurrentNotification = activeNotificationsArray.isEmpty()
+
// Populate the notification according to the security status.
if ((voiceNetworkSecurityStatus == ProtocolHelper.ANTIQUATED) || (dataNetworkSecurityStatus == ProtocolHelper.ANTIQUATED)) { // This is an antiquated network.
// Only update the notification if the network status has changed.
- if (currentStatus != ANTIQUATED_NETWORK) {
+ if ((currentStatus != ANTIQUATED_NETWORK) || noCurrentNotification) {
// Create an antiquated network notification builder.
val antiquatedNetworkNotificationBuilder = Notification.Builder(applicationContext, ANTIQUATED_NETWORK)
}
} else if ((voiceNetworkSecurityStatus == ProtocolHelper.INSECURE) || (dataNetworkSecurityStatus == ProtocolHelper.INSECURE)) { // This is an insecure network.
// Only update the notification if the network status has changed.
- if (currentStatus != INSECURE_NETWORK) {
+ if ((currentStatus != INSECURE_NETWORK) || noCurrentNotification) {
// Create an insecure network notification builder.
val insecureNetworkNotificationBuilder = Notification.Builder(applicationContext, INSECURE_NETWORK)
}
} else { // This is a secure network.
// Only update the notification if the network status has changed.
- if (currentStatus != SECURE_NETWORK) {
+ if ((currentStatus != SECURE_NETWORK) || noCurrentNotification) {
// Create a secure network notification builder.
val secureNetworkNotificationBuilder = Notification.Builder(applicationContext, SECURE_NETWORK)
// Register the telephony manager listener.
realtimeMonitoringService.registerTelephonyManagerListener()
+ // Populate the notification, which might have been accidentally dismissed by the user beginning in Android 14.
+ realtimeMonitoringService.populateNotification()
+
// Unbind the service.
applicationContext.unbindService(this)
}