summaryrefslogtreecommitdiff
path: root/libs/androidfw/StringPool.cpp
diff options
context:
space:
mode:
author Cutter Coryell <coryell@google.com> 2022-12-07 12:07:10 -0800
committer Cutter Coryell <coryell@google.com> 2022-12-12 22:39:00 +0000
commit30f12a304257c59779e15a54afb8fea15df2aa97 (patch)
tree0afc7e00dffe52af0204a81ea441ff9fa1fe3ce1 /libs/androidfw/StringPool.cpp
parent37e943894d3e434543aa8fcfcf7df3154aa3c3d5 (diff)
Do not load/release back gesture ML model after every device fold/unfold.
Previously, the model's state was being updated every time mIsEnabled changed, causing either a resource load or resource release depending on the direction of the change. However, mIsEnabled changes every time EdgeBackGestureHandler attaches or detaches, which happens every time a foldable folds or unfolds. Releasing and reloading the model's resources every fold/unfold is needless and wasteful. Now, the model resources only load when the process starts or when the user enables Gesture Navigation mode. The model resources only get released when the user disabled Gesture Navigation mode. This change is safe because no new behavior is added. There is also an additional safety check added: now, if the model is currently loading, it will not be asked to predict. Fix: 214938229 Test: manual Change-Id: I6127b4a5acfa57e9faa0966d021bd951cf2d7bee
Diffstat (limited to 'libs/androidfw/StringPool.cpp')
0 files changed, 0 insertions, 0 deletions