From 23ff8e9b8bba0f0694805c2234465db3e0106fc6 Mon Sep 17 00:00:00 2001 From: Levin Li Date: Sat, 17 Oct 2020 20:00:36 +0800 Subject: [PATCH] Bump version and remove permission check since we don't need --- app/src/main/AndroidManifest.xml | 3 +- .../celestia/mobilecelestia/MainActivity.kt | 50 +++++-------------- 2 files changed, 14 insertions(+), 39 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 485ad985..000922a2 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -14,11 +14,10 @@ xmlns:tools="http://schemas.android.com/tools" package="space.celestia.mobilecelestia" android:versionCode="70" - android:versionName="1.0.4"> + android:versionName="1.0.5"> - , - grantResults: IntArray - ) { - if (requestCode != WRITE_DATA_PERMISSION_REQUEST_CODE) return - // We do not care whether we got the permission here, just post notification - permissionCountDownLatch.countDown() - } - private fun hideSystemUI() { // Enables sticky immersive mode. window.decorView.systemUiVisibility = (View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY @@ -399,18 +389,9 @@ class MainActivity : AppCompatActivity(R.layout.activity_main), } } - private fun createPermissionObservable(): Observable { + private fun createCreateExtraFolderObservable(): Observable { return Observable.create { - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { - it.onComplete() - return@create - } - if (ContextCompat.checkSelfPermission(this, android.Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED) { - it.onComplete() - return@create - } - ActivityCompat.requestPermissions(this, arrayOf(android.Manifest.permission.WRITE_EXTERNAL_STORAGE), WRITE_DATA_PERMISSION_REQUEST_CODE) - permissionCountDownLatch.await() + createAddonFolder() it.onComplete() } } @@ -1072,10 +1053,6 @@ class MainActivity : AppCompatActivity(R.layout.activity_main), } override fun onDataLocationRequested(dataType: DataType) { - if (ContextCompat.checkSelfPermission(this, android.Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) { - // No permission to read - return - } when (dataType) { DataType.Config -> { val intent = Intent(Intent.ACTION_OPEN_DOCUMENT) @@ -1422,7 +1399,8 @@ class MainActivity : AppCompatActivity(R.layout.activity_main), } companion object { - private const val CURRENT_DATA_VERSION = "14" + private const val CURRENT_DATA_VERSION = "15" + // 15: 1.0.5 // 14: 1.0.4 // 13: 1.0.3 // 12: 1.0.2 @@ -1443,8 +1421,6 @@ class MainActivity : AppCompatActivity(R.layout.activity_main), private var firstInstance = true - private const val WRITE_DATA_PERMISSION_REQUEST_CODE = 33 - var customDataDirPath: String? = null var customConfigFilePath: String? = null