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

Commit cd686b5b authored by John Spurlock's avatar John Spurlock
Browse files

Migrate systemui Slog calls to Log

Change-Id: Ib6734c85960f06fed646599565b8eeba26b9e98e
parent c9083f1a
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@ import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.provider.Settings;
import android.util.Slog;
import android.util.Log;

/**
 * Performs a number of miscellaneous, non-system-critical actions
@@ -40,7 +40,7 @@ public class BootReceiver extends BroadcastReceiver {
                context.startService(loadavg);
            }
        } catch (Exception e) {
            Slog.e(TAG, "Can't start load average service", e);
            Log.e(TAG, "Can't start load average service", e);
        }
    }
}
+32 −32
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@ import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.content.Context;
import android.os.Vibrator;
import android.util.Slog;
import android.util.Log;
import android.view.Gravity;
import android.view.MotionEvent;
import android.view.ScaleGestureDetector;
@@ -113,7 +113,7 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener {
            = new ScaleGestureDetector.SimpleOnScaleGestureListener() {
        @Override
        public boolean onScaleBegin(ScaleGestureDetector detector) {
            if (DEBUG_SCALE) Slog.v(TAG, "onscalebegin()");
            if (DEBUG_SCALE) Log.v(TAG, "onscalebegin()");
            float focusX = detector.getFocusX();
            float focusY = detector.getFocusY();

@@ -126,7 +126,7 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener {

        @Override
        public boolean onScale(ScaleGestureDetector detector) {
            if (DEBUG_SCALE) Slog.v(TAG, "onscale() on " + mCurrView);
            if (DEBUG_SCALE) Log.v(TAG, "onscale() on " + mCurrView);
            return true;
        }

@@ -143,7 +143,7 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener {
            mView = v;
        }
        public void setHeight(float h) {
            if (DEBUG_SCALE) Slog.v(TAG, "SetHeight: setting to " + h);
            if (DEBUG_SCALE) Log.v(TAG, "SetHeight: setting to " + h);
            ViewGroup.LayoutParams lp = mView.getLayoutParams();
            lp.height = (int)h;
            mView.setLayoutParams(lp);
@@ -158,7 +158,7 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener {
        }
        public int getNaturalHeight(int maximum) {
            ViewGroup.LayoutParams lp = mView.getLayoutParams();
            if (DEBUG_SCALE) Slog.v(TAG, "Inspecting a child of type: " +
            if (DEBUG_SCALE) Log.v(TAG, "Inspecting a child of type: " +
                    mView.getClass().getName());
            int oldHeight = lp.height;
            lp.height = ViewGroup.LayoutParams.WRAP_CONTENT;
@@ -230,7 +230,7 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener {
    }

    private void updateExpansion() {
        if (DEBUG_SCALE) Slog.v(TAG, "updateExpansion()");
        if (DEBUG_SCALE) Log.v(TAG, "updateExpansion()");
        // are we scaling or dragging?
        float span = mSGD.getCurrentSpan() - mInitialTouchSpan;
        span *= USE_SPAN ? 1f : 0f;
@@ -270,10 +270,10 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener {
    }

    private boolean isInside(View v, float x, float y) {
        if (DEBUG) Slog.d(TAG, "isinside (" + x + ", " + y + ")");
        if (DEBUG) Log.d(TAG, "isinside (" + x + ", " + y + ")");

        if (v == null) {
            if (DEBUG) Slog.d(TAG, "isinside null subject");
            if (DEBUG) Log.d(TAG, "isinside null subject");
            return false;
        }
        if (mEventSource != null) {
@@ -281,14 +281,14 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener {
            mEventSource.getLocationOnScreen(location);
            x += location[0];
            y += location[1];
            if (DEBUG) Slog.d(TAG, "  to global (" + x + ", " + y + ")");
            if (DEBUG) Log.d(TAG, "  to global (" + x + ", " + y + ")");
        }
        int[] location = new int[2];
        v.getLocationOnScreen(location);
        x -= location[0];
        y -= location[1];
        if (DEBUG) Slog.d(TAG, "  to local (" + x + ", " + y + ")");
        if (DEBUG) Slog.d(TAG, "  inside (" + v.getWidth() + ", " + v.getHeight() + ")");
        if (DEBUG) Log.d(TAG, "  to local (" + x + ", " + y + ")");
        if (DEBUG) Log.d(TAG, "  inside (" + v.getWidth() + ", " + v.getHeight() + ")");
        boolean inside = (x > 0f && y > 0f && x < v.getWidth() & y < v.getHeight());
        return inside;
    }
@@ -307,10 +307,10 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener {

    private float calculateGlow(float target, float actual) {
        // glow if overscale
        if (DEBUG_GLOW) Slog.d(TAG, "target: " + target + " actual: " + actual);
        if (DEBUG_GLOW) Log.d(TAG, "target: " + target + " actual: " + actual);
        float stretch = Math.abs((target - actual) / mMaximumStretch);
        float strength = 1f / (1f + (float) Math.pow(Math.E, -1 * ((8f * stretch) - 5f)));
        if (DEBUG_GLOW) Slog.d(TAG, "stretch: " + stretch + " strength: " + strength);
        if (DEBUG_GLOW) Log.d(TAG, "stretch: " + stretch + " strength: " + strength);
        return (GLOW_BASE + strength * (1f - GLOW_BASE));
    }

@@ -348,7 +348,7 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener {
    @Override
    public boolean onInterceptTouchEvent(MotionEvent ev) {
        final int action = ev.getAction();
        if (DEBUG_SCALE) Slog.d(TAG, "intercept: act=" + MotionEvent.actionToString(action) +
        if (DEBUG_SCALE) Log.d(TAG, "intercept: act=" + MotionEvent.actionToString(action) +
                         " expanding=" + mExpanding +
                         (0 != (mExpansionStyle & BLINDS) ? " (blinds)" : "") +
                         (0 != (mExpansionStyle & PULL) ? " (pull)" : "") +
@@ -362,7 +362,7 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener {
        mInitialTouchSpan = mSGD.getCurrentSpan();
        mLastFocusY = mInitialTouchFocusY;
        mLastSpanY = mInitialTouchSpan;
        if (DEBUG_SCALE) Slog.d(TAG, "set initial span: " + mInitialTouchSpan);
        if (DEBUG_SCALE) Log.d(TAG, "set initial span: " + mInitialTouchSpan);

        if (mExpanding) {
            return true;
@@ -376,7 +376,7 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener {
                    xspan > mPullGestureMinXSpan &&
                    xspan > mSGD.getCurrentSpanY())) {
                // detect a vertical pulling gesture with fingers somewhat separated
                if (DEBUG_SCALE) Slog.v(TAG, "got pull gesture (xspan=" + xspan + "px)");
                if (DEBUG_SCALE) Log.v(TAG, "got pull gesture (xspan=" + xspan + "px)");

                final View underFocus = findView(x, y);
                if (underFocus != null) {
@@ -393,7 +393,7 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener {
                if (mWatchingForPull) {
                    final int yDiff = y - mLastMotionY;
                    if (yDiff > mTouchSlop) {
                        if (DEBUG) Slog.v(TAG, "got venetian gesture (dy=" + yDiff + "px)");
                        if (DEBUG) Log.v(TAG, "got venetian gesture (dy=" + yDiff + "px)");
                        mLastMotionY = y;
                        final View underFocus = findView(x, y);
                        if (underFocus != null) {
@@ -413,7 +413,7 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener {

            case MotionEvent.ACTION_CANCEL:
            case MotionEvent.ACTION_UP:
                if (DEBUG) Slog.d(TAG, "up/cancel");
                if (DEBUG) Log.d(TAG, "up/cancel");
                finishExpanding(false);
                clearView();
                break;
@@ -425,7 +425,7 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener {
    @Override
    public boolean onTouchEvent(MotionEvent ev) {
        final int action = ev.getActionMasked();
        if (DEBUG_SCALE) Slog.d(TAG, "touch: act=" + MotionEvent.actionToString(action) +
        if (DEBUG_SCALE) Log.d(TAG, "touch: act=" + MotionEvent.actionToString(action) +
                " expanding=" + mExpanding +
                (0 != (mExpansionStyle & BLINDS) ? " (blinds)" : "") +
                (0 != (mExpansionStyle & PULL) ? " (pull)" : "") +
@@ -484,14 +484,14 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener {

            case MotionEvent.ACTION_POINTER_UP:
            case MotionEvent.ACTION_POINTER_DOWN:
                if (DEBUG) Slog.d(TAG, "pointer change");
                if (DEBUG) Log.d(TAG, "pointer change");
                mInitialTouchY += mSGD.getFocusY() - mLastFocusY;
                mInitialTouchSpan += mSGD.getCurrentSpan() - mLastSpanY;
                break;

            case MotionEvent.ACTION_UP:
            case MotionEvent.ACTION_CANCEL:
                if (DEBUG) Slog.d(TAG, "up/cancel");
                if (DEBUG) Log.d(TAG, "up/cancel");
                finishExpanding(false);
                clearView();
                break;
@@ -505,20 +505,20 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener {
            return;
        }
        mExpanding = true;
        if (DEBUG) Slog.d(TAG, "scale type " + expandType + " beginning on view: " + v);
        if (DEBUG) Log.d(TAG, "scale type " + expandType + " beginning on view: " + v);
        mCallback.setUserLockedChild(v, true);
        setView(v);
        setGlow(GLOW_BASE);
        mScaler.setView(v);
        mOldHeight = mScaler.getHeight();
        if (mCallback.canChildBeExpanded(v)) {
            if (DEBUG) Slog.d(TAG, "working on an expandable child");
            if (DEBUG) Log.d(TAG, "working on an expandable child");
            mNaturalHeight = mScaler.getNaturalHeight(mLargeSize);
        } else {
            if (DEBUG) Slog.d(TAG, "working on a non-expandable child");
            if (DEBUG) Log.d(TAG, "working on a non-expandable child");
            mNaturalHeight = mOldHeight;
        }
        if (DEBUG) Slog.d(TAG, "got mOldHeight: " + mOldHeight +
        if (DEBUG) Log.d(TAG, "got mOldHeight: " + mOldHeight +
                    " mNaturalHeight: " + mNaturalHeight);
        v.getParent().requestDisallowInterceptTouchEvent(true);
    }
@@ -526,7 +526,7 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener {
    private void finishExpanding(boolean force) {
        if (!mExpanding) return;

        if (DEBUG) Slog.d(TAG, "scale in finishing on view: " + mCurrView);
        if (DEBUG) Log.d(TAG, "scale in finishing on view: " + mCurrView);

        float currentHeight = mScaler.getHeight();
        float targetHeight = mSmallSize;
@@ -552,11 +552,11 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener {
        mExpanding = false;
        mExpansionStyle = NONE;

        if (DEBUG) Slog.d(TAG, "wasClosed is: " + wasClosed);
        if (DEBUG) Slog.d(TAG, "currentHeight is: " + currentHeight);
        if (DEBUG) Slog.d(TAG, "mSmallSize is: " + mSmallSize);
        if (DEBUG) Slog.d(TAG, "targetHeight is: " + targetHeight);
        if (DEBUG) Slog.d(TAG, "scale was finished on view: " + mCurrView);
        if (DEBUG) Log.d(TAG, "wasClosed is: " + wasClosed);
        if (DEBUG) Log.d(TAG, "currentHeight is: " + currentHeight);
        if (DEBUG) Log.d(TAG, "mSmallSize is: " + mSmallSize);
        if (DEBUG) Log.d(TAG, "targetHeight is: " + targetHeight);
        if (DEBUG) Log.d(TAG, "scale was finished on view: " + mCurrView);
    }

    private void clearView() {
@@ -575,7 +575,7 @@ public class ExpandHelper implements Gefingerpoken, OnClickListener {
                String debugLog = "Looking for glows: " +
                        (mCurrViewTopGlow != null ? "found top " : "didn't find top") +
                        (mCurrViewBottomGlow != null ? "found bottom " : "didn't find bottom");
                Slog.v(TAG,  debugLog);
                Log.v(TAG,  debugLog);
            }
        }
    }
+3 −3
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@ import android.os.Vibrator;
import android.provider.Settings;
import android.util.AttributeSet;
import android.util.EventLog;
import android.util.Slog;
import android.util.Log;
import android.view.IWindowManager;
import android.view.MotionEvent;
import android.view.View;
@@ -120,7 +120,7 @@ public class SearchPanelView extends FrameLayout implements
                mContext.startActivityAsUser(intent, opts.toBundle(),
                        new UserHandle(UserHandle.USER_CURRENT));
            } catch (ActivityNotFoundException e) {
                Slog.w(TAG, "Activity not found for " + intent.getAction());
                Log.w(TAG, "Activity not found for " + intent.getAction());
                onAnimationStarted();
            }
        }
@@ -186,7 +186,7 @@ public class SearchPanelView extends FrameLayout implements
            if (component == null || !mGlowPadView.replaceTargetDrawablesIfPresent(component,
                    ASSIST_ICON_METADATA_NAME,
                    com.android.internal.R.drawable.ic_action_assist_generic)) {
                if (DEBUG) Slog.v(TAG, "Couldn't grab icon for component " + component);
                if (DEBUG) Log.v(TAG, "Couldn't grab icon for component " + component);
            }
        }
    }
+4 −4
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@ import android.content.Intent;
import android.content.res.Configuration;
import android.os.IBinder;
import android.os.RemoteException;
import android.util.Slog;
import android.util.Log;
import android.view.IWindowManager;
import android.view.WindowManagerGlobal;

@@ -70,14 +70,14 @@ public class SystemUIService extends Service {
                    ? R.string.config_systemBarComponent
                    : R.string.config_statusBarComponent;
        } catch (RemoteException e) {
            Slog.w(TAG, "Failing checking whether status bar can hide", e);
            Log.w(TAG, "Failing checking whether status bar can hide", e);
        }

        final int N = SERVICES.length;
        mServices = new SystemUI[N];
        for (int i=0; i<N; i++) {
            Class cl = chooseClass(SERVICES[i]);
            Slog.d(TAG, "loading: " + cl);
            Log.d(TAG, "loading: " + cl);
            try {
                mServices[i] = (SystemUI)cl.newInstance();
            } catch (IllegalAccessException ex) {
@@ -86,7 +86,7 @@ public class SystemUIService extends Service {
                throw new RuntimeException(ex);
            }
            mServices[i].mContext = this;
            Slog.d(TAG, "running: " + mServices[i]);
            Log.d(TAG, "running: " + mServices[i]);
            mServices[i].start();
        }
    }
+8 −8
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@ import android.os.Process;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.UserHandle;
import android.util.Slog;
import android.util.Log;

import com.android.systemui.SystemUI;

@@ -60,7 +60,7 @@ public class RingtonePlayer extends SystemUI {
        try {
            mAudioService.setRingtonePlayer(mCallback);
        } catch (RemoteException e) {
            Slog.e(TAG, "Problem registering RingtonePlayer: " + e);
            Log.e(TAG, "Problem registering RingtonePlayer: " + e);
        }
    }

@@ -81,7 +81,7 @@ public class RingtonePlayer extends SystemUI {

        @Override
        public void binderDied() {
            if (LOGD) Slog.d(TAG, "binderDied() token=" + mToken);
            if (LOGD) Log.d(TAG, "binderDied() token=" + mToken);
            synchronized (mClients) {
                mClients.remove(mToken);
            }
@@ -93,7 +93,7 @@ public class RingtonePlayer extends SystemUI {
        @Override
        public void play(IBinder token, Uri uri, int streamType) throws RemoteException {
            if (LOGD) {
                Slog.d(TAG, "play(token=" + token + ", uri=" + uri + ", uid="
                Log.d(TAG, "play(token=" + token + ", uri=" + uri + ", uid="
                        + Binder.getCallingUid() + ")");
            }
            Client client;
@@ -111,7 +111,7 @@ public class RingtonePlayer extends SystemUI {

        @Override
        public void stop(IBinder token) {
            if (LOGD) Slog.d(TAG, "stop(token=" + token + ")");
            if (LOGD) Log.d(TAG, "stop(token=" + token + ")");
            Client client;
            synchronized (mClients) {
                client = mClients.remove(token);
@@ -124,7 +124,7 @@ public class RingtonePlayer extends SystemUI {

        @Override
        public boolean isPlaying(IBinder token) {
            if (LOGD) Slog.d(TAG, "isPlaying(token=" + token + ")");
            if (LOGD) Log.d(TAG, "isPlaying(token=" + token + ")");
            Client client;
            synchronized (mClients) {
                client = mClients.get(token);
@@ -138,7 +138,7 @@ public class RingtonePlayer extends SystemUI {

        @Override
        public void playAsync(Uri uri, UserHandle user, boolean looping, int streamType) {
            if (LOGD) Slog.d(TAG, "playAsync(uri=" + uri + ", user=" + user + ")");
            if (LOGD) Log.d(TAG, "playAsync(uri=" + uri + ", user=" + user + ")");
            if (Binder.getCallingUid() != Process.SYSTEM_UID) {
                throw new SecurityException("Async playback only available from system UID.");
            }
@@ -148,7 +148,7 @@ public class RingtonePlayer extends SystemUI {

        @Override
        public void stopAsync() {
            if (LOGD) Slog.d(TAG, "stopAsync()");
            if (LOGD) Log.d(TAG, "stopAsync()");
            if (Binder.getCallingUid() != Process.SYSTEM_UID) {
                throw new SecurityException("Async playback only available from system UID.");
            }
Loading