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

Commit 3ea398ec authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Cleaning Utilities.java" into tm-qpr-dev

parents ff86dd93 47d4d81b
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -18,8 +18,6 @@ package com.android.launcher3.model;

import static android.content.ContentResolver.SCHEME_CONTENT;

import static com.android.launcher3.Utilities.newContentObserver;

import android.annotation.TargetApi;
import android.app.RemoteAction;
import android.content.ContentProviderClient;
+9 −16
Original line number Diff line number Diff line
@@ -46,10 +46,7 @@ import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_S
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_STATUS_BAR_KEYGUARD_SHOWING_OCCLUDED;

import android.app.ActivityTaskManager;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.graphics.Region;
import android.inputmethodservice.InputMethodService;
import android.net.Uri;
@@ -63,12 +60,12 @@ import android.view.MotionEvent;
import androidx.annotation.BinderThread;
import androidx.annotation.NonNull;

import com.android.launcher3.Utilities;
import com.android.launcher3.util.DisplayController;
import com.android.launcher3.util.DisplayController.DisplayInfoChangeListener;
import com.android.launcher3.util.DisplayController.Info;
import com.android.launcher3.util.NavigationMode;
import com.android.launcher3.util.SettingsCache;
import com.android.launcher3.util.SimpleBroadcastReceiver;
import com.android.quickstep.TopTaskTracker.CachedTaskInfo;
import com.android.quickstep.util.NavBarPosition;
import com.android.systemui.shared.system.ActivityManagerWrapper;
@@ -114,15 +111,12 @@ public class RecentsAnimationDeviceState implements DisplayInfoChangeListener {

    private boolean mIsUserUnlocked;
    private final ArrayList<Runnable> mUserUnlockedActions = new ArrayList<>();
    private final BroadcastReceiver mUserUnlockedReceiver = new BroadcastReceiver() {
        @Override
        public void onReceive(Context context, Intent intent) {
            if (ACTION_USER_UNLOCKED.equals(intent.getAction())) {
    private final SimpleBroadcastReceiver mUserUnlockedReceiver = new SimpleBroadcastReceiver(i -> {
        if (ACTION_USER_UNLOCKED.equals(i.getAction())) {
            mIsUserUnlocked = true;
            notifyUserUnlocked();
        }
        }
    };
    });

    private int mGestureBlockingTaskId = -1;
    private @NonNull Region mExclusionRegion = new Region();
@@ -153,10 +147,9 @@ public class RecentsAnimationDeviceState implements DisplayInfoChangeListener {
        mIsUserUnlocked = context.getSystemService(UserManager.class)
                .isUserUnlocked(Process.myUserHandle());
        if (!mIsUserUnlocked) {
            mContext.registerReceiver(mUserUnlockedReceiver,
                    new IntentFilter(ACTION_USER_UNLOCKED));
            mUserUnlockedReceiver.register(mContext, ACTION_USER_UNLOCKED);
        }
        runOnDestroy(() -> Utilities.unregisterReceiverSafely(mContext, mUserUnlockedReceiver));
        runOnDestroy(() -> mUserUnlockedReceiver.unregisterReceiverSafely(mContext));

        // Register for exclusion updates
        mExclusionListener = new SystemGestureExclusionListenerCompat(mDisplayId) {
@@ -347,7 +340,7 @@ public class RecentsAnimationDeviceState implements DisplayInfoChangeListener {
            action.run();
        }
        mUserUnlockedActions.clear();
        Utilities.unregisterReceiverSafely(mContext, mUserUnlockedReceiver);
        mUserUnlockedReceiver.unregisterReceiverSafely(mContext);
    }

    /**
+1 −2
Original line number Diff line number Diff line
@@ -18,7 +18,6 @@ package com.android.quickstep.util;
import static com.android.launcher3.LauncherAnimUtils.HOTSEAT_SCALE_PROPERTY_FACTORY;
import static com.android.launcher3.LauncherAnimUtils.SCALE_INDEX_UNFOLD_ANIMATION;
import static com.android.launcher3.LauncherAnimUtils.WORKSPACE_SCALE_PROPERTY_FACTORY;
import static com.android.launcher3.Utilities.comp;

import android.annotation.Nullable;
import android.util.FloatProperty;
@@ -135,7 +134,7 @@ public class LauncherUnfoldAnimationController {
        @Override
        public void onTransitionProgress(float progress) {
            if (mQsbInsettable != null) {
                float insetPercentage = comp(progress) * MAX_WIDTH_INSET_FRACTION;
                float insetPercentage = (1 - progress) * MAX_WIDTH_INSET_FRACTION;
                mQsbInsettable.setHorizontalInsets(insetPercentage);
            }
        }
+1 −2
Original line number Diff line number Diff line
@@ -20,7 +20,6 @@ import static android.view.Display.DEFAULT_DISPLAY;
import static android.widget.Toast.LENGTH_SHORT;

import static com.android.launcher3.LauncherState.BACKGROUND_APP;
import static com.android.launcher3.Utilities.comp;
import static com.android.launcher3.Utilities.getDescendantCoordRelativeToAncestor;
import static com.android.launcher3.anim.Interpolators.ACCEL_DEACCEL;
import static com.android.launcher3.anim.Interpolators.FAST_OUT_SLOW_IN;
@@ -501,7 +500,7 @@ public class TaskView extends FrameLayout implements Reusable {
            return;
        }
        mModalness = modalness;
        mIconView.setAlpha(comp(modalness));
        mIconView.setAlpha(1 - modalness);
        mDigitalWellBeingToast.updateBannerOffset(modalness,
                mCurrentFullscreenParams.mCurrentDrawnInsets.top
                        + mCurrentFullscreenParams.mCurrentDrawnInsets.bottom);
+5 −4
Original line number Diff line number Diff line
@@ -607,15 +607,16 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
     * Get the icon bounds on the view depending on the layout type.
     */
    public void getIconBounds(int iconSize, Rect outBounds) {
        Utilities.setRectToViewCenter(this, iconSize, outBounds);
        outBounds.set(0, 0, iconSize, iconSize);
        if (mLayoutHorizontal) {
            int top = (getHeight() - iconSize) / 2;
            if (mIsRtl) {
                outBounds.offsetTo(getWidth() - iconSize - getPaddingRight(), outBounds.top);
                outBounds.offsetTo(getWidth() - iconSize - getPaddingRight(), top);
            } else {
                outBounds.offsetTo(getPaddingLeft(), outBounds.top);
                outBounds.offsetTo(getPaddingLeft(), top);
            }
        } else {
            outBounds.offsetTo(outBounds.left, getPaddingTop());
            outBounds.offset((getWidth() - iconSize) / 2, getPaddingTop());
        }
    }

Loading