dependencies {
// Include the following AndroidX libraries.
implementation 'androidx.appcompat:appcompat:1.7.0'
- implementation 'androidx.core:core-ktx:1.15.0'
+ implementation 'androidx.core:core-ktx:1.16.0'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.7'
implementation 'androidx.preference:preference-ktx:1.2.1'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
implementation 'androidx.webkit:webkit:1.13.0'
- implementation 'androidx.work:work-runtime-ktx:2.10.0'
+ implementation 'androidx.work:work-runtime-ktx:2.10.1'
// Include the Kotlin standard library. This should be the same version number listed in the project build.gradle.
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.1.0'
<?xml version="1.0" encoding="utf-8"?>
<!--
- Copyright 2021-2023 Soren Stoutner <soren@stoutner.com>.
+ Copyright 2021-2023, 2025 Soren Stoutner <soren@stoutner.com>.
This file is part of Privacy Cell <https://www.stoutner.com/privacy-cell>.
<!-- Required to read cell network information. <Dangerous permission> -->
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
+ <!-- Required to read sim card phone numbers. <Dangerous permission> -->
+ <uses-permission android:name="android.permission.READ_PHONE_NUMBERS" />
+
<!-- Required to display a notification. <Dangerous permission> -->
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
android:label="@string/cell"
android:launchMode="singleTask"
android:screenOrientation="fullUser"
- android:exported="true" >
+ android:exported="true"
+ tools:ignore="DiscouragedApi" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
android:name=".activities.SettingsActivity"
android:label="@string/settings"
android:parentActivityName=".activities.PrivacyCellActivity"
- android:screenOrientation="fullUser" />
+ android:screenOrientation="fullUser"
+ tools:ignore="DiscouragedApi" />
<!-- Protocols Activity. The `parentActivityName` is used when navigating back. -->
<activity
android:name=".activities.ProtocolsActivity"
android:label="@string/protocols"
android:parentActivityName=".activities.PrivacyCellActivity"
- android:screenOrientation="fullUser" />
+ android:screenOrientation="fullUser"
+ tools:ignore="DiscouragedApi" />
<!-- Logcat Activity. The `parentActivityName` is used when navigating back. -->
<activity
android:name=".activities.LogcatActivity"
android:label="@string/logcat"
android:parentActivityName=".activities.PrivacyCellActivity"
- android:screenOrientation="fullUser" />
+ android:screenOrientation="fullUser"
+ tools:ignore="DiscouragedApi" />
<!-- Realtime Monitoring Service. -->
<service
<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>Read phone numbers</h3>
+ <p><a href="https://developer.android.com/reference/android/Manifest.permission.html#READ_PHONE_NUMBERS">android.permission.<wbr>READ_<wbr>PHONE_<wbr>NUMBERS</a></p>
+ <p>Required to display the cell network name and phone number of the SIM card.</p>
+
<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>
<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>Erlaubt Privacy Cell die Echtzeit-Überwachung zu aktivieren, wenn das Smartphone gebootet wird.</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>Automatisch hinzugefügt für alle Apps mit API >= 33 (Android 13), um zu verhindern, dass sich andere Apps ohne expliziter Erlaubnis mit dynamischen BroadcastReceivern verbinden.</p>
+ <h3>Dynamic receiver not exported</h3>
+ <p><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></p>
+ <p>Automatisch hinzugefügt für alle Apps mit API >= 33 (Android >= 13), um zu verhindern, dass sich andere Apps ohne expliziter Erlaubnis mit dynamischen BroadcastReceivern verbinden.</p>
</body>
</html>
\ No newline at end of file
<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>Required to determine which protocols are being used by the cell phone network.</p>
- <h3>Show Notifications</h3>
+ <h3>Read phone numbers</h3>
+ <p><a href="https://developer.android.com/reference/android/Manifest.permission.html#READ_PHONE_NUMBERS">android.permission.<wbr>READ_<wbr>PHONE_<wbr>NUMBERS</a></p>
+ <p>Required to display the cell network name and phone number of the SIM card.</p>
+
+ <h3>Show notifications</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><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>
+ <h3>Foreground service special use</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><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>
- <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>Automatically added to all apps targeting API >= 33 (Android 13) to prevent other apps from connecting to dynamic receivers without explicit permission.</p>
+ <h3>Dynamic receiver not exported</h3>
+ <p><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></p>
+ <p>Automatically added to all apps targeting API >= 33 (Android >= 13) to prevent other apps from connecting to dynamic receivers without explicit permission.</p>
</body>
</html>
<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>Requerido para determinar qué protocolos se están usando por la red del teléfono celular.</p>
+ <h3>Read phone numbers</h3>
+ <p><a href="https://developer.android.com/reference/android/Manifest.permission.html#READ_PHONE_NUMBERS">android.permission.<wbr>READ_<wbr>PHONE_<wbr>NUMBERS</a></p>
+ <p>Required to display the cell network name and phone number of the SIM card.</p>
+
<h3>Mostrar notificaciones</h3>
<p><a href="https://developer.android.com/reference/android/Manifest.permission.html#POST_NOTIFICATIONS">android.permission.<wbr>POST_<wbr>NOTIFICATIONS</a></p>
<p>Permite a Privacy Cell mostrar un icono de notificación de supervisión en tiempo real en la barrra de estado.</p>
<p><a href="https://developer.android.com/reference/android/Manifest.permission#FOREGROUND_SERVICE">android.permission.<wbr>FOREGROUND_<wbr>SERVICE</a></p>
<p>Permite a Privacy Cell actualizar el icono de notificación de supervisión cuando la aplicación no está en primer plano.</p>
+ <h3>Foreground service special use</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>Especifica el tipo de servicio en primer plano.
El uso especial es para servicios que no encajan en ninguna de las <a href="https://developer.android.com/about/versions/14/changes/fgs-types-required">categorías estándar</a>.</p>
<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>Permite a Privacy Cell activar el servicio de monitorización en tiempo real al arrancar el teléfono.</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>Se añade automáticamente a todas las aplicaciones con API >= 33 (Android 13) para impedir que otras aplicaciones se conecten a receptores dinámicos sin permiso explícito.</p>
+ <h3>Dynamic receiver not exported</h3>
+ <p><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></p>
+ <p>Se añade automáticamente a todas las aplicaciones con API >= 33 (Android >= 13) para impedir que otras aplicaciones se conecten a receptores dinámicos sin permiso explícito.</p>
</body>
</html>
<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>Nécessaire pour déterminer quels protocoles sont utilisés par le réseau de téléphonie mobile.</p>
+ <h3>Read phone numbers</h3>
+ <p><a href="https://developer.android.com/reference/android/Manifest.permission.html#READ_PHONE_NUMBERS">android.permission.<wbr>READ_<wbr>PHONE_<wbr>NUMBERS</a></p>
+ <p>Required to display the cell network name and phone number of the SIM card.</p>
+
<h3>Afficher les Notifications</h3>
<p><a href="https://developer.android.com/reference/android/Manifest.permission.html#POST_NOTIFICATIONS">android.permission.<wbr>POST_<wbr>NOTIFICATIONS</a></p>
<p>Permet à Privacy Cell d'afficher une icône de notification de surveillance en temps réel dans la barre d'état.</p>
<p><a href="https://developer.android.com/reference/android/Manifest.permission#FOREGROUND_SERVICE">android.permission.<wbr>FOREGROUND_<wbr>SERVICE</a></p>
<p>Permet à Privacy Cell de mettre à jour l'icône de notification de surveillance en temps réel lorsque l'application n'est pas au premier plan.</p>
+ <h3>Foreground service special use</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>Spécifie le type de service de premier plan.
L'utilisation spécifique concerne les services qui n'entrent dans <a href="https://developer.android.com/about/versions/14/changes/fgs-types-required">aucune des catégories standard</a>.</p>
<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>Permet à Privacy Cell d'activer le service de surveillance en temps réel lorsque le téléphone démarre.</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>Ajout automatique à toutes les applications ciblant l'API >= 33 (Android 13) pour empêcher les autres applications de se connecter aux destinataires dynamiques sans autorisation explicite.</p>
+ <h3>Dynamic receiver not exported</h3>
+ <p><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></p>
+ <p>Ajout automatique à toutes les applications ciblant l'API >= 33 (Android >= 13) pour empêcher les autres applications de se connecter aux destinataires dynamiques sans autorisation explicite.</p>
</body>
</html>
<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>Read phone numbers</h3>
+ <p><a href="https://developer.android.com/reference/android/Manifest.permission.html#READ_PHONE_NUMBERS">android.permission.<wbr>READ_<wbr>PHONE_<wbr>NUMBERS</a></p>
+ <p>Required to display the cell network name and phone number of the SIM card.</p>
+
<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>Permette a Privacy Cell di mostrare una icona di notifica di monitoraggio in tempo reale nella barra di stato.</p>
<p><a href="https://developer.android.com/reference/android/Manifest.permission#FOREGROUND_SERVICE">android.permission.<wbr>FOREGROUND_<wbr>SERVICE</a></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>
+ <h3>Foreground service special use</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>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>
<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>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>
+ <h3>Dynamic receiver not exported</h3>
+ <p><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></p>
+ <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>
</body>
</html>
<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>Read phone numbers</h3>
+ <p><a href="https://developer.android.com/reference/android/Manifest.permission.html#READ_PHONE_NUMBERS">android.permission.<wbr>READ_<wbr>PHONE_<wbr>NUMBERS</a></p>
+ <p>Required to display the cell network name and phone number of the SIM card.</p>
+
<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>
<p><a href="https://developer.android.com/reference/android/Manifest.permission#FOREGROUND_SERVICE">android.permission.<wbr>FOREGROUND_<wbr>SERVICE</a></p>
<p>Разрешает Privacy Cell обновлять значок уведомления о мониторинге в реальном времени при работе приложения в фоновом режиме.</p>
+ <h3>Foreground service special use</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>Определяет тип сервиса фонового режима.
Специальное использование предназначено для сервисов, которые не соответствуют ни одной из
<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>Разрешает Privacy Cell включать службу мониторинга в реальном времени при загрузке телефона.</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>Автоматически добавляется во все приложения, использующие API >= 33 (Android 13) для предотвращения подключения других приложений к динамическим приемникам без явного разрешения.</p>
+ <h3>Dynamic receiver not exported</h3>
+ <p><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></p>
+ <p>Автоматически добавляется во все приложения, использующие API >= 33 (Android >= 13) для предотвращения подключения других приложений к динамическим приемникам без явного разрешения.</p>
</body>
</html>
/* SPDX-License-Identifier: GPL-3.0-or-later
- * SPDX-FileCopyrightText: 2021-2022 Soren Stoutner <soren@stoutner.com>
+ * SPDX-FileCopyrightText: 2021-2022, 2025 Soren Stoutner <soren@stoutner.com>
*
* This file is part of Privacy Cell <https://www.stoutner.com/privacy-cell/>.
*
import android.content.Context
import android.content.Intent
import android.content.pm.PackageManager
+import android.os.Build
import android.os.Bundle
import android.telephony.PhoneStateListener // This can be replaced by `TelephonyCallback` once the minimum API >= 31.
import android.telephony.ServiceState
+import android.telephony.SubscriptionManager
import android.telephony.TelephonyDisplayInfo
import android.telephony.TelephonyManager
import android.view.MenuItem
import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.content.res.AppCompatResources
import androidx.appcompat.widget.Toolbar
+import androidx.cardview.widget.CardView
import androidx.core.app.ActivityCompat
import androidx.core.net.toUri
import androidx.core.view.GravityCompat
// Declare the class views.
private lateinit var actionBarDrawerToggle: ActionBarDrawerToggle
private lateinit var drawerLayout: DrawerLayout
- private lateinit var overallStatusLinearLayout: LinearLayout
+ private lateinit var overallStatusCardView: CardView
private lateinit var overallStatusImageView: ImageView
private lateinit var overallStatusTextView: TextView
// Get handles for the views.
drawerLayout = findViewById(R.id.drawerlayout)
val toolbar = findViewById<Toolbar>(R.id.toolbar)
- overallStatusLinearLayout = findViewById(R.id.overall_status_linearlayout)
+ overallStatusCardView = findViewById(R.id.overall_status_cardview)
overallStatusImageView = findViewById(R.id.overall_status_imageview)
overallStatusTextView = findViewById(R.id.overall_status_textview)
- val voiceNetworkLinearLayout = findViewById<LinearLayout>(R.id.voice_network_linearlayout)
+ val voiceNetworkCardView = findViewById<CardView>(R.id.voice_network_cardview)
val voiceNetworkTextView = findViewById<TextView>(R.id.voice_network)
val voiceNetworkDetailsTextView = findViewById<TextView>(R.id.voice_network_details)
+ val voiceNetworkSubscriptionInfoTextView = findViewById<TextView>(R.id.voice_network_subscription_info)
val dataNetworkLinearLayout = findViewById<LinearLayout>(R.id.data_network_linearlayout)
val dataNetworkTextView = findViewById<TextView>(R.id.data_network)
val dataNetworkDetailsTextView = findViewById<TextView>(R.id.data_network_details)
+ val dataNetworkSubscriptionInfoTextView = findViewById<TextView>(R.id.data_network_subscription_info)
val additionalNetworkInfoLinearLayout = findViewById<LinearLayout>(R.id.additional_network_info_linearlayout)
val additionalNetworkInfoTextView = findViewById<TextView>(R.id.additional_network_info)
val additionalNetworkInfoDetailsTextView = findViewById<TextView>(R.id.additional_network_info_details)
// Instantiate the protocol helper.
val protocolHelper = ProtocolHelper()
+ // Get a handle for the subscription manager.
+ val subscriptionManager = getSystemService(Context.TELEPHONY_SUBSCRIPTION_SERVICE) as SubscriptionManager
+
// Define the phone state listener. The `PhoneStateListener` can be replaced by `TelephonyCallback` once the minimum API >= 31.
phoneStateListener = object : PhoneStateListener() {
@Deprecated("Deprecated in Java")
// Get the voice network type.
val voiceNetworkStringArray = protocolHelper.getNetworkTypeStringArray(voiceNetworkTypeInt, applicationContext)
+ // Get the default voice subscription id.
+ val voiceSubscriptionId = SubscriptionManager.getDefaultVoiceSubscriptionId()
+
+ // Create the voice subscription info string.
+ var voiceSubscriptionInfoString = ""
+
+ // Populate the voice carrier info string if the appropriate permission has been granted.
+ if (ActivityCompat.checkSelfPermission(applicationContext, Manifest.permission.READ_PHONE_NUMBERS) == PackageManager.PERMISSION_GRANTED) {
+ // Populate the voice carrier info string. The deprecated command must be used until the API >= 33.
+ voiceSubscriptionInfoString = if (Build.VERSION.SDK_INT <= 32)
+ "${subscriptionManager.getActiveSubscriptionInfo(voiceSubscriptionId).carrierName} – ${subscriptionManager.getActiveSubscriptionInfo(voiceSubscriptionId).number}"
+ else
+ "${subscriptionManager.getActiveSubscriptionInfo(voiceSubscriptionId).carrierName} – ${subscriptionManager.getPhoneNumber(voiceSubscriptionId)}"
+ }
+
// Populate the voice network text views.
voiceNetworkTextView.text = getString(R.string.voice_network, voiceNetworkStringArray[0])
voiceNetworkDetailsTextView.text = voiceNetworkStringArray[1]
+ voiceNetworkSubscriptionInfoTextView.text = voiceSubscriptionInfoString
+
+ // Hide the voice network details text view if it is empty, which happens with Wi-Fi calling.
+ if (voiceNetworkDetailsTextView.text.isNullOrBlank())
+ voiceNetworkDetailsTextView.visibility = View.GONE
+ else
+ voiceNetworkDetailsTextView.visibility = View.VISIBLE
// Set the color of the voice network.
when (voiceNetworkSecurityStatus) {
}
// Set the voice network click listener.
- voiceNetworkLinearLayout.setOnClickListener {
+ voiceNetworkCardView.setOnClickListener {
// Instantiate the voice network dialog fragment according to the network type.
val voiceNetworkDialogFragment = when (voiceNetworkTypeInt) {
TelephonyManager.NETWORK_TYPE_UNKNOWN -> WebViewDialog().type(WebViewDialog.NETWORK_UNKNOWN)
TelephonyManager.NETWORK_TYPE_CDMA -> WebViewDialog().type(WebViewDialog.NETWORK_CDMA)
TelephonyManager.NETWORK_TYPE_EVDO_0 -> WebViewDialog().type(WebViewDialog.NETWORK_EVDO_0)
TelephonyManager.NETWORK_TYPE_EVDO_A -> WebViewDialog().type(WebViewDialog.NETWORK_EVDO_A)
- TelephonyManager.NETWORK_TYPE_1xRTT -> WebViewDialog().type(WebViewDialog.NETWORK_1xRTT)
+ TelephonyManager.NETWORK_TYPE_1xRTT -> WebViewDialog().type(WebViewDialog.NETWORK_1XRTT)
TelephonyManager.NETWORK_TYPE_HSDPA -> WebViewDialog().type(WebViewDialog.NETWORK_HSDPA)
TelephonyManager.NETWORK_TYPE_HSUPA -> WebViewDialog().type(WebViewDialog.NETWORK_HSUPA)
TelephonyManager.NETWORK_TYPE_HSPA -> WebViewDialog().type(WebViewDialog.NETWORK_HSPA)
val dataNetworkStringArray = protocolHelper.getNetworkTypeStringArray(dataNetworkTypeInt, applicationContext)
val additionalNetworkInfoStringArray = protocolHelper.getAdditionalNetworkInfoStringArray(additionalNetworkInfoTypeInt, applicationContext)
+ // Get the active data subscription id.
+ val dataSubscriptionId = SubscriptionManager.getActiveDataSubscriptionId()
+
+ // Create the data carrier info string.
+ var dataSubscriptionInfoString = ""
+
+ // Populate the data carrier info string if the appropriate permission has been granted.
+ if (ActivityCompat.checkSelfPermission(applicationContext, Manifest.permission.READ_PHONE_NUMBERS) == PackageManager.PERMISSION_GRANTED) {
+ // Populate the data carrier info string. The deprecated command must be used until the API >= 33.
+ dataSubscriptionInfoString = if (Build.VERSION.SDK_INT <= 32)
+ "${subscriptionManager.getActiveSubscriptionInfo(dataSubscriptionId).carrierName} – ${subscriptionManager.getActiveSubscriptionInfo(dataSubscriptionId).number}"
+ else
+ "${subscriptionManager.getActiveSubscriptionInfo(dataSubscriptionId).carrierName} – ${subscriptionManager.getPhoneNumber(dataSubscriptionId)}"
+ }
+
// Populate the data network text views.
dataNetworkTextView.text = getString(R.string.data_network, dataNetworkStringArray[0])
dataNetworkDetailsTextView.text = dataNetworkStringArray[1]
+ dataNetworkSubscriptionInfoTextView.text = dataSubscriptionInfoString
additionalNetworkInfoTextView.text = getString(R.string.additional_network_info, additionalNetworkInfoStringArray[0])
additionalNetworkInfoDetailsTextView.text = additionalNetworkInfoStringArray[1]
TelephonyManager.NETWORK_TYPE_CDMA -> WebViewDialog().type(WebViewDialog.NETWORK_CDMA)
TelephonyManager.NETWORK_TYPE_EVDO_0 -> WebViewDialog().type(WebViewDialog.NETWORK_EVDO_0)
TelephonyManager.NETWORK_TYPE_EVDO_A -> WebViewDialog().type(WebViewDialog.NETWORK_EVDO_A)
- TelephonyManager.NETWORK_TYPE_1xRTT -> WebViewDialog().type(WebViewDialog.NETWORK_1xRTT)
+ TelephonyManager.NETWORK_TYPE_1xRTT -> WebViewDialog().type(WebViewDialog.NETWORK_1XRTT)
TelephonyManager.NETWORK_TYPE_HSDPA -> WebViewDialog().type(WebViewDialog.NETWORK_HSDPA)
TelephonyManager.NETWORK_TYPE_HSUPA -> WebViewDialog().type(WebViewDialog.NETWORK_HSUPA)
TelephonyManager.NETWORK_TYPE_HSPA -> WebViewDialog().type(WebViewDialog.NETWORK_HSPA)
super.onStart()
// Check to see if the read phone state permission has been granted. These commands need to be run on every start so that the listener is reregistered.
- if (ActivityCompat.checkSelfPermission(this, Manifest.permission.READ_PHONE_STATE) == PackageManager.PERMISSION_GRANTED) { // The storage permission has been granted.
+ if ((ActivityCompat.checkSelfPermission(this, Manifest.permission.READ_PHONE_STATE) == PackageManager.PERMISSION_GRANTED) &&
+ (ActivityCompat.checkSelfPermission(this, Manifest.permission.READ_PHONE_NUMBERS) == PackageManager.PERMISSION_GRANTED)) { // The phone permissions have been granted.
// Register the telephony manager listener.
registerTelephonyManagerListener()
} else { // The phone permission has not been granted.
}
} else { // Show the permission request directly.
// Request the read phone state permission.
- ActivityCompat.requestPermissions(this, arrayOf(Manifest.permission.READ_PHONE_STATE), PHONE_PERMISSION_REQUEST_CODE)
+ ActivityCompat.requestPermissions(this, arrayOf(Manifest.permission.READ_PHONE_STATE, Manifest.permission.READ_PHONE_NUMBERS), PHONE_PERMISSION_REQUEST_CODE)
}
}
}
}
// Set the overall status click listener.
- overallStatusLinearLayout.setOnClickListener {
+ overallStatusCardView.setOnClickListener {
// Instantiate the stingray dialog fragment.
val stingrayDialogFragment = WebViewDialog().type(overallStatusDialogTypeInt)
/* SPDX-License-Identifier: GPL-3.0-or-later
- * SPDX-FileCopyrightText: 2022 Soren Stoutner <soren@stoutner.com>
+ * SPDX-FileCopyrightText: 2022, 2025 Soren Stoutner <soren@stoutner.com>
*
* This file is part of Privacy Cell <https://www.stoutner.com/privacy-cell/>.
*
getString(R.string.cdma_detail) -> WebViewDialog().type(WebViewDialog.NETWORK_CDMA)
getString(R.string.evdo_0_detail) -> WebViewDialog().type(WebViewDialog.NETWORK_EVDO_0)
getString(R.string.evdo_a_detail) -> WebViewDialog().type(WebViewDialog.NETWORK_EVDO_A)
- getString(R.string.rtt_detail) -> WebViewDialog().type(WebViewDialog.NETWORK_1xRTT)
+ getString(R.string.rtt_detail) -> WebViewDialog().type(WebViewDialog.NETWORK_1XRTT)
getString(R.string.hsdpa_detail) -> WebViewDialog().type(WebViewDialog.NETWORK_HSDPA)
getString(R.string.hsupa_detail) -> WebViewDialog().type(WebViewDialog.NETWORK_HSUPA)
getString(R.string.hspa_detail) -> WebViewDialog().type(WebViewDialog.NETWORK_HSPA)
-/*
- * Copyright 2021-2022 Soren Stoutner <soren@stoutner.com>.
+/* SPDX-License-Identifier: GPL-3.0-or-later
+ * SPDX-FileCopyrightText: 2021-2022 Soren Stoutner <soren@stoutner.com>
*
- * This file is part of Privacy Cell <https://www.stoutner.com/privacy-cell>.
+ * This file is part of Privacy Cell <https://www.stoutner.com/privacy-cell/>.
*
- * Privacy Cell is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later
+ * version.
*
- * Privacy Cell is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
*
- * You should have received a copy of the GNU General Public License
- * along with Privacy Cell. If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU General Public License along with
+ * this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.stoutner.privacycell.dialogs
-/*
- * Copyright 2021-2022 Soren Stoutner <soren@stoutner.com>.
+/* SPDX-License-Identifier: GPL-3.0-or-later
+ * SPDX-FileCopyrightText: 2021-2022 Soren Stoutner <soren@stoutner.com>
*
- * This file is part of Privacy Cell <https://www.stoutner.com/privacy-cell>.
+ * This file is part of Privacy Cell <https://www.stoutner.com/privacy-cell/>.
*
- * Privacy Cell is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later
+ * version.
*
- * Privacy Cell is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
*
- * You should have received a copy of the GNU General Public License
- * along with Privacy Cell. If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU General Public License along with
+ * this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.stoutner.privacycell.dialogs
-/*
- * Copyright 2021-2022 Soren Stoutner <soren@stoutner.com>.
+/* SPDX-License-Identifier: GPL-3.0-or-later
+ * SPDX-FileCopyrightText: 2021-2022, 2025 Soren Stoutner <soren@stoutner.com>
*
- * This file is part of Privacy Cell <https://www.stoutner.com/privacy-cell>.
+ * This file is part of Privacy Cell <https://www.stoutner.com/privacy-cell/>.
*
- * Privacy Cell is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later
+ * version.
*
- * Privacy Cell is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
*
- * You should have received a copy of the GNU General Public License
- * along with Privacy Cell. If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU General Public License along with
+ * this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.stoutner.privacycell.dialogs
const val NETWORK_CDMA = 11
const val NETWORK_EVDO_0 = 12
const val NETWORK_EVDO_A = 13
- const val NETWORK_1xRTT = 14
+ const val NETWORK_1XRTT = 14
const val NETWORK_HSDPA = 15
const val NETWORK_HSUPA = 16
const val NETWORK_HSPA = 17
dialogBuilder.setTitle(R.string.evdo_a)
}
- NETWORK_1xRTT -> {
+ NETWORK_1XRTT -> {
// Set the icon.
dialogBuilder.setIcon(R.drawable.protocols)
NETWORK_CDMA -> webView.loadUrl("https://appassets.androidplatform.net/assets/" + getString(R.string.asset_directory) + "/explanations/network_cdma.html")
NETWORK_EVDO_0 -> webView.loadUrl("https://appassets.androidplatform.net/assets/" + getString(R.string.asset_directory) + "/explanations/network_evdo_0.html")
NETWORK_EVDO_A -> webView.loadUrl("https://appassets.androidplatform.net/assets/" + getString(R.string.asset_directory) + "/explanations/network_evdo_a.html")
- NETWORK_1xRTT -> webView.loadUrl("https://appassets.androidplatform.net/assets/" + getString(R.string.asset_directory) + "/explanations/network_1xrtt.html")
+ NETWORK_1XRTT -> webView.loadUrl("https://appassets.androidplatform.net/assets/" + getString(R.string.asset_directory) + "/explanations/network_1xrtt.html")
NETWORK_HSDPA -> webView.loadUrl("https://appassets.androidplatform.net/assets/" + getString(R.string.asset_directory) + "/explanations/network_hsdpa.html")
NETWORK_HSUPA -> webView.loadUrl("https://appassets.androidplatform.net/assets/" + getString(R.string.asset_directory) + "/explanations/network_hsupa.html")
NETWORK_HSPA -> webView.loadUrl("https://appassets.androidplatform.net/assets/" + getString(R.string.asset_directory) + "/explanations/network_hspa.html")
<LinearLayout
android:layout_height="wrap_content"
android:layout_width="match_parent"
- android:orientation="vertical"
- android:padding="15dp" >
+ android:orientation="vertical" >
<!-- Overall status. -->
- <LinearLayout
- android:id="@+id/overall_status_linearlayout"
+ <androidx.cardview.widget.CardView
+ android:id="@+id/overall_status_cardview"
android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:layout_gravity="center_horizontal"
- android:orientation="vertical"
- tools:ignore="UseCompoundDrawables" >
-
- <ImageView
- android:id="@+id/overall_status_imageview"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center_horizontal"
- tools:ignore="ContentDescription" />
-
- <!-- The text color primary is only displayed if the read phone state permission is not granted.
- The default text is replaced if the permission is not granted or the device is connected to a cell phone network. -->
- <TextView
- android:id="@+id/overall_status_textview"
+ android:layout_width="match_parent"
+ android:layout_marginTop="20dp"
+ android:layout_marginStart="20dp"
+ android:layout_marginEnd="20dp"
+ android:layout_marginBottom="10dp" >
+
+ <LinearLayout
+ android:id="@+id/overall_status_linearlayout"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_gravity="center_horizontal"
- android:textAlignment="center"
- android:layout_marginTop="10dp"
- android:textColor="?android:textColorPrimary"
- android:textSize="20sp"
- android:textStyle="bold"
- android:text="@string/not_connected" />
- </LinearLayout>
+ android:orientation="vertical"
+ android:layout_margin="20dp"
+ tools:ignore="UseCompoundDrawables" >
+
+ <ImageView
+ android:id="@+id/overall_status_imageview"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_horizontal"
+ tools:ignore="ContentDescription" />
+
+ <!-- The text color primary is only displayed if the read phone state permission is not granted.
+ The default text is replaced if the permission is not granted or the device is connected to a cell phone network. -->
+ <TextView
+ android:id="@+id/overall_status_textview"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_gravity="center_horizontal"
+ android:textAlignment="center"
+ android:layout_marginTop="10dp"
+ android:textColor="?android:textColorPrimary"
+ android:textSize="20sp"
+ android:textStyle="bold"
+ android:text="@string/not_connected" />
+ </LinearLayout>
+ </androidx.cardview.widget.CardView>
<!-- Voice network. -->
- <LinearLayout
- android:id="@+id/voice_network_linearlayout"
+ <androidx.cardview.widget.CardView
+ android:id="@+id/voice_network_cardview"
android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:layout_gravity="center_horizontal"
- android:orientation="vertical" >
-
- <TextView
- android:id="@+id/voice_network"
- android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:layout_gravity="center_horizontal"
- android:textAlignment="center"
- android:layout_marginTop="30dp"
- android:textSize="18sp"
- android:textStyle="bold" />
+ android:layout_width="match_parent"
+ android:layout_marginTop="10dp"
+ android:layout_marginStart="20dp"
+ android:layout_marginEnd="20dp"
+ android:layout_marginBottom="10dp" >
- <TextView
- android:id="@+id/voice_network_details"
+ <LinearLayout
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_gravity="center_horizontal"
- android:textAlignment="center"
- android:layout_marginBottom="10dp" />
- </LinearLayout>
+ android:orientation="vertical"
+ android:layout_margin="15dp" >
+
+ <TextView
+ android:id="@+id/voice_network"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_gravity="center_horizontal"
+ android:textAlignment="center"
+ android:textSize="18sp"
+ android:textStyle="bold" />
+
+ <TextView
+ android:id="@+id/voice_network_details"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_gravity="center_horizontal"
+ android:textAlignment="center"
+ android:textColor="?android:textColorPrimary" />
+
+ <TextView
+ android:id="@+id/voice_network_subscription_info"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_gravity="center_horizontal"
+ android:textAlignment="center"
+ android:textSize="12sp" />
+ </LinearLayout>
+ </androidx.cardview.widget.CardView>
<!-- Data network. -->
- <LinearLayout
- android:id="@+id/data_network_linearlayout"
+ <androidx.cardview.widget.CardView
android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:layout_gravity="center_horizontal"
- android:orientation="vertical" >
-
- <TextView
- android:id="@+id/data_network"
- android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:layout_gravity="center_horizontal"
- android:textAlignment="center"
- android:textSize="18sp"
- android:textStyle="bold" />
-
- <TextView
- android:id="@+id/data_network_details"
- android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:layout_gravity="center_horizontal"
- android:textAlignment="center"
- android:layout_marginBottom="10dp" />
- </LinearLayout>
-
- <!-- Additional network info. -->
- <LinearLayout
- android:id="@+id/additional_network_info_linearlayout"
- android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:layout_gravity="center_horizontal"
- android:orientation="vertical" >
-
- <TextView
- android:id="@+id/additional_network_info"
- android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:layout_gravity="center_horizontal"
- android:textAlignment="center"
- android:textSize="18sp"
- android:textStyle="bold" />
+ android:layout_width="match_parent"
+ android:layout_marginTop="10dp"
+ android:layout_marginStart="20dp"
+ android:layout_marginEnd="20dp"
+ android:layout_marginBottom="10dp" >
- <TextView
- android:id="@+id/additional_network_info_details"
+ <LinearLayout
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_gravity="center_horizontal"
- android:textAlignment="center" />
- </LinearLayout>
+ android:orientation="vertical"
+ android:layout_margin="15dp" >
+
+ <LinearLayout
+ android:id="@+id/data_network_linearlayout"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_gravity="center_horizontal"
+ android:orientation="vertical" >
+
+ <TextView
+ android:id="@+id/data_network"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_gravity="center_horizontal"
+ android:textAlignment="center"
+ android:textSize="18sp"
+ android:textStyle="bold"
+ tools:ignore="TooDeepLayout" />
+
+ <TextView
+ android:id="@+id/data_network_details"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_gravity="center_horizontal"
+ android:textAlignment="center"
+ android:textColor="?android:textColorPrimary" />
+
+ <TextView
+ android:id="@+id/data_network_subscription_info"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_gravity="center_horizontal"
+ android:textAlignment="center"
+ android:textSize="12sp" />
+ </LinearLayout>
+
+ <!-- Additional network info. -->
+ <LinearLayout
+ android:id="@+id/additional_network_info_linearlayout"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_gravity="center_horizontal"
+ android:orientation="vertical" >
+
+ <TextView
+ android:id="@+id/additional_network_info"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_gravity="center_horizontal"
+ android:textAlignment="center"
+ android:textSize="18sp"
+ android:textStyle="bold" />
+
+ <TextView
+ android:id="@+id/additional_network_info_details"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_gravity="center_horizontal"
+ android:textAlignment="center"
+ android:textColor="?android:textColorPrimary" />
+ </LinearLayout>
+ </LinearLayout>
+ </androidx.cardview.widget.CardView>
</LinearLayout>
</ScrollView>
<LinearLayout
android:layout_height="wrap_content"
android:layout_width="match_parent"
- android:orientation="vertical"
- android:padding="15dp" >
+ android:orientation="vertical" >
<!-- Overall status. -->
- <LinearLayout
- android:id="@+id/overall_status_linearlayout"
+ <androidx.cardview.widget.CardView
+ android:id="@+id/overall_status_cardview"
android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:layout_gravity="center_horizontal"
- android:orientation="vertical"
- tools:ignore="UseCompoundDrawables" >
-
- <ImageView
- android:id="@+id/overall_status_imageview"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center_horizontal"
- tools:ignore="ContentDescription" />
-
- <!-- The text color primary is only displayed if the read phone state permission is not granted.
- The default text is replaced if the permission is not granted or the device is connected to a cell phone network. -->
- <TextView
- android:id="@+id/overall_status_textview"
+ android:layout_width="match_parent"
+ android:layout_marginTop="20dp"
+ android:layout_marginStart="20dp"
+ android:layout_marginEnd="20dp"
+ android:layout_marginBottom="10dp" >
+
+ <LinearLayout
+ android:id="@+id/overall_status_linearlayout"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_gravity="center_horizontal"
- android:textAlignment="center"
- android:layout_marginTop="10dp"
- android:textColor="?android:textColorPrimary"
- android:textSize="20sp"
- android:textStyle="bold"
- android:text="@string/not_connected" />
- </LinearLayout>
+ android:orientation="vertical"
+ android:layout_margin="20dp"
+ tools:ignore="UseCompoundDrawables" >
+
+ <ImageView
+ android:id="@+id/overall_status_imageview"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_horizontal"
+ tools:ignore="ContentDescription" />
+
+ <!-- The text color primary is only displayed if the read phone state permission is not granted.
+ The default text is replaced if the permission is not granted or the device is connected to a cell phone network. -->
+ <TextView
+ android:id="@+id/overall_status_textview"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_gravity="center_horizontal"
+ android:textAlignment="center"
+ android:layout_marginTop="10dp"
+ android:textColor="?android:textColorPrimary"
+ android:textSize="20sp"
+ android:textStyle="bold"
+ android:text="@string/not_connected" />
+ </LinearLayout>
+ </androidx.cardview.widget.CardView>
<!-- Voice network. -->
- <LinearLayout
- android:id="@+id/voice_network_linearlayout"
+ <androidx.cardview.widget.CardView
+ android:id="@+id/voice_network_cardview"
android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:layout_gravity="center_horizontal"
- android:orientation="vertical" >
-
- <TextView
- android:id="@+id/voice_network"
- android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:layout_gravity="center_horizontal"
- android:textAlignment="center"
- android:layout_marginTop="30dp"
- android:textSize="18sp"
- android:textStyle="bold" />
+ android:layout_width="match_parent"
+ android:layout_marginTop="10dp"
+ android:layout_marginStart="20dp"
+ android:layout_marginEnd="20dp"
+ android:layout_marginBottom="10dp" >
- <TextView
- android:id="@+id/voice_network_details"
+ <LinearLayout
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_gravity="center_horizontal"
- android:textAlignment="center"
- android:layout_marginBottom="10dp" />
- </LinearLayout>
+ android:orientation="vertical"
+ android:layout_margin="15dp" >
+
+ <TextView
+ android:id="@+id/voice_network"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_gravity="center_horizontal"
+ android:textAlignment="center"
+ android:textSize="18sp"
+ android:textStyle="bold" />
+
+ <TextView
+ android:id="@+id/voice_network_details"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_gravity="center_horizontal"
+ android:textAlignment="center"
+ android:textColor="?android:textColorPrimary" />
+
+ <TextView
+ android:id="@+id/voice_network_subscription_info"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_gravity="center_horizontal"
+ android:textAlignment="center"
+ android:textSize="12sp" />
+ </LinearLayout>
+ </androidx.cardview.widget.CardView>
<!-- Data network. -->
- <LinearLayout
- android:id="@+id/data_network_linearlayout"
+ <androidx.cardview.widget.CardView
android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:layout_gravity="center_horizontal"
- android:orientation="vertical" >
-
- <TextView
- android:id="@+id/data_network"
- android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:layout_gravity="center_horizontal"
- android:textAlignment="center"
- android:textSize="18sp"
- android:textStyle="bold" />
-
- <TextView
- android:id="@+id/data_network_details"
- android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:layout_gravity="center_horizontal"
- android:textAlignment="center"
- android:layout_marginBottom="10dp" />
- </LinearLayout>
-
- <!-- Additional network info. -->
- <LinearLayout
- android:id="@+id/additional_network_info_linearlayout"
- android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:layout_gravity="center_horizontal"
- android:orientation="vertical" >
-
- <TextView
- android:id="@+id/additional_network_info"
- android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:layout_gravity="center_horizontal"
- android:textAlignment="center"
- android:textSize="18sp"
- android:textStyle="bold" />
+ android:layout_width="match_parent"
+ android:layout_marginTop="10dp"
+ android:layout_marginStart="20dp"
+ android:layout_marginEnd="20dp"
+ android:layout_marginBottom="10dp" >
- <TextView
- android:id="@+id/additional_network_info_details"
+ <LinearLayout
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_gravity="center_horizontal"
- android:textAlignment="center" />
- </LinearLayout>
+ android:orientation="vertical"
+ android:layout_margin="15dp" >
+
+ <LinearLayout
+ android:id="@+id/data_network_linearlayout"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_gravity="center_horizontal"
+ android:orientation="vertical" >
+
+ <TextView
+ android:id="@+id/data_network"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_gravity="center_horizontal"
+ android:textAlignment="center"
+ android:textSize="18sp"
+ android:textStyle="bold"
+ tools:ignore="TooDeepLayout" />
+
+ <TextView
+ android:id="@+id/data_network_details"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_gravity="center_horizontal"
+ android:textAlignment="center"
+ android:textColor="?android:textColorPrimary" />
+
+ <TextView
+ android:id="@+id/data_network_subscription_info"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_gravity="center_horizontal"
+ android:textAlignment="center"
+ android:textSize="12sp"
+ android:layout_marginBottom="20dp" />
+ </LinearLayout>
+
+ <!-- Additional network info. -->
+ <LinearLayout
+ android:id="@+id/additional_network_info_linearlayout"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_gravity="center_horizontal"
+ android:orientation="vertical" >
+
+ <TextView
+ android:id="@+id/additional_network_info"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_gravity="center_horizontal"
+ android:textAlignment="center"
+ android:textSize="18sp"
+ android:textStyle="bold" />
+
+ <TextView
+ android:id="@+id/additional_network_info_details"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_gravity="center_horizontal"
+ android:textAlignment="center"
+ android:textColor="?android:textColorPrimary" />
+ </LinearLayout>
+ </LinearLayout>
+ </androidx.cardview.widget.CardView>
</LinearLayout>
</ScrollView>
</LinearLayout>
<!-- Permission dialogs. -->
<string name="phone_permission">Phone Permission</string>
- <string name="phone_permission_text">Privacy Cell needs the Read Phone State permission to determine the safety level of your cell connection.</string>
+ <string name="phone_permission_text">Privacy Cell needs the Read Phone State and Read Phone Numbers permissions to determine the safety level of your cell connection and display the phone number of the
+ active SIM card.</string>
<string name="notification_permission">Notification Permission</string>
<string name="notification_permission_text">Privacy Cell needs the Post Notification permission to display realtime monitoring notifications.</string>
<string name="ok">OK</string>
}
dependencies {
- classpath 'com.android.tools.build:gradle:8.9.1'
+ classpath 'com.android.tools.build:gradle:8.9.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:2.1.0"
// NOTE: Do not place your application dependencies here; they belong