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

Commit 34476405 authored by Winson Chung's avatar Winson Chung Committed by Android (Google) Code Review
Browse files

Merge "1/ Remove some unused code from the shared lib" into tm-dev

parents 7da5f02d 535740f7
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -184,6 +184,7 @@ public final class ThreadedRenderer extends HardwareRenderer {
     */
    public static final String DEBUG_FORCE_DARK = "debug.hwui.force_dark";

    public static int EGL_CONTEXT_PRIORITY_REALTIME_NV = 0x3357;
    public static int EGL_CONTEXT_PRIORITY_HIGH_IMG = 0x3101;
    public static int EGL_CONTEXT_PRIORITY_MEDIUM_IMG = 0x3102;
    public static int EGL_CONTEXT_PRIORITY_LOW_IMG = 0x3103;
+0 −73
Original line number Diff line number Diff line
/*
 * Copyright (C) 2017 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.android.systemui.shared.recents.utilities;

import static android.os.Trace.TRACE_TAG_APP;

/**
 * Helper class for internal trace functions.
 */
public class AppTrace {

    /**
     * Begins a new async trace section with the given {@param key} and {@param cookie}.
     */
    public static void start(String key, int cookie) {
        android.os.Trace.asyncTraceBegin(TRACE_TAG_APP, key, cookie);
    }

    /**
     * Begins a new async trace section with the given {@param key}.
     */
    public static void start(String key) {
        android.os.Trace.asyncTraceBegin(TRACE_TAG_APP, key, 0);
    }

    /**
     * Ends an existing async trace section with the given {@param key}.
     */
    public static void end(String key) {
        android.os.Trace.asyncTraceEnd(TRACE_TAG_APP, key, 0);
    }

    /**
     * Ends an existing async trace section with the given {@param key} and {@param cookie}.
     */
    public static void end(String key, int cookie) {
        android.os.Trace.asyncTraceEnd(TRACE_TAG_APP, key, cookie);
    }

    /**
     * Begins a new trace section with the given {@param key}. Can be nested.
     */
    public static void beginSection(String key) {
        android.os.Trace.beginSection(key);
    }

    /**
     * Ends an existing trace section started in the last {@link #beginSection(String)}.
     */
    public static void endSection() {
        android.os.Trace.endSection();
    }

    /**
     * Traces a counter value.
     */
    public static void count(String name, int count) {
        android.os.Trace.traceCounter(TRACE_TAG_APP, name, count);
    }
}
+0 −52
Original line number Diff line number Diff line
/*
 * Copyright (C) 2016 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.android.systemui.shared.recents.utilities;

import android.animation.TypeEvaluator;
import android.graphics.RectF;

/**
 * This evaluator can be used to perform type interpolation between <code>RectF</code> values.
 */
public class RectFEvaluator implements TypeEvaluator<RectF> {

    private final RectF mRect = new RectF();

    /**
     * This function returns the result of linearly interpolating the start and
     * end Rect values, with <code>fraction</code> representing the proportion
     * between the start and end values. The calculation is a simple parametric
     * calculation on each of the separate components in the Rect objects
     * (left, top, right, and bottom).
     *
     * <p>The object returned will be the <code>reuseRect</code> passed into the constructor.</p>
     *
     * @param fraction   The fraction from the starting to the ending values
     * @param startValue The start Rect
     * @param endValue   The end Rect
     * @return A linear interpolation between the start and end values, given the
     *         <code>fraction</code> parameter.
     */
    @Override
    public RectF evaluate(float fraction, RectF startValue, RectF endValue) {
        float left = startValue.left + ((endValue.left - startValue.left) * fraction);
        float top = startValue.top + ((endValue.top - startValue.top) * fraction);
        float right = startValue.right + ((endValue.right - startValue.right) * fraction);
        float bottom = startValue.bottom + ((endValue.bottom - startValue.bottom) * fraction);
        mRect.set(left, top, right, bottom);
        return mRect;
    }
}
+0 −27
Original line number Diff line number Diff line
@@ -42,31 +42,4 @@ public class ActivityCompat {
    public void unregisterRemoteAnimations() {
        mWrapped.unregisterRemoteAnimations();
    }

    /**
     * @see android.view.ViewDebug#dumpv2(View, ByteArrayOutputStream)
     */
    public boolean encodeViewHierarchy(ByteArrayOutputStream out) {
        View view = null;
        if (mWrapped.getWindow() != null &&
                mWrapped.getWindow().peekDecorView() != null &&
                mWrapped.getWindow().peekDecorView().getViewRootImpl() != null) {
            view = mWrapped.getWindow().peekDecorView().getViewRootImpl().getView();
        }
        if (view == null) {
            return false;
        }

        final ViewHierarchyEncoder encoder = new ViewHierarchyEncoder(out);
        int[] location = view.getLocationOnScreen();
        encoder.addProperty("window:left", location[0]);
        encoder.addProperty("window:top", location[1]);
        view.encode(encoder);
        encoder.endStream();
        return true;
    }

    public int getDisplayId() {
        return mWrapped.getDisplayId();
    }
}
+0 −1
Original line number Diff line number Diff line
@@ -262,7 +262,6 @@ public class ActivityManagerWrapper {
     * Starts a task from Recents synchronously.
     */
    public boolean startActivityFromRecents(Task.TaskKey taskKey, ActivityOptions options) {
        ActivityOptionsCompat.addTaskInfo(options, taskKey);
        return startActivityFromRecents(taskKey.id, options);
    }

Loading