From 362858810a4e633518e8396b3b00bc4e81795fe3 Mon Sep 17 00:00:00 2001 From: Alex Johnston Date: Fri, 1 May 2020 12:53:17 +0100 Subject: [PATCH] Remove setWorkChallengeBackground * In Android R, the work challenge UI was updated to the latest material spec. The background and organization color are no longer used and can be removed. Bug: 155464031 Test: Check Settings work challenge to ensure code removal does not break anything. Change-Id: Ibc4dac2f47441751fde95485c223e61785f5aae8 --- .../ConfirmDeviceCredentialBaseFragment.java | 31 ------------------- 1 file changed, 31 deletions(-) diff --git a/src/com/android/settings/password/ConfirmDeviceCredentialBaseFragment.java b/src/com/android/settings/password/ConfirmDeviceCredentialBaseFragment.java index 262a550ebd8..b5f512dfa99 100644 --- a/src/com/android/settings/password/ConfirmDeviceCredentialBaseFragment.java +++ b/src/com/android/settings/password/ConfirmDeviceCredentialBaseFragment.java @@ -27,10 +27,6 @@ import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.content.pm.UserInfo; -import android.graphics.Point; -import android.graphics.PorterDuff; -import android.graphics.drawable.ColorDrawable; -import android.graphics.drawable.Drawable; import android.hardware.biometrics.BiometricManager; import android.os.Bundle; import android.os.Handler; @@ -39,10 +35,7 @@ import android.os.UserManager; import android.text.TextUtils; import android.util.Log; import android.view.View; -import android.view.ViewGroup; import android.widget.Button; -import android.widget.FrameLayout; -import android.widget.ImageView; import android.widget.TextView; import androidx.appcompat.app.AlertDialog; @@ -210,30 +203,6 @@ public abstract class ConfirmDeviceCredentialBaseFragment extends InstrumentedFr public void startEnterAnimation() { } - private void setWorkChallengeBackground(View baseView, int userId) { - View mainContent = getActivity().findViewById(com.android.settings.R.id.main_content); - if (mainContent != null) { - // Remove the main content padding so that the background image is full screen. - mainContent.setPadding(0, 0, 0, 0); - } - - baseView.setBackground( - new ColorDrawable(mDevicePolicyManager.getOrganizationColorForUser(userId))); - ImageView imageView = (ImageView) baseView.findViewById(R.id.background_image); - if (imageView != null) { - Drawable image = getResources().getDrawable(R.drawable.work_challenge_background); - image.setColorFilter( - getResources().getColor(R.color.confirm_device_credential_transparent_black), - PorterDuff.Mode.DARKEN); - imageView.setImageDrawable(image); - Point screenSize = new Point(); - getActivity().getWindowManager().getDefaultDisplay().getSize(screenSize); - imageView.setLayoutParams(new FrameLayout.LayoutParams( - ViewGroup.LayoutParams.MATCH_PARENT, - screenSize.y)); - } - } - protected void reportFailedAttempt() { updateErrorMessage( mLockPatternUtils.getCurrentFailedPasswordAttempts(mEffectiveUserId) + 1);