Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 07075292 authored by Fabián Kozynski's avatar Fabián Kozynski
Browse files

Prevent infinite appending default in retail mode

When in reatil mode, we restrict the tiles that are shown to a small
set. However, that set is the same size as the minimum number of tiles.
If any of those tiles cannot be created (for example, flashlight in
large devices), we end up with less tiles than the minimum, which will
trigger a `prependDefault`. However, as the CurrentTilesInteractor only
sees the retail tiles, this will keep happening and the tiles in
Settings will grow unbounded, crashing the device. We fix this at
a handful of points:

* When applying a change to the tiles, apply `distinct` so that only the
  first copy of each tile is saved.
* Prevent TileSpecRepository from applying prependDefault when in
  retailMode (same as other tile operations).
* When in retail mode, the min number of tiles in the
  CurrentTilesInteractor is reduced to 1.

Test: atest com.android.systemui.qs.pipeline
Fixes: 340450011
Flag: EXEMPT Bug Fix
Change-Id: I8771f0a8ae8b88e5d3600b35ee96901fc46cbc53
parent 2b3fd07b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment