Obsolete
Status Update
Comments
ra...@google.com <ra...@google.com> #2
We have shared this with our product and engineering team and will update this issue with more information as it becomes available.
el...@gmail.com <el...@gmail.com> #3
This bug has been fixed in Android 14, if the user allows "display over other apps". When the widget toggle is pressed, Android will ask the user to give Wireguard that permission, so it's an easy process.
el...@gmail.com <el...@gmail.com> #4
I bought a pixel 9 pro xl and the bug is still happening, although on my pixel 7 it was not happening.
Both of my phones use the latest Android version available.
Both of my phones use the latest Android version available.
Description
My app has a
TileService
, and the quick tiles are used for toggling on and offVpnService
s. For that, I have code like this:Basically, I try to start the service in the usual way, but if that fails because the app is backgrounded, then I start a transparent activity to start the service for me. This has worked well for some time. The result is that the quick tile toggles on or off, the same way that toggling on and off bluetooth or airplane mode or the flashlight works. Most importantly, the quick settings panel does not collapse, since it's a toggle switch.
In Android 14, this stopped working, because of this code in TileLifecycleManager.java:
As you can see,
BIND_ALLOW_BACKGROUND_ACTIVITY_STARTS
is no longer passed to the service when theSTART_ACTIVITY_NEEDS_PENDING_INTENT
change flag is enabled, which it is for API 34 and up.Note that using
startActivityAndCollapse()
isn't a viable option, because that collapses the quick settings panel. The whole idea is for this to function like any other quick settings tile toggle switch and not collapse, which is how it's worked for years.I believe this is largely a mistake. The documentation for this change states:
Yet, with this change, that doc is no longer honored, as
startActivity
now fails in API 34, despite there being aTileService
bound by the system, exactly as the doc described.This further seemed to be a last minute mistake made, as the isn't listed on the Android 14 compatibility flag page . It looks like maybe the initial goal was to enforce the deprecation of
START_ACTIVITY_NEEDS_PENDING_INTENT
compat flag actuallystartActivityAndCollapse(Intent intent)
, taking anIntent
rather than aPendingIntent
as in the new API, but overall change has the likely unintended side effect of also removing the ability to start an activity without collapsing the quick settings panel.So, this seems to be a bug that can hopefully be rectified during the Android 14 cycle ASAP.