-
Notifications
You must be signed in to change notification settings - Fork 352
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix crash with auto-connect and no permission #5492
Fix crash with auto-connect and no permission #5492
Conversation
DROID-533 Crash on auto-connect enabled when missing VPN permission on API 34
Secondary way to reproduce
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @Rawa)
android/tile/src/main/kotlin/net/mullvad/mullvadvpn/tile/MullvadTileService.kt
line 99 at r1 (raw file):
action = Intent.ACTION_MAIN } val pendingIntent =
This could be inside the if below since it is only use if it is Android 14 or below.
One other idea would be to add an extension function called startActivityAndCollapseSupport
or something.
Something like this:
Code snippet:
fun MullvadTileService.startActivityAndCollapseCompat(intent: Intent) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
val pendingIntent =
PendingIntent.getActivity(
applicationContext,
0,
intent,
SdkUtils.getSupportedPendingIntentFlags()
)
startActivityAndCollapse(pendingIntent)
} else {
startActivityAndCollapse(intent)
}
}
3d00000
to
157c2b0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 1 of 2 files reviewed, 1 unresolved discussion (waiting on @Pururun)
android/tile/src/main/kotlin/net/mullvad/mullvadvpn/tile/MullvadTileService.kt
line 99 at r1 (raw file):
Previously, Pururun (Jonatan Rhodin) wrote…
This could be inside the if below since it is only use if it is Android 14 or below.
One other idea would be to add an extension function calledstartActivityAndCollapseSupport
or something.
Something like this:
Nice suggestion, fixed now :)
157c2b0
to
111deb6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r3, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved
111deb6
to
e1bf8a4
Compare
This change is