Add tracing for setEdgeBackPlugin
It seems this happens at every unfold, and still takes most of the taskbar initialization time due to `setLayoutParam` when the edge back plugin is set. This trace will make it more easily visible in traces. Bug: 219035565 Test: Checked perfetto traces for the new sections to be visible Change-Id: I74e793467eb37705b2647d0ea9c64bd7b5191d9e
This commit is contained in:
@@ -525,6 +525,15 @@ public class EdgeBackGestureHandler implements PluginListener<NavigationEdgeBack
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void updateIsEnabled() {
|
private void updateIsEnabled() {
|
||||||
|
try {
|
||||||
|
Trace.beginSection("EdgeBackGestureHandler#updateIsEnabled");
|
||||||
|
updateIsEnabledTraced();
|
||||||
|
} finally {
|
||||||
|
Trace.endSection();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updateIsEnabledTraced() {
|
||||||
boolean isEnabled = mIsAttached && mIsGesturalModeEnabled;
|
boolean isEnabled = mIsAttached && mIsGesturalModeEnabled;
|
||||||
if (isEnabled == mIsEnabled) {
|
if (isEnabled == mIsEnabled) {
|
||||||
return;
|
return;
|
||||||
@@ -611,14 +620,16 @@ public class EdgeBackGestureHandler implements PluginListener<NavigationEdgeBack
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void setEdgeBackPlugin(NavigationEdgeBackPlugin edgeBackPlugin) {
|
private void setEdgeBackPlugin(NavigationEdgeBackPlugin edgeBackPlugin) {
|
||||||
if (mEdgeBackPlugin != null) {
|
try {
|
||||||
mEdgeBackPlugin.onDestroy();
|
Trace.beginSection("setEdgeBackPlugin");
|
||||||
|
mEdgeBackPlugin = edgeBackPlugin;
|
||||||
|
mEdgeBackPlugin.setBackCallback(mBackCallback);
|
||||||
|
mEdgeBackPlugin.setMotionEventsHandler(mMotionEventsHandler);
|
||||||
|
mEdgeBackPlugin.setLayoutParams(createLayoutParams());
|
||||||
|
updateDisplaySize();
|
||||||
|
} finally {
|
||||||
|
Trace.endSection();
|
||||||
}
|
}
|
||||||
mEdgeBackPlugin = edgeBackPlugin;
|
|
||||||
mEdgeBackPlugin.setBackCallback(mBackCallback);
|
|
||||||
mEdgeBackPlugin.setMotionEventsHandler(mMotionEventsHandler);
|
|
||||||
mEdgeBackPlugin.setLayoutParams(createLayoutParams());
|
|
||||||
updateDisplaySize();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isHandlingGestures() {
|
public boolean isHandlingGestures() {
|
||||||
|
|||||||
Reference in New Issue
Block a user