Add traces to BackGestureTFClassifier#loadVocab

This seems to take a lot of time, and we think it happens more often than needed. With those traces we will be able to easily spot it in perfetto recordings.

Bug: 197515205
Test: Manual
Change-Id: Iaa3d14ebf789d7d2082de121e58ca443fc4122c1
This commit is contained in:
Nicolo' Mazzucato
2022-01-20 20:47:08 +01:00
parent 2fb732321f
commit f227a2c9a1

View File

@@ -36,6 +36,7 @@ import android.os.Looper;
import android.os.RemoteException;
import android.os.SystemClock;
import android.os.SystemProperties;
import android.os.Trace;
import android.provider.DeviceConfig;
import android.util.DisplayMetrics;
import android.util.Log;
@@ -576,7 +577,9 @@ public class EdgeBackGestureHandler extends CurrentUserTracker
mMLModelThreshold = DeviceConfig.getFloat(DeviceConfig.NAMESPACE_SYSTEMUI,
SystemUiDeviceConfigFlags.BACK_GESTURE_ML_MODEL_THRESHOLD, 0.9f);
if (mBackGestureTfClassifierProvider.isActive()) {
Trace.beginSection("EdgeBackGestureHandler#loadVocab");
mVocab = mBackGestureTfClassifierProvider.loadVocab(mContext.getAssets());
Trace.endSection();
mUseMLModel = true;
return;
}