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

Commit 5c6a3e57 authored by Kevin Lim's avatar Kevin Lim
Browse files

Use context#getDrawable instead of AppCompatResources#getDrawable to

fix test failure.

Bug: b/352775107
Flag: EXEMPT Test crash fix
Test: atest NexusLauncherTests
Change-Id: I2a20fd6d1de3a5398c665d477c1e234d9b890781
parent bb87ff95
Loading
Loading
Loading
Loading
+3 −6
Original line number Diff line number Diff line
@@ -52,7 +52,6 @@ import androidx.annotation.Nullable;
import androidx.annotation.StringRes;
import androidx.annotation.StyleRes;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.content.res.AppCompatResources;

import com.android.launcher3.DeviceProfile;
import com.android.launcher3.R;
@@ -610,8 +609,8 @@ abstract class TutorialController implements BackGestureAttemptCallback,

    private void updateDrawables() {
        if (mContext != null) {
            mTutorialFragment.getRootView().setBackground(AppCompatResources.getDrawable(
                    mContext, getMockWallpaperResId()));
            mTutorialFragment.getRootView()
                    .setBackground(mContext.getDrawable(getMockWallpaperResId()));
            mTutorialFragment.updateFeedbackAnimation();
            mFakeLauncherView.setBackgroundColor(getFakeLauncherColor());
            updateFakeViewLayout(mFakeHotseatView, getMockHotseatResId());
@@ -619,9 +618,7 @@ abstract class TutorialController implements BackGestureAttemptCallback,
            mFakeTaskView.animate().alpha(1).setListener(
                    AnimatorListeners.forSuccessCallback(() -> mFakeTaskView.animate().cancel()));
            mFakePreviousTaskView.setFakeTaskViewFillColor(getMockPreviousAppTaskThumbnailColor());
            mFakeIconView.setBackground(AppCompatResources.getDrawable(
                    mContext, getMockAppIconResId()));

            mFakeIconView.setBackground(mContext.getDrawable(getMockAppIconResId()));
            mExitingAppView.setBackgroundColor(getExitingAppColor());
            mFakeTaskView.setBackgroundColor(getFakeTaskViewColor());
            updateHotseatChildViewColor(mHotseatIconView);
+2 −5
Original line number Diff line number Diff line
@@ -22,8 +22,6 @@ import android.util.Log;
import android.widget.ImageView;
import android.widget.LinearLayout;

import androidx.appcompat.content.res.AppCompatResources;

import com.android.launcher3.R;
import com.android.launcher3.Utilities;
import com.android.launcher3.icons.GraphicsUtils;
@@ -91,9 +89,8 @@ public class TutorialStepIndicator extends LinearLayout {
        int inactiveStepIndicatorColor = GraphicsUtils.getAttrColor(
                getContext(), android.R.attr.textColorSecondaryInverse);
        for (int i = 0; i < mTotalSteps; i++) {
            Drawable pageIndicatorPillDrawable = AppCompatResources.getDrawable(
                    getContext(), R.drawable.tutorial_step_indicator_pill);

            Drawable pageIndicatorPillDrawable =
                    getContext().getDrawable(R.drawable.tutorial_step_indicator_pill);
            if (i >= getChildCount()) {
                ImageView pageIndicatorPill = new ImageView(getContext());
                pageIndicatorPill.setImageDrawable(pageIndicatorPillDrawable);