whatawurst / android_device_sony_yoshino-common

This is the Android device configuration for the yoshino platform
10 stars 48 forks source link

OpenCS: Fix notification intent #94

Closed Flamefire closed 1 year ago

Flamefire commented 1 year ago

Readd FLAG_UPDATE_CURRENT

This was (IMO erroneously) removed in https://github.com/whatawurst/android_device_sony_yoshino-common/commit/27e84e34dfb04fa2045b557e0416bf5d1c78df1d

@shank03 Can you verify?

Flamefire commented 1 year ago

I found e.g. https://stackoverflow.com/questions/67045607/how-to-resolve-missing-pendingintent-mutability-flag-lint-warning-in-android-a which suggests that this is correct.

shank03 commented 1 year ago

I mentioned in the commit comment section why I completely replaced the flag.

I found e.g. https://stackoverflow.com/questions/67045607/how-to-resolve-missing-pendingintent-mutability-flag-lint-warning-in-android-a which suggests that this is correct.

Yes this should do it.

BTW, was it causing any issues ?

Flamefire commented 1 year ago

Ok moving the discussion here:

Not sure if there are issues as an Intent would need to exist so I guess this is difficult to catch. But to me it makes sense: You have a boolean for mutability and a boolean for "UPDATE_CURRENT" vs "CANCEL_CURRENT" so those 2 seem orthogonal.

Edit: Don't see any deprecation in the current sources but found this:

you can alternatively use the flags {@link #FLAG_CANCEL_CURRENT} or {@link #FLAG_UPDATE_CURRENT}

Edit2: Tested on 19.1 (don't have a 20.0 tree) where this worked without error or warning

shank03 commented 1 year ago

Working fine so we can merge it

@derfelot merge please :)

derfelot commented 1 year ago

nitpick: could you please adjust commit title to be either "yoshino-common: OpenCS:" or just "OpenCS:"?

Thanks

Flamefire commented 1 year ago

Done. Not a big fan of prefixing the repo name but "OpenCS" makes sense. I was to lazy. ;-)

derfelot commented 1 year ago

Thanks