adding the Record Audio permission

This commit is contained in:
tibbi 2020-03-28 18:42:07 +01:00
parent 5acc48f152
commit 0998a51878
2 changed files with 20 additions and 0 deletions

View File

@ -4,6 +4,8 @@
package="com.simplemobiletools.voicerecorder"
android:installLocation="auto">
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-feature
android:name="android.hardware.faketouch"
android:required="false" />

View File

@ -5,6 +5,8 @@ import android.os.Bundle
import android.view.Menu
import android.view.MenuItem
import com.simplemobiletools.commons.extensions.appLaunched
import com.simplemobiletools.commons.extensions.checkAppSideloading
import com.simplemobiletools.commons.helpers.PERMISSION_RECORD_AUDIO
import com.simplemobiletools.commons.models.FAQItem
import com.simplemobiletools.voicerecorder.BuildConfig
import com.simplemobiletools.voicerecorder.R
@ -14,6 +16,18 @@ class MainActivity : SimpleActivity() {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
appLaunched(BuildConfig.APPLICATION_ID)
if (checkAppSideloading()) {
return
}
handlePermission(PERMISSION_RECORD_AUDIO) {
if (it) {
initVoiceRecorder()
} else {
finish()
}
}
}
override fun onCreateOptionsMenu(menu: Menu): Boolean {
@ -30,6 +44,10 @@ class MainActivity : SimpleActivity() {
return true
}
private fun initVoiceRecorder() {
}
private fun launchSettings() {
startActivity(Intent(applicationContext, SettingsActivity::class.java))
}