X-Git-Url: https://gitweb.stoutner.com/?p=PrivacyCell.git;a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fcom%2Fstoutner%2Fprivacycell%2Factivities%2FPrivacyCellActivity.kt;h=b158e057db725a5dc2eaf778a32ad9d5081b0320;hp=13cfe7bda17cd00a996ae16b5303fb76b3160e91;hb=e917bd2fc33983d1a3194a032b1f2a1cc3879502;hpb=fb7c0422487bfb7cbb65427468c2688c24b4b99b diff --git a/app/src/main/java/com/stoutner/privacycell/activities/PrivacyCellActivity.kt b/app/src/main/java/com/stoutner/privacycell/activities/PrivacyCellActivity.kt index 13cfe7b..b158e05 100644 --- a/app/src/main/java/com/stoutner/privacycell/activities/PrivacyCellActivity.kt +++ b/app/src/main/java/com/stoutner/privacycell/activities/PrivacyCellActivity.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2021 Soren Stoutner . + * Copyright © 2021-2022 Soren Stoutner . * * This file is part of Privacy Cell . * @@ -17,16 +17,20 @@ * along with Privacy Cell. If not, see . */ +// The suppression of deprecation lint can be removed once the minimum API >= 31. +@file:Suppress("DEPRECATION") + package com.stoutner.privacycell.activities import android.Manifest +import android.annotation.SuppressLint import android.app.ActivityManager import android.content.Context import android.content.Intent import android.content.pm.PackageManager import android.net.Uri import android.os.Bundle -import android.telephony.PhoneStateListener +import android.telephony.PhoneStateListener // This can be replaced by `TelephonyCallback` once the minimum API >= 31. import android.telephony.ServiceState import android.telephony.TelephonyDisplayInfo import android.telephony.TelephonyManager @@ -51,16 +55,23 @@ import com.google.android.material.navigation.NavigationView import com.stoutner.privacycell.R import com.stoutner.privacycell.dialogs.PhonePermissionDialog import com.stoutner.privacycell.dialogs.WebViewDialog +import com.stoutner.privacycell.helpers.ProtocolHelper import com.stoutner.privacycell.services.RealtimeMonitoringService class PrivacyCellActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelectedListener, PhonePermissionDialog.StoragePermissionDialogListener { + // Define the class variables. + private var voiceNetworkSecurityStatus = ProtocolHelper.UNPOPULATED + private var dataNetworkSecurityStatus = ProtocolHelper.UNPOPULATED + // Declare the class variables. - private lateinit var actionBarDrawerToggle: ActionBarDrawerToggle - private lateinit var phoneStateListener: PhoneStateListener + private lateinit var phoneStateListener: PhoneStateListener // The `PhoneStateListener` can be replaced by `TelephonyCallback` once the minimum API >= 31. // Declare the class views. + private lateinit var actionBarDrawerToggle: ActionBarDrawerToggle private lateinit var drawerLayout: DrawerLayout - private lateinit var stingrayTextView: TextView + private lateinit var overallStatusLinearLayout: LinearLayout + private lateinit var overallStatusImageView: ImageView + private lateinit var overallStatusTextView: TextView override fun onCreate(savedInstanceState: Bundle?) { // Run the default commands. @@ -71,6 +82,7 @@ class PrivacyCellActivity : AppCompatActivity(), NavigationView.OnNavigationItem // Get the preferences. val realtimeMonitoring = sharedPreferences.getBoolean(getString(R.string.realtime_monitoring_key), false) + val consider3gAntiquated = sharedPreferences.getBoolean(getString(R.string.consider_3g_antiquated_key), false) val bottomAppBar = sharedPreferences.getBoolean(getString(R.string.bottom_app_bar_key), false) // Set the content view. @@ -83,9 +95,9 @@ class PrivacyCellActivity : AppCompatActivity(), NavigationView.OnNavigationItem // Get handles for the views. drawerLayout = findViewById(R.id.drawerlayout) val toolbar = findViewById(R.id.toolbar) - val stingrayLinearLayout = findViewById(R.id.stingray_linearlayout) - val stingrayImageView = findViewById(R.id.stingray_imageview) - stingrayTextView = findViewById(R.id.stingray_textview) + overallStatusLinearLayout = findViewById(R.id.overall_status_linearlayout) + overallStatusImageView = findViewById(R.id.overall_status_imageview) + overallStatusTextView = findViewById(R.id.overall_status_textview) val voiceNetworkLinearLayout = findViewById(R.id.voice_network_linearlayout) val voiceNetworkTextView = findViewById(R.id.voice_network) val voiceNetworkDetailsTextView = findViewById(R.id.voice_network_details) @@ -135,53 +147,40 @@ class PrivacyCellActivity : AppCompatActivity(), NavigationView.OnNavigationItem } }) - // Define the phone state listener. + // Instantiate the protocol helper. + val protocolHelper = ProtocolHelper() + + // Define the phone state listener. The `PhoneStateListener` can be replaced by `TelephonyCallback` once the minimum API >= 31. phoneStateListener = object : PhoneStateListener() { - override fun onDisplayInfoChanged(telephonyDisplayInfo: TelephonyDisplayInfo) { - // Populate the stingray security information. - if (telephonyDisplayInfo.networkType == TelephonyManager.NETWORK_TYPE_NR) { // This is a secure 5G NR SA network. - // Populate the image view. - stingrayImageView.setImageDrawable(AppCompatResources.getDrawable(applicationContext, R.drawable.secure_5g_nr_sa)) - - // Set the text. - stingrayTextView.text = getString(R.string.secure_from_stingray) - - // Set the text color. - stingrayTextView.setTextColor(getColor(R.color.blue_text)) - } else { // This is not a secure 5G NR SA network. - // Populate the image view. - stingrayImageView.setImageDrawable(AppCompatResources.getDrawable(applicationContext, R.drawable.not_secure)) - - // Set the text. - stingrayTextView.text = getString(R.string.not_secure_from_stingray) - - // Set the text color. - stingrayTextView.setTextColor(getColor(R.color.red_text)) - } + @Deprecated("Deprecated in Java") + override fun onServiceStateChanged(serviceState: ServiceState) { // Update the voice network. + // Get the network registration info for the voice network, which is the second of the three entries (the first appears to be Wi-Fi and the third appears to be the cell data network). + val networkRegistrationInfo = serviceState.networkRegistrationInfoList[1] - // Get the strings that correspond to the network information. - val dataNetworkType = getNetworkType(telephonyDisplayInfo.networkType) - val additionalNetworkInfo = getAdditionalNetworkInfo(telephonyDisplayInfo.overrideNetworkType) + // Get the voice network type int. + val voiceNetworkTypeInt = networkRegistrationInfo.accessNetworkTechnology - // Populate the data network text views. - dataNetworkTextView.text = getString(R.string.data_network, dataNetworkType[0]) - dataNetworkDetailsTextView.text = dataNetworkType[1] - additionalNetworkInfoTextView.text = getString(R.string.additional_network_info, additionalNetworkInfo[0]) - additionalNetworkInfoDetailsTextView.text = additionalNetworkInfo[1] + // Get the voice network security status. + voiceNetworkSecurityStatus = protocolHelper.checkNetwork(voiceNetworkTypeInt, consider3gAntiquated) - // Set the stingray click listener. - stingrayLinearLayout.setOnClickListener { - // Instantiate the stingray dialog fragment. - val stingrayDialogFragment = WebViewDialog().type(WebViewDialog.STINGRAY) + // Get the voice network type. + val voiceNetworkStringArray = protocolHelper.getNetworkTypeStringArray(voiceNetworkTypeInt, applicationContext) - // Show the alert dialog. - stingrayDialogFragment.show(supportFragmentManager, getString(R.string.stingrays)) + // Populate the voice network text views. + voiceNetworkTextView.text = getString(R.string.voice_network, voiceNetworkStringArray[0]) + voiceNetworkDetailsTextView.text = voiceNetworkStringArray[1] + + // Set the color of the voice network. + when (voiceNetworkSecurityStatus) { + ProtocolHelper.SECURE -> voiceNetworkTextView.setTextColor(getColor(R.color.blue_text)) + ProtocolHelper.INSECURE -> voiceNetworkTextView.setTextColor(getColor(R.color.yellow_text)) + ProtocolHelper.ANTIQUATED -> voiceNetworkTextView.setTextColor(getColor(R.color.red_text)) } - // Set the data network click listener. - dataNetworkLinearLayout.setOnClickListener { - // Instantiate the data network dialog fragment according to the network type. - val dataNetworkDialogFragment = when (telephonyDisplayInfo.networkType) { + // Set the voice network click listener. + voiceNetworkLinearLayout.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_GPRS -> WebViewDialog().type(WebViewDialog.NETWORK_GPRS) TelephonyManager.NETWORK_TYPE_EDGE -> WebViewDialog().type(WebViewDialog.NETWORK_EDGE) @@ -206,41 +205,51 @@ class PrivacyCellActivity : AppCompatActivity(), NavigationView.OnNavigationItem } // Show the alert dialog. - dataNetworkDialogFragment.show(supportFragmentManager, getString(R.string.voice_network)) + voiceNetworkDialogFragment.show(supportFragmentManager, getString(R.string.voice_network)) } - // Set the additional network info click listener. - additionalNetworkInfoLinearLayout.setOnClickListener { - // Instantiate the initial network info dialog fragment according to the network type. - val additionalNetworkInfoDialogFragment = when (telephonyDisplayInfo.overrideNetworkType) { - TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NONE -> WebViewDialog().type(WebViewDialog.OVERRIDE_NETWORK_NONE) - TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_LTE_CA -> WebViewDialog().type(WebViewDialog.OVERRIDE_NETWORK_LTE_CA) - TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_LTE_ADVANCED_PRO -> WebViewDialog().type(WebViewDialog.OVERRIDE_NETWORK_LTE_ADVANCED_PRO) - TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NR_NSA -> WebViewDialog().type(WebViewDialog.OVERRIDE_NETWORK_NR_NSA) - TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NR_NSA_MMWAVE -> WebViewDialog().type(WebViewDialog.OVERRIDE_NETWORK_NR_NSA_MMWAVE) - else -> WebViewDialog().type(WebViewDialog.OVERRIDE_NETWORK_NR_NSA_MMWAVE) - } - - // Show the alert dialog. - additionalNetworkInfoDialogFragment.show(supportFragmentManager, getString(R.string.voice_network)) - } + // Populate the overall security status. + populateOverallSecurityStatus() } - override fun onServiceStateChanged(serviceState: ServiceState) { - // Get the network registration info for the voice network, which is the second of the three entries (the first appears to be Wi-Fi and the third appears to be the cell data network). - val networkRegistrationInfo = serviceState.networkRegistrationInfoList[1] + @Deprecated("Deprecated in Java") + @SuppressLint("SwitchIntDef") + override fun onDisplayInfoChanged(telephonyDisplayInfo: TelephonyDisplayInfo) { // Update the data network. + // Get the network type integers. + val dataNetworkTypeInt = telephonyDisplayInfo.networkType + val additionalNetworkInfoTypeInt = telephonyDisplayInfo.overrideNetworkType - // Get the voice network type. - val voiceNetworkType = getNetworkType(networkRegistrationInfo.accessNetworkTechnology) + // Get the data network security status. + dataNetworkSecurityStatus = protocolHelper.checkNetwork(dataNetworkTypeInt, consider3gAntiquated) - // Populate the voice network text views. - voiceNetworkTextView.text = getString(R.string.voice_network, voiceNetworkType[0]) - voiceNetworkDetailsTextView.text = voiceNetworkType[1] + // Get the strings that correspond to the network information. + val dataNetworkStringArray = protocolHelper.getNetworkTypeStringArray(dataNetworkTypeInt, applicationContext) + val additionalNetworkInfoStringArray = protocolHelper.getAdditionalNetworkInfoStringArray(additionalNetworkInfoTypeInt, applicationContext) - // Set the voice network click listener. - voiceNetworkLinearLayout.setOnClickListener { - // Instantiate the voice network dialog fragment according to the network type. - val voiceNetworkDialogFragment = when (networkRegistrationInfo.accessNetworkTechnology) { + // Populate the data network text views. + dataNetworkTextView.text = getString(R.string.data_network, dataNetworkStringArray[0]) + dataNetworkDetailsTextView.text = dataNetworkStringArray[1] + additionalNetworkInfoTextView.text = getString(R.string.additional_network_info, additionalNetworkInfoStringArray[0]) + additionalNetworkInfoDetailsTextView.text = additionalNetworkInfoStringArray[1] + + // Set the color of the data network. + when (dataNetworkSecurityStatus) { + ProtocolHelper.SECURE -> dataNetworkTextView.setTextColor(getColor(R.color.blue_text)) + ProtocolHelper.INSECURE -> dataNetworkTextView.setTextColor(getColor(R.color.yellow_text)) + ProtocolHelper.ANTIQUATED -> dataNetworkTextView.setTextColor(getColor(R.color.red_text)) + } + + // Set the color of the additional network info. + when (protocolHelper.checkAdditionalNetworkInfo(additionalNetworkInfoTypeInt)) { + ProtocolHelper.SECURE -> additionalNetworkInfoTextView.setTextColor(getColor(R.color.blue_text)) + ProtocolHelper.INSECURE -> additionalNetworkInfoTextView.setTextColor(getColor(R.color.yellow_text)) + ProtocolHelper.ANTIQUATED -> additionalNetworkInfoTextView.setTextColor(getColor(R.color.red_text)) + } + + // Set the data network click listener. + dataNetworkLinearLayout.setOnClickListener { + // Instantiate the data network dialog fragment according to the network type. + val dataNetworkDialogFragment = when (dataNetworkTypeInt) { TelephonyManager.NETWORK_TYPE_UNKNOWN -> WebViewDialog().type(WebViewDialog.NETWORK_UNKNOWN) TelephonyManager.NETWORK_TYPE_GPRS -> WebViewDialog().type(WebViewDialog.NETWORK_GPRS) TelephonyManager.NETWORK_TYPE_EDGE -> WebViewDialog().type(WebViewDialog.NETWORK_EDGE) @@ -265,8 +274,28 @@ class PrivacyCellActivity : AppCompatActivity(), NavigationView.OnNavigationItem } // Show the alert dialog. - voiceNetworkDialogFragment.show(supportFragmentManager, getString(R.string.voice_network)) + dataNetworkDialogFragment.show(supportFragmentManager, getString(R.string.voice_network)) } + + // Set the additional network info click listener. + additionalNetworkInfoLinearLayout.setOnClickListener { + // Instantiate the initial network info dialog fragment according to the network type. + val additionalNetworkInfoDialogFragment = when (telephonyDisplayInfo.overrideNetworkType) { + TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NONE -> WebViewDialog().type(WebViewDialog.OVERRIDE_NETWORK_NONE) + TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_LTE_CA -> WebViewDialog().type(WebViewDialog.OVERRIDE_NETWORK_LTE_CA) + TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_LTE_ADVANCED_PRO -> WebViewDialog().type(WebViewDialog.OVERRIDE_NETWORK_LTE_ADVANCED_PRO) + TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NR_NSA -> WebViewDialog().type(WebViewDialog.OVERRIDE_NETWORK_NR_NSA) + TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NR_NSA_MMWAVE -> WebViewDialog().type(WebViewDialog.OVERRIDE_NETWORK_NR_NSA_MMWAVE) // Can be removed once the minimum API >= 31. + TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NR_ADVANCED -> WebViewDialog().type(WebViewDialog.OVERRIDE_NETWORK_NR_ADVANCED) + else -> WebViewDialog().type(WebViewDialog.OVERRIDE_NETWORK_NONE) + } + + // Show the alert dialog. + additionalNetworkInfoDialogFragment.show(supportFragmentManager, getString(R.string.voice_network)) + } + + // Populate the overall security status. + populateOverallSecurityStatus() } } @@ -326,7 +355,7 @@ class PrivacyCellActivity : AppCompatActivity(), NavigationView.OnNavigationItem // Get a handle for the telephony manager. val telephonyManager = getSystemService(Context.TELEPHONY_SERVICE) as TelephonyManager - // Unregister the telephony manager listener. + // Unregister the telephony manager listener. The `PhoneStateListener` can be replaced by `TelephonyCallback` once the minimum API >= 31. telephonyManager.listen(phoneStateListener, PhoneStateListener.LISTEN_NONE) } @@ -341,6 +370,14 @@ class PrivacyCellActivity : AppCompatActivity(), NavigationView.OnNavigationItem startActivity(settingsIntent) } + R.id.protocols -> { + // Create an intent to load the Protocols activity. + val protocolsIntent = Intent(this, ProtocolsActivity::class.java) + + // Make it so. + startActivity(protocolsIntent) + } + R.id.logcat -> { // Logcat. // Create an intent to load the Logcat activity. val logcatIntent = Intent(this, LogcatActivity::class.java) @@ -469,7 +506,7 @@ class PrivacyCellActivity : AppCompatActivity(), NavigationView.OnNavigationItem registerTelephonyManagerListener() } else { // The read phone state permission was denied. // Display the phone permission text on the main activity. - stingrayTextView.text = getString(R.string.phone_permission_text) + overallStatusTextView.text = getString(R.string.phone_permission_text) } } } @@ -478,46 +515,60 @@ class PrivacyCellActivity : AppCompatActivity(), NavigationView.OnNavigationItem // Get a handle for the telephony manager. val telephonyManager = getSystemService(Context.TELEPHONY_SERVICE) as TelephonyManager - // Listen to changes in the cell network state. - telephonyManager.listen(phoneStateListener, PhoneStateListener.LISTEN_DISPLAY_INFO_CHANGED or PhoneStateListener.LISTEN_SERVICE_STATE) + // Listen to changes in the cell network state. The `PhoneStateListener` can be replaced by `TelephonyCallback` once the minimum API >= 31. + telephonyManager.listen(phoneStateListener, PhoneStateListener.LISTEN_SERVICE_STATE or PhoneStateListener.LISTEN_DISPLAY_INFO_CHANGED) } - private fun getNetworkType(networkType: Int) : Array { - // Return the string that corresponds to the network type. - return when(networkType) { - TelephonyManager.NETWORK_TYPE_UNKNOWN -> arrayOf(getString(R.string.unknown), "") - TelephonyManager.NETWORK_TYPE_GPRS -> arrayOf(getString(R.string.gprs), getString(R.string.gprs_detail)) - TelephonyManager.NETWORK_TYPE_EDGE -> arrayOf(getString(R.string.edge), getString(R.string.edge_detail)) - TelephonyManager.NETWORK_TYPE_UMTS -> arrayOf(getString(R.string.umts), getString(R.string.umts_detail)) - TelephonyManager.NETWORK_TYPE_CDMA -> arrayOf(getString(R.string.cdma), getString(R.string.cdma_detail)) - TelephonyManager.NETWORK_TYPE_EVDO_0 -> arrayOf(getString(R.string.evdo_0), getString(R.string.evdo_0_detail)) - TelephonyManager.NETWORK_TYPE_EVDO_A -> arrayOf(getString(R.string.evdo_a), getString(R.string.evdo_a_detail)) - TelephonyManager.NETWORK_TYPE_1xRTT -> arrayOf(getString(R.string.rtt), getString(R.string.rtt_detail)) - TelephonyManager.NETWORK_TYPE_HSDPA -> arrayOf(getString(R.string.hsdpa), getString(R.string.hsdpa_detail)) - TelephonyManager.NETWORK_TYPE_HSUPA -> arrayOf(getString(R.string.hsupa), getString(R.string.hsupa_detail)) - TelephonyManager.NETWORK_TYPE_HSPA -> arrayOf(getString(R.string.hspa), getString(R.string.hspa_detail)) - TelephonyManager.NETWORK_TYPE_IDEN -> arrayOf(getString(R.string.iden), getString(R.string.iden_detail)) - TelephonyManager.NETWORK_TYPE_EVDO_B -> arrayOf(getString(R.string.evdo_b), getString(R.string.evdo_b_detail)) - TelephonyManager.NETWORK_TYPE_LTE -> arrayOf(getString(R.string.lte), getString(R.string.lte_detail)) - TelephonyManager.NETWORK_TYPE_EHRPD -> arrayOf(getString(R.string.ehrpd), getString(R.string.ehrpd_detail)) - TelephonyManager.NETWORK_TYPE_HSPAP -> arrayOf(getString(R.string.hspap), getString(R.string.hspap_detail)) - TelephonyManager.NETWORK_TYPE_GSM -> arrayOf(getString(R.string.gsm), getString(R.string.gsm_detail)) - TelephonyManager.NETWORK_TYPE_TD_SCDMA -> arrayOf(getString(R.string.td_scdma), getString(R.string.td_scdma_detail)) - TelephonyManager.NETWORK_TYPE_IWLAN -> arrayOf(getString(R.string.iwlan), getString(R.string.iwlan_detail)) - TelephonyManager.NETWORK_TYPE_NR -> arrayOf(getString(R.string.nr), getString(R.string.nr_detail)) - else -> arrayOf(getString(R.string.error), "") + private fun populateOverallSecurityStatus() { + // Create an overall status dialog type integer. + val overallStatusDialogTypeInt: Int + + // Populate the over security status. + if ((voiceNetworkSecurityStatus == ProtocolHelper.ANTIQUATED) || (dataNetworkSecurityStatus == ProtocolHelper.ANTIQUATED)) { // This is an antiquated network. + // Populate the image view. + overallStatusImageView.setImageDrawable(AppCompatResources.getDrawable(applicationContext, R.drawable.antiquated)) + + // Set the text. + overallStatusTextView.text = getString(R.string.antiquated_protocols) + + // Set the text color. + overallStatusTextView.setTextColor(getColor(R.color.red_text)) + + // Set the stingray dialog type integer. + overallStatusDialogTypeInt = WebViewDialog.ANTIQUATED_NETWORK + } else if ((voiceNetworkSecurityStatus == ProtocolHelper.INSECURE) || (dataNetworkSecurityStatus == ProtocolHelper.INSECURE)) { // This is an insecure network. + // Populate the image view. + overallStatusImageView.setImageDrawable(AppCompatResources.getDrawable(applicationContext, R.drawable.insecure)) + + // Set the text. + overallStatusTextView.text = getString(R.string.insecure_protocols) + + // Set the text color. + overallStatusTextView.setTextColor(getColor(R.color.yellow_text)) + + // Set the stingray dialog type integer. + overallStatusDialogTypeInt = WebViewDialog.STINGRAY + } else { // This is a secure network. + // Populate the image view. + overallStatusImageView.setImageDrawable(AppCompatResources.getDrawable(applicationContext, R.drawable.secure)) + + // Set the text. + overallStatusTextView.text = getString(R.string.secure_protocols) + + // Set the text color. + overallStatusTextView.setTextColor(getColor(R.color.blue_text)) + + // Set the stingray dialog type integer. + overallStatusDialogTypeInt = WebViewDialog.STINGRAY } - } - private fun getAdditionalNetworkInfo(overrideNetworkType: Int) : Array { - // Return the string that corresponds to the override network type. - return when(overrideNetworkType) { - TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NONE -> arrayOf(getString(R.string.none), "") - TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_LTE_CA -> arrayOf(getString(R.string.lte_ca), getString(R.string.lte_ca_detail)) - TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_LTE_ADVANCED_PRO -> arrayOf(getString(R.string.lte_advanced_pro), getString(R.string.lte_advanced_pro_detail)) - TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NR_NSA -> arrayOf(getString(R.string.nr_nsa), getString(R.string.nr_nsa_detail)) - TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NR_NSA_MMWAVE -> arrayOf(getString(R.string.nr_nsa_mmwave), getString(R.string.nr_nsa_mmwave_detail)) - else -> arrayOf(getString(R.string.error), "") + // Set the overall status click listener. + overallStatusLinearLayout.setOnClickListener { + // Instantiate the stingray dialog fragment. + val stingrayDialogFragment = WebViewDialog().type(overallStatusDialogTypeInt) + + // Show the alert dialog. + stingrayDialogFragment.show(supportFragmentManager, getString(R.string.stingrays)) } } } \ No newline at end of file