]> gitweb.stoutner.com Git - PrivacyCell.git/blobdiff - app/src/main/java/com/stoutner/privacycell/activities/PrivacyCellActivity.kt
Create a protocols activity. https://redmine.stoutner.com/issues/774
[PrivacyCell.git] / app / src / main / java / com / stoutner / privacycell / activities / PrivacyCellActivity.kt
index 55d7c92e4111d2cc3a58af10497b715093ba3955..7d6fd776b7d36726bb069521309de934bcbf1df5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright © 2021 Soren Stoutner <soren@stoutner.com>.
+ * Copyright © 2021-2022 Soren Stoutner <soren@stoutner.com>.
  *
  * This file is part of Privacy Cell <https://www.stoutner.com/privacy-cell>.
  *
  * along with Privacy Cell.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+// 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
@@ -137,6 +141,7 @@ class PrivacyCellActivity : AppCompatActivity(), NavigationView.OnNavigationItem
 
         // Define the phone state listener.  The `PhoneStateListener` can be replaced by `TelephonyCallback` once the minimum API >= 31.
         phoneStateListener = object : PhoneStateListener() {
+            @SuppressLint("SwitchIntDef")
             override fun onDisplayInfoChanged(telephonyDisplayInfo: TelephonyDisplayInfo) {
                 // Populate the stingray security information.  <https://source.android.com/devices/tech/connect/acts-5g-testing>
                 if (telephonyDisplayInfo.networkType == TelephonyManager.NETWORK_TYPE_NR) {  // This is a secure 5G NR SA network.
@@ -342,6 +347,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)