Merge "Annotate state changes on traces" into sc-v2-dev
This commit is contained in:
@@ -28,6 +28,7 @@ import android.animation.AnimatorListenerAdapter;
|
|||||||
import android.animation.ObjectAnimator;
|
import android.animation.ObjectAnimator;
|
||||||
import android.animation.ValueAnimator;
|
import android.animation.ValueAnimator;
|
||||||
import android.os.SystemProperties;
|
import android.os.SystemProperties;
|
||||||
|
import android.os.Trace;
|
||||||
import android.text.format.DateFormat;
|
import android.text.format.DateFormat;
|
||||||
import android.util.FloatProperty;
|
import android.util.FloatProperty;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
@@ -181,6 +182,7 @@ public class StatusBarStateControllerImpl implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
synchronized (mListeners) {
|
synchronized (mListeners) {
|
||||||
|
Trace.beginSection(TAG + "#setState(" + StatusBarState.toShortString(state) + ")");
|
||||||
String tag = getClass().getSimpleName() + "#setState(" + state + ")";
|
String tag = getClass().getSimpleName() + "#setState(" + state + ")";
|
||||||
DejankUtils.startDetectingBlockingIpcs(tag);
|
DejankUtils.startDetectingBlockingIpcs(tag);
|
||||||
for (RankedListener rl : new ArrayList<>(mListeners)) {
|
for (RankedListener rl : new ArrayList<>(mListeners)) {
|
||||||
@@ -198,6 +200,7 @@ public class StatusBarStateControllerImpl implements
|
|||||||
rl.mListener.onStatePostChange();
|
rl.mListener.onStatePostChange();
|
||||||
}
|
}
|
||||||
DejankUtils.stopDetectingBlockingIpcs(tag);
|
DejankUtils.stopDetectingBlockingIpcs(tag);
|
||||||
|
Trace.endSection();
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -262,12 +265,14 @@ public class StatusBarStateControllerImpl implements
|
|||||||
mIsDozing = isDozing;
|
mIsDozing = isDozing;
|
||||||
|
|
||||||
synchronized (mListeners) {
|
synchronized (mListeners) {
|
||||||
|
Trace.beginSection(TAG + "#setDozing(" + isDozing + ")");
|
||||||
String tag = getClass().getSimpleName() + "#setIsDozing";
|
String tag = getClass().getSimpleName() + "#setIsDozing";
|
||||||
DejankUtils.startDetectingBlockingIpcs(tag);
|
DejankUtils.startDetectingBlockingIpcs(tag);
|
||||||
for (RankedListener rl : new ArrayList<>(mListeners)) {
|
for (RankedListener rl : new ArrayList<>(mListeners)) {
|
||||||
rl.mListener.onDozingChanged(isDozing);
|
rl.mListener.onDozingChanged(isDozing);
|
||||||
}
|
}
|
||||||
DejankUtils.stopDetectingBlockingIpcs(tag);
|
DejankUtils.stopDetectingBlockingIpcs(tag);
|
||||||
|
Trace.endSection();
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -333,12 +338,14 @@ public class StatusBarStateControllerImpl implements
|
|||||||
mDozeAmount = dozeAmount;
|
mDozeAmount = dozeAmount;
|
||||||
float interpolatedAmount = mDozeInterpolator.getInterpolation(dozeAmount);
|
float interpolatedAmount = mDozeInterpolator.getInterpolation(dozeAmount);
|
||||||
synchronized (mListeners) {
|
synchronized (mListeners) {
|
||||||
|
Trace.beginSection(TAG + "#setDozeAmount");
|
||||||
String tag = getClass().getSimpleName() + "#setDozeAmount";
|
String tag = getClass().getSimpleName() + "#setDozeAmount";
|
||||||
DejankUtils.startDetectingBlockingIpcs(tag);
|
DejankUtils.startDetectingBlockingIpcs(tag);
|
||||||
for (RankedListener rl : new ArrayList<>(mListeners)) {
|
for (RankedListener rl : new ArrayList<>(mListeners)) {
|
||||||
rl.mListener.onDozeAmountChanged(mDozeAmount, interpolatedAmount);
|
rl.mListener.onDozeAmountChanged(mDozeAmount, interpolatedAmount);
|
||||||
}
|
}
|
||||||
DejankUtils.stopDetectingBlockingIpcs(tag);
|
DejankUtils.stopDetectingBlockingIpcs(tag);
|
||||||
|
Trace.endSection();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -469,11 +476,13 @@ public class StatusBarStateControllerImpl implements
|
|||||||
public void setPulsing(boolean pulsing) {
|
public void setPulsing(boolean pulsing) {
|
||||||
if (mPulsing != pulsing) {
|
if (mPulsing != pulsing) {
|
||||||
mPulsing = pulsing;
|
mPulsing = pulsing;
|
||||||
|
Trace.beginSection(TAG + "#setPulsing(" + pulsing + ")");
|
||||||
synchronized (mListeners) {
|
synchronized (mListeners) {
|
||||||
for (RankedListener rl : new ArrayList<>(mListeners)) {
|
for (RankedListener rl : new ArrayList<>(mListeners)) {
|
||||||
rl.mListener.onPulsingChanged(pulsing);
|
rl.mListener.onPulsingChanged(pulsing);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Trace.endSection();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user