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 Merged-In: I74e793467eb37705b2647d0ea9c64bd7b5191d9e
This commit is contained in:
committed by
Nicolò Mazzucato
parent
9758d71bd9
commit
bbfe111a14
@@ -502,6 +502,15 @@ public class EdgeBackGestureHandler implements PluginListener<NavigationEdgeBack
|
||||
}
|
||||
|
||||
private void updateIsEnabled() {
|
||||
try {
|
||||
Trace.beginSection("EdgeBackGestureHandler#updateIsEnabled");
|
||||
updateIsEnabledTraced();
|
||||
} finally {
|
||||
Trace.endSection();
|
||||
}
|
||||
}
|
||||
|
||||
private void updateIsEnabledTraced() {
|
||||
boolean isEnabled = mIsAttached && mIsGesturalModeEnabled;
|
||||
if (isEnabled == mIsEnabled) {
|
||||
return;
|
||||
@@ -587,13 +596,18 @@ public class EdgeBackGestureHandler implements PluginListener<NavigationEdgeBack
|
||||
}
|
||||
|
||||
private void setEdgeBackPlugin(NavigationEdgeBackPlugin edgeBackPlugin) {
|
||||
if (mEdgeBackPlugin != null) {
|
||||
mEdgeBackPlugin.onDestroy();
|
||||
try {
|
||||
Trace.beginSection("setEdgeBackPlugin");
|
||||
if (mEdgeBackPlugin != null) {
|
||||
mEdgeBackPlugin.onDestroy();
|
||||
}
|
||||
mEdgeBackPlugin = edgeBackPlugin;
|
||||
mEdgeBackPlugin.setBackCallback(mBackCallback);
|
||||
mEdgeBackPlugin.setLayoutParams(createLayoutParams());
|
||||
updateDisplaySize();
|
||||
} finally {
|
||||
Trace.endSection();
|
||||
}
|
||||
mEdgeBackPlugin = edgeBackPlugin;
|
||||
mEdgeBackPlugin.setBackCallback(mBackCallback);
|
||||
mEdgeBackPlugin.setLayoutParams(createLayoutParams());
|
||||
updateDisplaySize();
|
||||
}
|
||||
|
||||
public boolean isHandlingGestures() {
|
||||
|
||||
Reference in New Issue
Block a user