Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bbe79d02 authored by Nicolò Mazzucato's avatar Nicolò Mazzucato Committed by Android (Google) Code Review
Browse files

Merge "Add traces to latency sensitive points"

parents ad7dd8fe 38067cc1
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@ import android.hardware.display.DisplayManager;
import android.os.Bundle;
import android.os.Handler;
import android.os.RemoteException;
import android.os.Trace;
import android.os.UserHandle;
import android.provider.Settings;
import android.util.Log;
@@ -215,9 +216,11 @@ public class NavigationBarController implements
    /** @return {@code true} if taskbar is enabled, false otherwise */
    private boolean initializeTaskbarIfNecessary() {
        if (mIsTablet) {
            Trace.beginSection("NavigationBarController#initializeTaskbarIfNecessary");
            // Remove navigation bar when taskbar is showing
            removeNavigationBar(mContext.getDisplayId());
            mTaskbarDelegate.init(mContext.getDisplayId());
            Trace.endSection();
        } else {
            mTaskbarDelegate.destroy();
        }
+4 −0
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@ import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.Icon;
import android.os.Parcelable;
import android.os.Trace;
import android.os.UserHandle;
import android.service.notification.StatusBarNotification;
import android.text.TextUtils;
@@ -371,10 +372,13 @@ public class StatusBarIconView extends AnimatedImageView implements StatusIconDi
        }
        Drawable drawable;
        try {
            Trace.beginSection("StatusBarIconView#updateDrawable()");
            drawable = getIcon(mIcon);
        } catch (OutOfMemoryError e) {
            Log.w(TAG, "OOM while inflating " + mIcon.icon + " for slot " + mSlot);
            return false;
        } finally {
            Trace.endSection();
        }

        if (drawable == null) {
+8 −0
Original line number Diff line number Diff line
@@ -1110,6 +1110,12 @@ public class StatusBar extends CoreStartable implements
    }

    private void onFoldedStateChanged(boolean isFolded, boolean willGoToSleep) {
        Trace.beginSection("StatusBar#onFoldedStateChanged");
        onFoldedStateChangedInternal(isFolded, willGoToSleep);
        Trace.endSection();
    }

    private void onFoldedStateChangedInternal(boolean isFolded, boolean willGoToSleep) {
        // Folded state changes are followed by a screen off event.
        // By default turning off the screen also closes the shade.
        // We want to make sure that the shade status is kept after
@@ -3672,6 +3678,7 @@ public class StatusBar extends CoreStartable implements

        @Override
        public void onScreenTurnedOff() {
            Trace.beginSection("StatusBar#onScreenTurnedOff");
            mFalsingCollector.onScreenOff();
            mScrimController.onScreenTurnedOff();
            if (mCloseQsBeforeScreenOff) {
@@ -3679,6 +3686,7 @@ public class StatusBar extends CoreStartable implements
                mCloseQsBeforeScreenOff = false;
            }
            updateIsKeyguard();
            Trace.endSection();
        }
    };

+10 −4
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import static android.provider.Settings.Secure.DEVICE_STATE_ROTATION_LOCK_LOCKED

import android.annotation.Nullable;
import android.hardware.devicestate.DeviceStateManager;
import android.os.Trace;
import android.util.Log;

import com.android.settingslib.devicestate.DeviceStateRotationLockSettingsManager;
@@ -117,11 +118,16 @@ public final class DeviceStateRotationLockSettingController

    private void updateDeviceState(int state) {
        Log.v(TAG, "updateDeviceState [state=" + state + "]");
        Trace.beginSection("updateDeviceState [state=" + state + "]");
        try {
            if (mDeviceState == state) {
                return;
            }

            readPersistedSetting(state);
        } finally {
            Trace.endSection();
        }
    }

    private void readPersistedSetting(int state) {
+4 −1
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import android.provider.Settings.Secure.CAMERA_AUTOROTATE
import com.android.internal.view.RotationPolicy
import com.android.internal.view.RotationPolicy.RotationPolicyListener
import com.android.systemui.util.settings.SecureSettings
import com.android.systemui.util.traceSection
import javax.inject.Inject

/**
@@ -44,8 +45,10 @@ class RotationPolicyWrapperImpl @Inject constructor(
        RotationPolicyWrapper {

    override fun setRotationLock(enabled: Boolean) {
        traceSection("RotationPolicyWrapperImpl#setRotationLock") {
            RotationPolicy.setRotationLock(context, enabled)
        }
    }

    override fun setRotationLockAtAngle(enabled: Boolean, rotation: Int) {
        RotationPolicy.setRotationLockAtAngle(context, enabled, rotation)