Skip to content

Commit

Permalink
fix: workaround on android permission policy updates
Browse files Browse the repository at this point in the history
  • Loading branch information
xslingcn committed Jun 20, 2022
1 parent 148b51a commit 4d324b5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ android {
minSdkVersion 23
targetSdkVersion 32
versionCode 48
versionName "v2.0.30"
versionName "v2.0.31"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down
7 changes: 5 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission-group.CAMERA" />
<uses-permission android:name="android.permission-group.STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />


<uses-feature
Expand All @@ -43,6 +45,7 @@
android:fullBackupContent="@xml/backup_descriptor"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:requestLegacyExternalStorage="true"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/DawnTheme"
Expand All @@ -53,8 +56,8 @@

<activity
android:name=".screens.MainActivity"
android:launchMode="singleTask"
android:exported="true">
android:exported="true"
android:launchMode="singleTask">

<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,7 @@ class PostPopup(private val caller: MainActivity, private val sharedVM: SharedVi
}


// TODO: follow new storage permission policy(use MediaStore)
findViewById<Button>(R.id.postImage).setOnClickListener {
if (!caller.intentsHelper.checkAndRequestSinglePermission(
caller, permission.READ_EXTERNAL_STORAGE, true
Expand Down

0 comments on commit 4d324b5

Please # to comment.