Skip to content
Commit 30f12a30 authored by Cutter Coryell's avatar Cutter Coryell
Browse files

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
parent 37e94389
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