Migrate to ktx API
This commit is contained in:
@@ -14,7 +14,6 @@ import android.provider.Settings
|
||||
import android.view.View
|
||||
import android.widget.Toast
|
||||
import androidx.core.content.getSystemService
|
||||
import androidx.core.os.bundleOf
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import be.mygod.vpnhotspot.App.Companion.app
|
||||
import be.mygod.vpnhotspot.LocalOnlyHotspotService
|
||||
@@ -61,7 +60,7 @@ class LocalOnlyHotspotManager(private val parent: TetheringFragment) : Manager()
|
||||
context.startActivity(Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS))
|
||||
Toast.makeText(context, R.string.tethering_temp_hotspot_location, Toast.LENGTH_LONG).show()
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
app.logEvent("location_settings", bundleOf("message" to e.message))
|
||||
app.logEvent("location_settings") { param("message", e.message.toString()) }
|
||||
SmartSnackbar.make(R.string.tethering_temp_hotspot_location).show()
|
||||
}
|
||||
return
|
||||
|
||||
@@ -37,9 +37,12 @@ object ManageBar : Manager() {
|
||||
} catch (e1: RuntimeException) {
|
||||
try {
|
||||
context.startActivity(Intent().setClassName(SETTINGS_PACKAGE, SETTINGS_2))
|
||||
app.logEvent(TAG, bundleOf(SETTINGS_1 to e1.message))
|
||||
app.logEvent(TAG) { param(SETTINGS_1, e1.message.toString()) }
|
||||
} catch (e2: RuntimeException) {
|
||||
app.logEvent(TAG, bundleOf(SETTINGS_1 to e1.message, SETTINGS_2 to e2.message))
|
||||
app.logEvent(TAG) {
|
||||
param(SETTINGS_1, e1.message.toString())
|
||||
param(SETTINGS_2, e2.message.toString())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ sealed class TetherManager(protected val parent: TetheringFragment) : Manager(),
|
||||
"package:${mainActivity.packageName}".toUri()))
|
||||
return
|
||||
} catch (e: RuntimeException) {
|
||||
app.logEvent("manage_write_settings", bundleOf("message" to e.message))
|
||||
app.logEvent("manage_write_settings") { param("message", e.message.toString()) }
|
||||
}
|
||||
val started = manager.isStarted
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user