- private fun getNetworkType(networkType: Int) : Array<String> {
- // 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