/*
- * 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
// 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.
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)