mirror of
https://github.com/pachli/pachli-android.git
synced 2025-02-05 11:47:47 +01:00
fix: Check build version is >= T before POST_NOTIFICATIONS request (#76)
This commit is contained in:
parent
ffa8ea615b
commit
0f6975ffcc
@ -19,7 +19,7 @@
|
||||
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
|
||||
<location
|
||||
file="src/main/java/app/pachli/MainActivity.kt"
|
||||
line="986"
|
||||
line="983"
|
||||
column="42"/>
|
||||
</issue>
|
||||
|
||||
@ -30,21 +30,10 @@
|
||||
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
|
||||
<location
|
||||
file="src/main/java/app/pachli/MainActivity.kt"
|
||||
line="1021"
|
||||
line="1018"
|
||||
column="42"/>
|
||||
</issue>
|
||||
|
||||
<issue
|
||||
id="InlinedApi"
|
||||
message="Field requires API level 33 (current min is 23): `android.Manifest.permission#POST_NOTIFICATIONS`"
|
||||
errorLine1=" arrayOf(Manifest.permission.POST_NOTIFICATIONS),"
|
||||
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
|
||||
<location
|
||||
file="src/main/java/app/pachli/MainActivity.kt"
|
||||
line="365"
|
||||
column="25"/>
|
||||
</issue>
|
||||
|
||||
<issue
|
||||
id="InvalidPackage"
|
||||
message="Invalid package reference in org.bouncycastle:bcprov-jdk15on; not included in Android: `javax.naming.directory`. Referenced from `org.bouncycastle.jce.provider.CrlCache`.">
|
||||
@ -3006,7 +2995,7 @@
|
||||
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~">
|
||||
<location
|
||||
file="src/main/java/app/pachli/MainActivity.kt"
|
||||
line="240"
|
||||
line="241"
|
||||
column="37"/>
|
||||
</issue>
|
||||
|
||||
@ -3017,7 +3006,7 @@
|
||||
errorLine2=" ~~~~~~~~~~~~~">
|
||||
<location
|
||||
file="src/main/java/app/pachli/MainActivity.kt"
|
||||
line="244"
|
||||
line="245"
|
||||
column="37"/>
|
||||
</issue>
|
||||
|
||||
@ -3028,7 +3017,7 @@
|
||||
errorLine2=" ~~~~~~~">
|
||||
<location
|
||||
file="src/main/java/app/pachli/MainActivity.kt"
|
||||
line="348"
|
||||
line="349"
|
||||
column="25"/>
|
||||
</issue>
|
||||
|
||||
@ -3039,7 +3028,7 @@
|
||||
errorLine2=" ~~~~~~~">
|
||||
<location
|
||||
file="src/main/java/app/pachli/MainActivity.kt"
|
||||
line="349"
|
||||
line="350"
|
||||
column="29"/>
|
||||
</issue>
|
||||
|
||||
@ -3050,7 +3039,7 @@
|
||||
errorLine2=" ~~~~~~~">
|
||||
<location
|
||||
file="src/main/java/app/pachli/MainActivity.kt"
|
||||
line="351"
|
||||
line="352"
|
||||
column="25"/>
|
||||
</issue>
|
||||
|
||||
@ -3061,7 +3050,7 @@
|
||||
errorLine2=" ~~~~~~~">
|
||||
<location
|
||||
file="src/main/java/app/pachli/MainActivity.kt"
|
||||
line="352"
|
||||
line="353"
|
||||
column="29"/>
|
||||
</issue>
|
||||
|
||||
@ -3070,20 +3059,20 @@
|
||||
message="Access to `private` method `primaryDrawerItem` of class `MainActivityKt` requires synthetic accessor"
|
||||
errorLine1=" primaryDrawerItem {"
|
||||
errorLine2=" ~~~~~~~~~~~~~~~~~">
|
||||
<location
|
||||
file="src/main/java/app/pachli/MainActivity.kt"
|
||||
line="562"
|
||||
column="17"/>
|
||||
</issue>
|
||||
|
||||
<issue
|
||||
id="SyntheticAccessor"
|
||||
message="Access to `private` method `setOnClick` of class `MainActivityKt` requires synthetic accessor"
|
||||
errorLine1=" onClick = {"
|
||||
errorLine2=" ~~~~~~~">
|
||||
<location
|
||||
file="src/main/java/app/pachli/MainActivity.kt"
|
||||
line="565"
|
||||
column="17"/>
|
||||
</issue>
|
||||
|
||||
<issue
|
||||
id="SyntheticAccessor"
|
||||
message="Access to `private` method `setOnClick` of class `MainActivityKt` requires synthetic accessor"
|
||||
errorLine1=" onClick = {"
|
||||
errorLine2=" ~~~~~~~">
|
||||
<location
|
||||
file="src/main/java/app/pachli/MainActivity.kt"
|
||||
line="568"
|
||||
column="21"/>
|
||||
</issue>
|
||||
|
||||
@ -3094,7 +3083,7 @@
|
||||
errorLine2=" ~~~~~~~~~~~~~~~~~">
|
||||
<location
|
||||
file="src/main/java/app/pachli/MainActivity.kt"
|
||||
line="573"
|
||||
line="570"
|
||||
column="17"/>
|
||||
</issue>
|
||||
|
||||
@ -3105,7 +3094,7 @@
|
||||
errorLine2=" ~~~~~~~">
|
||||
<location
|
||||
file="src/main/java/app/pachli/MainActivity.kt"
|
||||
line="577"
|
||||
line="574"
|
||||
column="21"/>
|
||||
</issue>
|
||||
|
||||
@ -3114,20 +3103,20 @@
|
||||
message="Access to `private` method `primaryDrawerItem` of class `MainActivityKt` requires synthetic accessor"
|
||||
errorLine1=" primaryDrawerItem {"
|
||||
errorLine2=" ~~~~~~~~~~~~~~~~~">
|
||||
<location
|
||||
file="src/main/java/app/pachli/MainActivity.kt"
|
||||
line="579"
|
||||
column="17"/>
|
||||
</issue>
|
||||
|
||||
<issue
|
||||
id="SyntheticAccessor"
|
||||
message="Access to `private` method `setOnClick` of class `MainActivityKt` requires synthetic accessor"
|
||||
errorLine1=" onClick = {"
|
||||
errorLine2=" ~~~~~~~">
|
||||
<location
|
||||
file="src/main/java/app/pachli/MainActivity.kt"
|
||||
line="582"
|
||||
column="17"/>
|
||||
</issue>
|
||||
|
||||
<issue
|
||||
id="SyntheticAccessor"
|
||||
message="Access to `private` method `setOnClick` of class `MainActivityKt` requires synthetic accessor"
|
||||
errorLine1=" onClick = {"
|
||||
errorLine2=" ~~~~~~~">
|
||||
<location
|
||||
file="src/main/java/app/pachli/MainActivity.kt"
|
||||
line="585"
|
||||
column="21"/>
|
||||
</issue>
|
||||
|
||||
@ -3136,20 +3125,20 @@
|
||||
message="Access to `private` method `primaryDrawerItem` of class `MainActivityKt` requires synthetic accessor"
|
||||
errorLine1=" primaryDrawerItem {"
|
||||
errorLine2=" ~~~~~~~~~~~~~~~~~">
|
||||
<location
|
||||
file="src/main/java/app/pachli/MainActivity.kt"
|
||||
line="587"
|
||||
column="17"/>
|
||||
</issue>
|
||||
|
||||
<issue
|
||||
id="SyntheticAccessor"
|
||||
message="Access to `private` method `setOnClick` of class `MainActivityKt` requires synthetic accessor"
|
||||
errorLine1=" onClick = {"
|
||||
errorLine2=" ~~~~~~~">
|
||||
<location
|
||||
file="src/main/java/app/pachli/MainActivity.kt"
|
||||
line="590"
|
||||
column="17"/>
|
||||
</issue>
|
||||
|
||||
<issue
|
||||
id="SyntheticAccessor"
|
||||
message="Access to `private` method `setOnClick` of class `MainActivityKt` requires synthetic accessor"
|
||||
errorLine1=" onClick = {"
|
||||
errorLine2=" ~~~~~~~">
|
||||
<location
|
||||
file="src/main/java/app/pachli/MainActivity.kt"
|
||||
line="593"
|
||||
column="21"/>
|
||||
</issue>
|
||||
|
||||
@ -3158,20 +3147,20 @@
|
||||
message="Access to `private` method `primaryDrawerItem` of class `MainActivityKt` requires synthetic accessor"
|
||||
errorLine1=" primaryDrawerItem {"
|
||||
errorLine2=" ~~~~~~~~~~~~~~~~~">
|
||||
<location
|
||||
file="src/main/java/app/pachli/MainActivity.kt"
|
||||
line="595"
|
||||
column="17"/>
|
||||
</issue>
|
||||
|
||||
<issue
|
||||
id="SyntheticAccessor"
|
||||
message="Access to `private` method `setOnClick` of class `MainActivityKt` requires synthetic accessor"
|
||||
errorLine1=" onClick = {"
|
||||
errorLine2=" ~~~~~~~">
|
||||
<location
|
||||
file="src/main/java/app/pachli/MainActivity.kt"
|
||||
line="598"
|
||||
column="17"/>
|
||||
</issue>
|
||||
|
||||
<issue
|
||||
id="SyntheticAccessor"
|
||||
message="Access to `private` method `setOnClick` of class `MainActivityKt` requires synthetic accessor"
|
||||
errorLine1=" onClick = {"
|
||||
errorLine2=" ~~~~~~~">
|
||||
<location
|
||||
file="src/main/java/app/pachli/MainActivity.kt"
|
||||
line="601"
|
||||
column="21"/>
|
||||
</issue>
|
||||
|
||||
@ -3180,20 +3169,20 @@
|
||||
message="Access to `private` method `primaryDrawerItem` of class `MainActivityKt` requires synthetic accessor"
|
||||
errorLine1=" primaryDrawerItem {"
|
||||
errorLine2=" ~~~~~~~~~~~~~~~~~">
|
||||
<location
|
||||
file="src/main/java/app/pachli/MainActivity.kt"
|
||||
line="602"
|
||||
column="17"/>
|
||||
</issue>
|
||||
|
||||
<issue
|
||||
id="SyntheticAccessor"
|
||||
message="Access to `private` method `setOnClick` of class `MainActivityKt` requires synthetic accessor"
|
||||
errorLine1=" onClick = {"
|
||||
errorLine2=" ~~~~~~~">
|
||||
<location
|
||||
file="src/main/java/app/pachli/MainActivity.kt"
|
||||
line="605"
|
||||
column="17"/>
|
||||
</issue>
|
||||
|
||||
<issue
|
||||
id="SyntheticAccessor"
|
||||
message="Access to `private` method `setOnClick` of class `MainActivityKt` requires synthetic accessor"
|
||||
errorLine1=" onClick = {"
|
||||
errorLine2=" ~~~~~~~">
|
||||
<location
|
||||
file="src/main/java/app/pachli/MainActivity.kt"
|
||||
line="608"
|
||||
column="21"/>
|
||||
</issue>
|
||||
|
||||
@ -3202,20 +3191,20 @@
|
||||
message="Access to `private` method `primaryDrawerItem` of class `MainActivityKt` requires synthetic accessor"
|
||||
errorLine1=" primaryDrawerItem {"
|
||||
errorLine2=" ~~~~~~~~~~~~~~~~~">
|
||||
<location
|
||||
file="src/main/java/app/pachli/MainActivity.kt"
|
||||
line="610"
|
||||
column="17"/>
|
||||
</issue>
|
||||
|
||||
<issue
|
||||
id="SyntheticAccessor"
|
||||
message="Access to `private` method `setOnClick` of class `MainActivityKt` requires synthetic accessor"
|
||||
errorLine1=" onClick = {"
|
||||
errorLine2=" ~~~~~~~">
|
||||
<location
|
||||
file="src/main/java/app/pachli/MainActivity.kt"
|
||||
line="613"
|
||||
column="17"/>
|
||||
</issue>
|
||||
|
||||
<issue
|
||||
id="SyntheticAccessor"
|
||||
message="Access to `private` method `setOnClick` of class `MainActivityKt` requires synthetic accessor"
|
||||
errorLine1=" onClick = {"
|
||||
errorLine2=" ~~~~~~~">
|
||||
<location
|
||||
file="src/main/java/app/pachli/MainActivity.kt"
|
||||
line="616"
|
||||
column="21"/>
|
||||
</issue>
|
||||
|
||||
@ -3226,7 +3215,7 @@
|
||||
errorLine2=" ~~~~~~~~~~~~~~~~~">
|
||||
<location
|
||||
file="src/main/java/app/pachli/MainActivity.kt"
|
||||
line="620"
|
||||
line="617"
|
||||
column="17"/>
|
||||
</issue>
|
||||
|
||||
@ -3237,7 +3226,7 @@
|
||||
errorLine2=" ~~~~~~~">
|
||||
<location
|
||||
file="src/main/java/app/pachli/MainActivity.kt"
|
||||
line="624"
|
||||
line="621"
|
||||
column="21"/>
|
||||
</issue>
|
||||
|
||||
@ -3246,20 +3235,20 @@
|
||||
message="Access to `private` method `secondaryDrawerItem` of class `MainActivityKt` requires synthetic accessor"
|
||||
errorLine1=" secondaryDrawerItem {"
|
||||
errorLine2=" ~~~~~~~~~~~~~~~~~~~">
|
||||
<location
|
||||
file="src/main/java/app/pachli/MainActivity.kt"
|
||||
line="630"
|
||||
column="17"/>
|
||||
</issue>
|
||||
|
||||
<issue
|
||||
id="SyntheticAccessor"
|
||||
message="Access to `private` method `setOnClick` of class `MainActivityKt` requires synthetic accessor"
|
||||
errorLine1=" onClick = {"
|
||||
errorLine2=" ~~~~~~~">
|
||||
<location
|
||||
file="src/main/java/app/pachli/MainActivity.kt"
|
||||
line="633"
|
||||
column="17"/>
|
||||
</issue>
|
||||
|
||||
<issue
|
||||
id="SyntheticAccessor"
|
||||
message="Access to `private` method `setOnClick` of class `MainActivityKt` requires synthetic accessor"
|
||||
errorLine1=" onClick = {"
|
||||
errorLine2=" ~~~~~~~">
|
||||
<location
|
||||
file="src/main/java/app/pachli/MainActivity.kt"
|
||||
line="636"
|
||||
column="21"/>
|
||||
</issue>
|
||||
|
||||
@ -3268,20 +3257,20 @@
|
||||
message="Access to `private` method `secondaryDrawerItem` of class `MainActivityKt` requires synthetic accessor"
|
||||
errorLine1=" secondaryDrawerItem {"
|
||||
errorLine2=" ~~~~~~~~~~~~~~~~~~~">
|
||||
<location
|
||||
file="src/main/java/app/pachli/MainActivity.kt"
|
||||
line="638"
|
||||
column="17"/>
|
||||
</issue>
|
||||
|
||||
<issue
|
||||
id="SyntheticAccessor"
|
||||
message="Access to `private` method `setOnClick` of class `MainActivityKt` requires synthetic accessor"
|
||||
errorLine1=" onClick = {"
|
||||
errorLine2=" ~~~~~~~">
|
||||
<location
|
||||
file="src/main/java/app/pachli/MainActivity.kt"
|
||||
line="641"
|
||||
column="17"/>
|
||||
</issue>
|
||||
|
||||
<issue
|
||||
id="SyntheticAccessor"
|
||||
message="Access to `private` method `setOnClick` of class `MainActivityKt` requires synthetic accessor"
|
||||
errorLine1=" onClick = {"
|
||||
errorLine2=" ~~~~~~~">
|
||||
<location
|
||||
file="src/main/java/app/pachli/MainActivity.kt"
|
||||
line="644"
|
||||
column="21"/>
|
||||
</issue>
|
||||
|
||||
@ -3290,20 +3279,20 @@
|
||||
message="Access to `private` method `secondaryDrawerItem` of class `MainActivityKt` requires synthetic accessor"
|
||||
errorLine1=" secondaryDrawerItem {"
|
||||
errorLine2=" ~~~~~~~~~~~~~~~~~~~">
|
||||
<location
|
||||
file="src/main/java/app/pachli/MainActivity.kt"
|
||||
line="646"
|
||||
column="17"/>
|
||||
</issue>
|
||||
|
||||
<issue
|
||||
id="SyntheticAccessor"
|
||||
message="Access to `private` method `setOnClick` of class `MainActivityKt` requires synthetic accessor"
|
||||
errorLine1=" onClick = {"
|
||||
errorLine2=" ~~~~~~~">
|
||||
<location
|
||||
file="src/main/java/app/pachli/MainActivity.kt"
|
||||
line="649"
|
||||
column="17"/>
|
||||
</issue>
|
||||
|
||||
<issue
|
||||
id="SyntheticAccessor"
|
||||
message="Access to `private` method `setOnClick` of class `MainActivityKt` requires synthetic accessor"
|
||||
errorLine1=" onClick = {"
|
||||
errorLine2=" ~~~~~~~">
|
||||
<location
|
||||
file="src/main/java/app/pachli/MainActivity.kt"
|
||||
line="652"
|
||||
column="21"/>
|
||||
</issue>
|
||||
|
||||
@ -3314,7 +3303,7 @@
|
||||
errorLine2=" ~~~~~~~~~~~~~~~~~~~">
|
||||
<location
|
||||
file="src/main/java/app/pachli/MainActivity.kt"
|
||||
line="657"
|
||||
line="654"
|
||||
column="17"/>
|
||||
</issue>
|
||||
|
||||
@ -3325,7 +3314,7 @@
|
||||
errorLine2=" ~~~~~~~">
|
||||
<location
|
||||
file="src/main/java/app/pachli/MainActivity.kt"
|
||||
line="660"
|
||||
line="657"
|
||||
column="21"/>
|
||||
</issue>
|
||||
|
||||
@ -3336,7 +3325,7 @@
|
||||
errorLine2=" ~~~~~~~~~~~~~~~~~">
|
||||
<location
|
||||
file="src/main/java/app/pachli/MainActivity.kt"
|
||||
line="667"
|
||||
line="664"
|
||||
column="21"/>
|
||||
</issue>
|
||||
|
||||
@ -3347,7 +3336,7 @@
|
||||
errorLine2=" ~~~~~~~">
|
||||
<location
|
||||
file="src/main/java/app/pachli/MainActivity.kt"
|
||||
line="670"
|
||||
line="667"
|
||||
column="25"/>
|
||||
</issue>
|
||||
|
||||
@ -3358,7 +3347,7 @@
|
||||
errorLine2=" ~~~~~~~~~~~~~~~~~">
|
||||
<location
|
||||
file="src/main/java/app/pachli/MainActivity.kt"
|
||||
line="679"
|
||||
line="676"
|
||||
column="17"/>
|
||||
</issue>
|
||||
|
||||
@ -3369,7 +3358,7 @@
|
||||
errorLine2=" ~~~~~~~">
|
||||
<location
|
||||
file="src/main/java/app/pachli/MainActivity.kt"
|
||||
line="682"
|
||||
line="679"
|
||||
column="21"/>
|
||||
</issue>
|
||||
|
||||
@ -3380,7 +3369,7 @@
|
||||
errorLine2=" ~~~~~~~~~~~~~~~~~~~">
|
||||
<location
|
||||
file="src/main/java/app/pachli/MainActivity.kt"
|
||||
line="695"
|
||||
line="692"
|
||||
column="17"/>
|
||||
</issue>
|
||||
|
||||
@ -3391,7 +3380,7 @@
|
||||
errorLine2=" ~~~~~~~">
|
||||
<location
|
||||
file="src/main/java/app/pachli/MainActivity.kt"
|
||||
line="699"
|
||||
line="696"
|
||||
column="21"/>
|
||||
</issue>
|
||||
|
||||
@ -3402,7 +3391,7 @@
|
||||
errorLine2=" ~~~~~~~">
|
||||
<location
|
||||
file="src/main/java/app/pachli/MainActivity.kt"
|
||||
line="819"
|
||||
line="816"
|
||||
column="17"/>
|
||||
</issue>
|
||||
|
||||
@ -3413,7 +3402,7 @@
|
||||
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~">
|
||||
<location
|
||||
file="src/main/java/app/pachli/MainActivity.kt"
|
||||
line="821"
|
||||
line="818"
|
||||
column="17"/>
|
||||
</issue>
|
||||
|
||||
@ -3424,7 +3413,7 @@
|
||||
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~">
|
||||
<location
|
||||
file="src/main/java/app/pachli/MainActivity.kt"
|
||||
line="832"
|
||||
line="829"
|
||||
column="17"/>
|
||||
</issue>
|
||||
|
||||
|
@ -17,20 +17,22 @@
|
||||
|
||||
package app.pachli
|
||||
|
||||
import android.Manifest
|
||||
import android.Manifest.permission.POST_NOTIFICATIONS
|
||||
import android.annotation.SuppressLint
|
||||
import android.app.NotificationManager
|
||||
import android.content.Context
|
||||
import android.content.DialogInterface
|
||||
import android.content.Intent
|
||||
import android.content.SharedPreferences
|
||||
import android.content.pm.PackageManager
|
||||
import android.content.pm.PackageManager.PERMISSION_GRANTED
|
||||
import android.graphics.Bitmap
|
||||
import android.graphics.Color
|
||||
import android.graphics.drawable.Animatable
|
||||
import android.graphics.drawable.BitmapDrawable
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.net.Uri
|
||||
import android.os.Build
|
||||
import android.os.Build.VERSION_CODES.TIRAMISU
|
||||
import android.os.Bundle
|
||||
import android.text.TextUtils
|
||||
import android.util.Log
|
||||
@ -46,7 +48,6 @@ import androidx.appcompat.app.AlertDialog
|
||||
import androidx.appcompat.content.res.AppCompatResources
|
||||
import androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||
import androidx.core.app.ActivityCompat
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.content.IntentCompat
|
||||
import androidx.core.content.pm.ShortcutManagerCompat
|
||||
import androidx.core.content.res.ResourcesCompat
|
||||
@ -359,12 +360,8 @@ class MainActivity : BottomSheetActivity(), ActionButtonActivity, HasAndroidInje
|
||||
},
|
||||
)
|
||||
|
||||
if (ContextCompat.checkSelfPermission(this, Manifest.permission.POST_NOTIFICATIONS) != PackageManager.PERMISSION_GRANTED) {
|
||||
ActivityCompat.requestPermissions(
|
||||
this,
|
||||
arrayOf(Manifest.permission.POST_NOTIFICATIONS),
|
||||
1,
|
||||
)
|
||||
if (Build.VERSION.SDK_INT >= TIRAMISU && ActivityCompat.checkSelfPermission(this, POST_NOTIFICATIONS) != PERMISSION_GRANTED) {
|
||||
ActivityCompat.requestPermissions(this, arrayOf(POST_NOTIFICATIONS), 1)
|
||||
}
|
||||
|
||||
// "Post failed" dialog should display in this activity
|
||||
|
Loading…
x
Reference in New Issue
Block a user