Add a higher level warning for antiquated protocols. https://redmine.stoutner.com...
[PrivacyCell.git] / app / src / main / java / com / stoutner / privacycell / dialogs / WebViewDialog.kt
index ab99a11b5950187f75338d403905932ed8ae4762..0a40933c95174739c3bc5e95d139c4b7851c8032 100644 (file)
@@ -49,32 +49,33 @@ class WebViewDialog : DialogFragment() {
         const val LICENSES = 3
         const val CONTRIBUTORS = 4
         const val STINGRAY = 5
-        const val NETWORK_UNKNOWN = 6
-        const val NETWORK_GPRS = 7
-        const val NETWORK_EDGE = 8
-        const val NETWORK_UMTS = 9
-        const val NETWORK_CDMA = 10
-        const val NETWORK_EVDO_0 = 11
-        const val NETWORK_EVDO_A = 12
-        const val NETWORK_1xRTT = 13
-        const val NETWORK_HSDPA = 14
-        const val NETWORK_HSUPA = 15
-        const val NETWORK_HSPA = 16
-        const val NETWORK_IDEN = 17
-        const val NETWORK_EVDO_B = 18
-        const val NETWORK_LTE = 19
-        const val NETWORK_EHRPD = 20
-        const val NETWORK_HSPAP = 21
-        const val NETWORK_GSM = 22
-        const val NETWORK_TD_SCDMA = 23
-        const val NETWORK_IWLAN = 24
-        const val NETWORK_NR = 25
-        const val OVERRIDE_NETWORK_NONE = 26
-        const val OVERRIDE_NETWORK_LTE_CA = 27
-        const val OVERRIDE_NETWORK_LTE_ADVANCED_PRO = 28
-        const val OVERRIDE_NETWORK_NR_NSA = 29
-        const val OVERRIDE_NETWORK_NR_NSA_MMWAVE = 30  // Can be removed once the minimum API >= 31.
-        const val OVERRIDE_NETWORK_NR_ADVANCED = 31
+        const val ANTIQUATED_NETWORK = 6
+        const val NETWORK_UNKNOWN = 7
+        const val NETWORK_GPRS = 8
+        const val NETWORK_EDGE = 9
+        const val NETWORK_UMTS = 10
+        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_HSDPA = 15
+        const val NETWORK_HSUPA = 16
+        const val NETWORK_HSPA = 17
+        const val NETWORK_IDEN = 18
+        const val NETWORK_EVDO_B = 19
+        const val NETWORK_LTE = 20
+        const val NETWORK_EHRPD = 21
+        const val NETWORK_HSPAP = 22
+        const val NETWORK_GSM = 23
+        const val NETWORK_TD_SCDMA = 24
+        const val NETWORK_IWLAN = 25
+        const val NETWORK_NR = 26
+        const val OVERRIDE_NETWORK_NONE = 27
+        const val OVERRIDE_NETWORK_LTE_CA = 28
+        const val OVERRIDE_NETWORK_LTE_ADVANCED_PRO = 29
+        const val OVERRIDE_NETWORK_NR_NSA = 30
+        const val OVERRIDE_NETWORK_NR_NSA_MMWAVE = 31  // Can be removed once the minimum API >= 31.
+        const val OVERRIDE_NETWORK_NR_ADVANCED = 32
     }
 
     // Define the class views.
@@ -149,15 +150,23 @@ class WebViewDialog : DialogFragment() {
 
             STINGRAY -> {
                 // Set the icon.
-                dialogBuilder.setIcon(R.drawable.secure_5g_nr_sa)
+                dialogBuilder.setIcon(R.drawable.secure)
 
                 // Set the tile.
                 dialogBuilder.setTitle(R.string.stingrays)
             }
 
+            ANTIQUATED_NETWORK -> {
+                // Set the icon.
+                dialogBuilder.setIcon(R.drawable.antiquated)
+
+                // Set the title.
+                dialogBuilder.setTitle(R.string.antiquated_network_title)
+            }
+
             NETWORK_UNKNOWN -> {
                 // Set the icon.
-                dialogBuilder.setIcon(R.drawable.privacy_policy)
+                dialogBuilder.setIcon(R.drawable.protocols)
 
                 // Set the title.
                 dialogBuilder.setTitle(R.string.unknown)
@@ -165,7 +174,7 @@ class WebViewDialog : DialogFragment() {
 
             NETWORK_GPRS -> {
                 // Set the icon.
-                dialogBuilder.setIcon(R.drawable.privacy_policy)
+                dialogBuilder.setIcon(R.drawable.protocols)
 
                 // Set the title.
                 dialogBuilder.setTitle(R.string.gprs)
@@ -173,7 +182,7 @@ class WebViewDialog : DialogFragment() {
 
             NETWORK_EDGE -> {
                 // Set the icon.
-                dialogBuilder.setIcon(R.drawable.privacy_policy)
+                dialogBuilder.setIcon(R.drawable.protocols)
 
                 // Set the title.
                 dialogBuilder.setTitle(R.string.edge)
@@ -181,7 +190,7 @@ class WebViewDialog : DialogFragment() {
 
             NETWORK_UMTS -> {
                 // Set the icon.
-                dialogBuilder.setIcon(R.drawable.privacy_policy)
+                dialogBuilder.setIcon(R.drawable.protocols)
 
                 // Set the title.
                 dialogBuilder.setTitle(R.string.umts)
@@ -189,7 +198,7 @@ class WebViewDialog : DialogFragment() {
 
             NETWORK_CDMA -> {
                 // Set the icon.
-                dialogBuilder.setIcon(R.drawable.privacy_policy)
+                dialogBuilder.setIcon(R.drawable.protocols)
 
                 // Set the title.
                 dialogBuilder.setTitle(R.string.cdma)
@@ -197,7 +206,7 @@ class WebViewDialog : DialogFragment() {
 
             NETWORK_EVDO_0 -> {
                 // Set the icon.
-                dialogBuilder.setIcon(R.drawable.privacy_policy)
+                dialogBuilder.setIcon(R.drawable.protocols)
 
                 // Set the title.
                 dialogBuilder.setTitle(R.string.evdo_0)
@@ -205,7 +214,7 @@ class WebViewDialog : DialogFragment() {
 
             NETWORK_EVDO_A -> {
                 // Set the icon.
-                dialogBuilder.setIcon(R.drawable.privacy_policy)
+                dialogBuilder.setIcon(R.drawable.protocols)
 
                 // Set the title.
                 dialogBuilder.setTitle(R.string.evdo_a)
@@ -213,7 +222,7 @@ class WebViewDialog : DialogFragment() {
 
             NETWORK_1xRTT -> {
                 // Set the icon.
-                dialogBuilder.setIcon(R.drawable.privacy_policy)
+                dialogBuilder.setIcon(R.drawable.protocols)
 
                 // Set the title.
                 dialogBuilder.setTitle(R.string.rtt)
@@ -221,7 +230,7 @@ class WebViewDialog : DialogFragment() {
 
             NETWORK_HSDPA -> {
                 // Set the icon.
-                dialogBuilder.setIcon(R.drawable.privacy_policy)
+                dialogBuilder.setIcon(R.drawable.protocols)
 
                 // Set the title.
                 dialogBuilder.setTitle(R.string.hsdpa)
@@ -229,7 +238,7 @@ class WebViewDialog : DialogFragment() {
 
             NETWORK_HSUPA -> {
                 // Set the icon.
-                dialogBuilder.setIcon(R.drawable.privacy_policy)
+                dialogBuilder.setIcon(R.drawable.protocols)
 
                 // Set the title.
                 dialogBuilder.setTitle(R.string.hsupa)
@@ -237,7 +246,7 @@ class WebViewDialog : DialogFragment() {
 
             NETWORK_HSPA -> {
                 // Set the icon.
-                dialogBuilder.setIcon(R.drawable.privacy_policy)
+                dialogBuilder.setIcon(R.drawable.protocols)
 
                 // Set the title.
                 dialogBuilder.setTitle(R.string.hspa)
@@ -245,7 +254,7 @@ class WebViewDialog : DialogFragment() {
 
             NETWORK_IDEN -> {
                 // Set the icon.
-                dialogBuilder.setIcon(R.drawable.privacy_policy)
+                dialogBuilder.setIcon(R.drawable.protocols)
 
                 // Set the title.
                 dialogBuilder.setTitle(R.string.iden)
@@ -253,7 +262,7 @@ class WebViewDialog : DialogFragment() {
 
             NETWORK_EVDO_B -> {
                 // Set the icon.
-                dialogBuilder.setIcon(R.drawable.privacy_policy)
+                dialogBuilder.setIcon(R.drawable.protocols)
 
                 // Set the title.
                 dialogBuilder.setTitle(R.string.evdo_b)
@@ -261,7 +270,7 @@ class WebViewDialog : DialogFragment() {
 
             NETWORK_LTE -> {
                 // Set the icon.
-                dialogBuilder.setIcon(R.drawable.privacy_policy)
+                dialogBuilder.setIcon(R.drawable.protocols)
 
                 // Set the title.
                 dialogBuilder.setTitle(R.string.lte)
@@ -269,7 +278,7 @@ class WebViewDialog : DialogFragment() {
 
             NETWORK_EHRPD -> {
                 // Set the icon.
-                dialogBuilder.setIcon(R.drawable.privacy_policy)
+                dialogBuilder.setIcon(R.drawable.protocols)
 
                 // Set the title.
                 dialogBuilder.setTitle(R.string.ehrpd)
@@ -277,7 +286,7 @@ class WebViewDialog : DialogFragment() {
 
             NETWORK_HSPAP -> {
                 // Set the icon.
-                dialogBuilder.setIcon(R.drawable.privacy_policy)
+                dialogBuilder.setIcon(R.drawable.protocols)
 
                 // Set the title.
                 dialogBuilder.setTitle(R.string.hspap)
@@ -285,7 +294,7 @@ class WebViewDialog : DialogFragment() {
 
             NETWORK_GSM -> {
                 // Set the icon.
-                dialogBuilder.setIcon(R.drawable.privacy_policy)
+                dialogBuilder.setIcon(R.drawable.protocols)
 
                 // Set the title.
                 dialogBuilder.setTitle(R.string.gsm)
@@ -293,7 +302,7 @@ class WebViewDialog : DialogFragment() {
 
             NETWORK_TD_SCDMA -> {
                 // Set the icon.
-                dialogBuilder.setIcon(R.drawable.privacy_policy)
+                dialogBuilder.setIcon(R.drawable.protocols)
 
                 // Set the title.
                 dialogBuilder.setTitle(R.string.td_scdma)
@@ -301,7 +310,7 @@ class WebViewDialog : DialogFragment() {
 
             NETWORK_IWLAN -> {
                 // Set the icon.
-                dialogBuilder.setIcon(R.drawable.privacy_policy)
+                dialogBuilder.setIcon(R.drawable.protocols)
 
                 // Set the title.
                 dialogBuilder.setTitle(R.string.iwlan)
@@ -309,7 +318,7 @@ class WebViewDialog : DialogFragment() {
 
             NETWORK_NR -> {
                 // Set the icon.
-                dialogBuilder.setIcon(R.drawable.privacy_policy)
+                dialogBuilder.setIcon(R.drawable.protocols)
 
                 // Set the title.
                 dialogBuilder.setTitle(R.string.nr)
@@ -317,7 +326,7 @@ class WebViewDialog : DialogFragment() {
 
             OVERRIDE_NETWORK_NONE -> {
                 // Set the icon.
-                dialogBuilder.setIcon(R.drawable.privacy_policy)
+                dialogBuilder.setIcon(R.drawable.protocols)
 
                 // Set the title.
                 dialogBuilder.setTitle(R.string.none)
@@ -325,7 +334,7 @@ class WebViewDialog : DialogFragment() {
 
             OVERRIDE_NETWORK_LTE_CA -> {
                 // Set the icon.
-                dialogBuilder.setIcon(R.drawable.privacy_policy)
+                dialogBuilder.setIcon(R.drawable.protocols)
 
                 // Set the title.
                 dialogBuilder.setTitle(R.string.lte_ca)
@@ -333,7 +342,7 @@ class WebViewDialog : DialogFragment() {
 
             OVERRIDE_NETWORK_LTE_ADVANCED_PRO -> {
                 // Set the icon.
-                dialogBuilder.setIcon(R.drawable.privacy_policy)
+                dialogBuilder.setIcon(R.drawable.protocols)
 
                 // Set the title.
                 dialogBuilder.setTitle(R.string.lte_advanced_pro)
@@ -341,7 +350,7 @@ class WebViewDialog : DialogFragment() {
 
             OVERRIDE_NETWORK_NR_NSA -> {
                 // Set the icon.
-                dialogBuilder.setIcon(R.drawable.privacy_policy)
+                dialogBuilder.setIcon(R.drawable.protocols)
 
                 // Set the title.
                 dialogBuilder.setTitle(R.string.nr_nsa)
@@ -349,7 +358,7 @@ class WebViewDialog : DialogFragment() {
 
             OVERRIDE_NETWORK_NR_NSA_MMWAVE -> {
                 // Set the icon.
-                dialogBuilder.setIcon(R.drawable.privacy_policy)
+                dialogBuilder.setIcon(R.drawable.protocols)
 
                 // Set the title.
                 dialogBuilder.setTitle(R.string.nr_nsa_mmwave)
@@ -357,7 +366,7 @@ class WebViewDialog : DialogFragment() {
 
             OVERRIDE_NETWORK_NR_ADVANCED -> {
                 // Set the icon.
-                dialogBuilder.setIcon(R.drawable.privacy_policy)
+                dialogBuilder.setIcon(R.drawable.protocols)
 
                 // Set the title.
                 dialogBuilder.setTitle(R.string.nr_advanced)
@@ -423,6 +432,7 @@ class WebViewDialog : DialogFragment() {
             LICENSES -> webView.loadUrl("https://appassets.androidplatform.net/assets/" + getString(R.string.asset_directory) + "/licenses.html")
             CONTRIBUTORS -> webView.loadUrl("https://appassets.androidplatform.net/assets/" + getString(R.string.asset_directory) + "/contributors.html")
             STINGRAY -> webView.loadUrl("https://appassets.androidplatform.net/assets/" + getString(R.string.asset_directory) + "/explanations/stingrays.html")
+            ANTIQUATED_NETWORK -> webView.loadUrl("https://appassets.androidplatform.net/assets/" + getString(R.string.asset_directory) + "/explanations/antiquated_network.html")
             NETWORK_UNKNOWN -> webView.loadUrl("https://appassets.androidplatform.net/assets/" + getString(R.string.asset_directory) + "/explanations/network_unknown.html")
             NETWORK_GPRS -> webView.loadUrl("https://appassets.androidplatform.net/assets/" + getString(R.string.asset_directory) + "/explanations/network_gprs.html")
             NETWORK_EDGE -> webView.loadUrl("https://appassets.androidplatform.net/assets/" + getString(R.string.asset_directory) + "/explanations/network_edge.html")