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

Commit ddd0433c authored by Kevin Chyn's avatar Kevin Chyn
Browse files

9/n: Add work profile background, enable new dialog by default

Test: manual

Bug: 123378871
Change-Id: I78d6a63747bdafc7282def1d415459543a9b92af
parent e9744e40
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -19,12 +19,16 @@ package com.android.systemui.biometrics;
import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.app.admin.DevicePolicyManager;
import android.content.Context;
import android.graphics.PixelFormat;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.hardware.biometrics.BiometricAuthenticator;
import android.os.Binder;
import android.os.Bundle;
import android.os.IBinder;
import android.os.UserManager;
import android.util.Log;
import android.view.KeyEvent;
import android.view.LayoutInflater;
@@ -208,6 +212,17 @@ public class AuthContainerView extends LinearLayout

        mBackgroundView = mContainerView.findViewById(R.id.background);

        UserManager userManager = mContext.getSystemService(UserManager.class);
        DevicePolicyManager dpm = mContext.getSystemService(DevicePolicyManager.class);
        if (userManager.isManagedProfile(mConfig.mUserId)) {
            final Drawable image = getResources().getDrawable(R.drawable.work_challenge_background,
                    mContext.getTheme());
            image.setColorFilter(dpm.getOrganizationColorForUser(mConfig.mUserId),
                    PorterDuff.Mode.DARKEN);
            mBackgroundView.setScaleType(ImageView.ScaleType.CENTER_CROP);
            mBackgroundView.setImageDrawable(image);
        }

        mBiometricView.setRequireConfirmation(mConfig.mRequireConfirmation);
        mBiometricView.setPanelController(mPanelController);
        mBiometricView.setBiometricPromptBundle(config.mBiometricPromptBundle);
+3 −3
Original line number Diff line number Diff line
@@ -46,8 +46,8 @@ import java.util.List;
 */
public class AuthController extends SystemUI implements CommandQueue.Callbacks,
        AuthDialogCallback {
    private static final String USE_NEW_DIALOG =
            "com.android.systemui.biometrics.AuthController.USE_NEW_DIALOG";
    private static final String DISABLE_NEW_DIALOG =
            "com.android.systemui.biometrics.AuthController.DISABLE_NEW_DIALOG";

    private static final String TAG = "BiometricPrompt/AuthController";
    private static final boolean DEBUG = true;
@@ -317,7 +317,7 @@ public class AuthController extends SystemUI implements CommandQueue.Callbacks,
    protected AuthDialog buildDialog(Bundle biometricPromptBundle, boolean requireConfirmation,
            int userId, int type, String opPackageName, boolean skipIntro) {
        if (Settings.Secure.getIntForUser(
                mContext.getContentResolver(), USE_NEW_DIALOG, userId, 0) != 0) {
                mContext.getContentResolver(), DISABLE_NEW_DIALOG, userId, 0) == 0) {
            return new AuthContainerView.Builder(mContext)
                    .setCallback(this)
                    .setBiometricPromptBundle(biometricPromptBundle)