Loading packages/SystemUI/src/com/android/systemui/biometrics/AuthContainerView.java +10 −3 Original line number Diff line number Diff line Loading @@ -56,7 +56,9 @@ import com.android.internal.annotations.VisibleForTesting; import com.android.internal.widget.LockPatternUtils; import com.android.systemui.R; import com.android.systemui.animation.Interpolators; import com.android.systemui.dagger.qualifiers.Background; import com.android.systemui.keyguard.WakefulnessLifecycle; import com.android.systemui.util.concurrency.DelayableExecutor; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; Loading Loading @@ -110,6 +112,8 @@ public class AuthContainerView extends LinearLayout @ContainerState private int mContainerState = STATE_UNKNOWN; private final Set<Integer> mFailedModalities = new HashSet<Integer>(); private final @Background DelayableExecutor mBackgroundExecutor; // Non-null only if the dialog is in the act of dismissing and has not sent the reason yet. @Nullable @AuthDialogCallback.DismissedReason private Integer mPendingCallbackReason; // HAT received from LockSettingsService when credential is verified. Loading Loading @@ -192,7 +196,7 @@ public class AuthContainerView extends LinearLayout return this; } public AuthContainerView build(int[] sensorIds, public AuthContainerView build(@Background DelayableExecutor bgExecutor, int[] sensorIds, @Nullable List<FingerprintSensorPropertiesInternal> fpProps, @Nullable List<FaceSensorPropertiesInternal> faceProps, @NonNull WakefulnessLifecycle wakefulnessLifecycle, Loading @@ -200,7 +204,7 @@ public class AuthContainerView extends LinearLayout @NonNull LockPatternUtils lockPatternUtils) { mConfig.mSensorIds = sensorIds; return new AuthContainerView(mConfig, fpProps, faceProps, wakefulnessLifecycle, userManager, lockPatternUtils, new Handler(Looper.getMainLooper())); userManager, lockPatternUtils, new Handler(Looper.getMainLooper()), bgExecutor); } } Loading Loading @@ -253,7 +257,8 @@ public class AuthContainerView extends LinearLayout @NonNull WakefulnessLifecycle wakefulnessLifecycle, @NonNull UserManager userManager, @NonNull LockPatternUtils lockPatternUtils, @NonNull Handler mainHandler) { @NonNull Handler mainHandler, @NonNull @Background DelayableExecutor bgExecutor) { super(config.mContext); mConfig = config; Loading @@ -277,6 +282,7 @@ public class AuthContainerView extends LinearLayout mBackgroundView = mFrameLayout.findViewById(R.id.background); mPanelView = mFrameLayout.findViewById(R.id.panel); mPanelController = new AuthPanelController(mContext, mPanelView); mBackgroundExecutor = bgExecutor; // Inflate biometric view only if necessary. if (Utils.isBiometricAllowed(mConfig.mPromptInfo)) { Loading Loading @@ -384,6 +390,7 @@ public class AuthContainerView extends LinearLayout mCredentialView.setPromptInfo(mConfig.mPromptInfo); mCredentialView.setPanelController(mPanelController, animatePanel); mCredentialView.setShouldAnimateContents(animateContents); mCredentialView.setBackgroundExecutor(mBackgroundExecutor); mFrameLayout.addView(mCredentialView); } Loading packages/SystemUI/src/com/android/systemui/biometrics/AuthController.java +12 −6 Original line number Diff line number Diff line Loading @@ -64,11 +64,13 @@ import com.android.internal.widget.LockPatternUtils; import com.android.systemui.CoreStartable; import com.android.systemui.assist.ui.DisplayUtils; import com.android.systemui.dagger.SysUISingleton; import com.android.systemui.dagger.qualifiers.Background; import com.android.systemui.dagger.qualifiers.Main; import com.android.systemui.doze.DozeReceiver; import com.android.systemui.keyguard.WakefulnessLifecycle; import com.android.systemui.plugins.statusbar.StatusBarStateController; import com.android.systemui.statusbar.CommandQueue; import com.android.systemui.util.concurrency.DelayableExecutor; import com.android.systemui.util.concurrency.Execution; import java.util.ArrayList; Loading Loading @@ -139,6 +141,7 @@ public class AuthController extends CoreStartable implements CommandQueue.Callba private boolean mAllAuthenticatorsRegistered; @NonNull private final UserManager mUserManager; @NonNull private final LockPatternUtils mLockPatternUtils; private final @Background DelayableExecutor mBackgroundExecutor; @VisibleForTesting final TaskStackListener mTaskStackListener = new TaskStackListener() { Loading Loading @@ -507,13 +510,15 @@ public class AuthController extends CoreStartable implements CommandQueue.Callba @NonNull UserManager userManager, @NonNull LockPatternUtils lockPatternUtils, @NonNull StatusBarStateController statusBarStateController, @Main Handler handler) { @Main Handler handler, @Background DelayableExecutor bgExecutor) { super(context); mExecution = execution; mWakefulnessLifecycle = wakefulnessLifecycle; mUserManager = userManager; mLockPatternUtils = lockPatternUtils; mHandler = handler; mBackgroundExecutor = bgExecutor; mCommandQueue = commandQueue; mActivityTaskManager = activityTaskManager; mFingerprintManager = fingerprintManager; Loading Loading @@ -839,6 +844,7 @@ public class AuthController extends CoreStartable implements CommandQueue.Callba // Create a new dialog but do not replace the current one yet. final AuthDialog newDialog = buildDialog( mBackgroundExecutor, promptInfo, requireConfirmation, userId, Loading Loading @@ -934,9 +940,9 @@ public class AuthController extends CoreStartable implements CommandQueue.Callba } } protected AuthDialog buildDialog(PromptInfo promptInfo, boolean requireConfirmation, int userId, int[] sensorIds, String opPackageName, boolean skipIntro, long operationId, long requestId, protected AuthDialog buildDialog(@Background DelayableExecutor bgExecutor, PromptInfo promptInfo, boolean requireConfirmation, int userId, int[] sensorIds, String opPackageName, boolean skipIntro, long operationId, long requestId, @BiometricMultiSensorMode int multiSensorConfig, @NonNull WakefulnessLifecycle wakefulnessLifecycle, @NonNull UserManager userManager, Loading @@ -951,8 +957,8 @@ public class AuthController extends CoreStartable implements CommandQueue.Callba .setOperationId(operationId) .setRequestId(requestId) .setMultiSensorConfig(multiSensorConfig) .build(sensorIds, mFpProps, mFaceProps, wakefulnessLifecycle, userManager, lockPatternUtils); .build(bgExecutor, sensorIds, mFpProps, mFaceProps, wakefulnessLifecycle, userManager, lockPatternUtils); } /** Loading packages/SystemUI/src/com/android/systemui/biometrics/AuthCredentialView.java +34 −18 Original line number Diff line number Diff line Loading @@ -53,6 +53,8 @@ import com.android.internal.widget.LockPatternUtils; import com.android.internal.widget.VerifyCredentialResponse; import com.android.systemui.R; import com.android.systemui.animation.Interpolators; import com.android.systemui.dagger.qualifiers.Background; import com.android.systemui.util.concurrency.DelayableExecutor; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; Loading Loading @@ -99,6 +101,8 @@ public abstract class AuthCredentialView extends LinearLayout { protected int mEffectiveUserId; protected ErrorTimer mErrorTimer; protected @Background DelayableExecutor mBackgroundExecutor; interface Callback { void onCredentialMatched(byte[] attestation); } Loading Loading @@ -217,6 +221,10 @@ public abstract class AuthCredentialView extends LinearLayout { mContainerView = containerView; } void setBackgroundExecutor(@Background DelayableExecutor bgExecutor) { mBackgroundExecutor = bgExecutor; } @Override protected void onAttachedToWindow() { super.onAttachedToWindow(); Loading Loading @@ -377,6 +385,7 @@ public abstract class AuthCredentialView extends LinearLayout { } private void showLastAttemptBeforeWipeDialog() { mBackgroundExecutor.execute(() -> { final AlertDialog alertDialog = new AlertDialog.Builder(mContext) .setTitle(R.string.biometric_dialog_last_attempt_before_wipe_dialog_title) .setMessage( Loading @@ -384,20 +393,25 @@ public abstract class AuthCredentialView extends LinearLayout { .setPositiveButton(android.R.string.ok, null) .create(); alertDialog.getWindow().setType(WindowManager.LayoutParams.TYPE_STATUS_BAR_SUB_PANEL); alertDialog.show(); mHandler.post(alertDialog::show); }); } private void showNowWipingDialog() { mBackgroundExecutor.execute(() -> { String nowWipingMessage = getNowWipingMessage(getUserTypeForWipe()); final AlertDialog alertDialog = new AlertDialog.Builder(mContext) .setMessage(getNowWipingMessage(getUserTypeForWipe())) .setMessage(nowWipingMessage) .setPositiveButton( com.android.settingslib.R.string.failed_attempts_now_wiping_dialog_dismiss, null /* OnClickListener */) .setOnDismissListener( dialog -> mContainerView.animateAway(AuthDialogCallback.DISMISSED_ERROR)) dialog -> mContainerView.animateAway( AuthDialogCallback.DISMISSED_ERROR)) .create(); alertDialog.getWindow().setType(WindowManager.LayoutParams.TYPE_STATUS_BAR_SUB_PANEL); alertDialog.show(); mHandler.post(alertDialog::show); }); } private @UserType int getUserTypeForWipe() { Loading @@ -412,6 +426,7 @@ public abstract class AuthCredentialView extends LinearLayout { } } // This should not be called on the main thread to avoid making an IPC. private String getLastAttemptBeforeWipeMessage( @UserType int userType, @Utils.CredentialType int credentialType) { switch (userType) { Loading Loading @@ -442,6 +457,7 @@ public abstract class AuthCredentialView extends LinearLayout { } } // This should not be called on the main thread to avoid making an IPC. private String getLastAttemptBeforeWipeProfileMessage( @Utils.CredentialType int credentialType) { return mDevicePolicyManager.getResources().getString( Loading packages/SystemUI/src/com/android/systemui/qs/QSSecurityFooter.java +22 −18 Original line number Diff line number Diff line Loading @@ -143,9 +143,10 @@ class QSSecurityFooter extends ViewController<View> @Inject QSSecurityFooter(@Named(QS_SECURITY_FOOTER_VIEW) View rootView, UserTracker userTracker, @Main Handler mainHandler, ActivityStarter activityStarter, SecurityController securityController, DialogLaunchAnimator dialogLaunchAnimator, @Background Looper bgLooper, BroadcastDispatcher broadcastDispatcher) { UserTracker userTracker, @Main Handler mainHandler, ActivityStarter activityStarter, SecurityController securityController, DialogLaunchAnimator dialogLaunchAnimator, @Background Looper bgLooper, BroadcastDispatcher broadcastDispatcher) { super(rootView); mFooterText = mView.findViewById(R.id.footer_text); mPrimaryFooterIcon = mView.findViewById(R.id.primary_footer_icon); Loading Loading @@ -493,14 +494,15 @@ class QSSecurityFooter extends ViewController<View> private void createDialog() { mShouldUseSettingsButton.set(false); mHandler.post(() -> { String settingsButtonText = getSettingsButton(); final View view = createDialogView(); mMainHandler.post(() -> { mDialog = new SystemUIDialog(mContext, 0); // Use mContext theme mDialog.requestWindowFeature(Window.FEATURE_NO_TITLE); mDialog.setButton(DialogInterface.BUTTON_POSITIVE, getPositiveButton(), this); mDialog.setButton(DialogInterface.BUTTON_NEGATIVE, mShouldUseSettingsButton.get() ? getSettingsButton() : getNegativeButton(), this); mDialog.setButton(DialogInterface.BUTTON_NEGATIVE, mShouldUseSettingsButton.get() ? settingsButtonText : getNegativeButton(), this); mDialog.setView(view); if (mView.isAggregatedVisible()) { Loading @@ -509,6 +511,7 @@ class QSSecurityFooter extends ViewController<View> mDialog.show(); } }); }); } @VisibleForTesting Loading Loading @@ -650,6 +653,7 @@ class QSSecurityFooter extends ViewController<View> } } // This should not be called on the main thread to avoid making an IPC. @VisibleForTesting String getSettingsButton() { return mDpm.getResources().getString( Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java +4 −5 Original line number Diff line number Diff line Loading @@ -292,9 +292,7 @@ public class PhoneStatusBarPolicy mIconController.setIconVisibility(mSlotHotspot, mHotspot.isHotspotEnabled()); // managed profile mIconController.setIcon(mSlotManagedProfile, R.drawable.stat_sys_managed_profile_status, getManagedProfileAccessibilityString()); mIconController.setIconVisibility(mSlotManagedProfile, mManagedProfileIconVisible); updateManagedProfile(); // data saver mIconController.setIcon(mSlotDataSaver, R.drawable.stat_sys_data_saver, Loading Loading @@ -521,7 +519,7 @@ public class PhoneStatusBarPolicy } private void updateManagedProfile() { // getLastResumedActivityUserId needds to acquire the AM lock, which may be contended in // getLastResumedActivityUserId needs to acquire the AM lock, which may be contended in // some cases. Since it doesn't really matter here whether it's updated in this frame // or in the next one, we call this method from our UI offload thread. mUiBgExecutor.execute(() -> { Loading @@ -529,6 +527,7 @@ public class PhoneStatusBarPolicy try { userId = ActivityTaskManager.getService().getLastResumedActivityUserId(); boolean isManagedProfile = mUserManager.isManagedProfile(userId); String accessibilityString = getManagedProfileAccessibilityString(); mHandler.post(() -> { final boolean showIcon; if (isManagedProfile && (!mKeyguardStateController.isShowing() Loading @@ -536,7 +535,7 @@ public class PhoneStatusBarPolicy showIcon = true; mIconController.setIcon(mSlotManagedProfile, R.drawable.stat_sys_managed_profile_status, getManagedProfileAccessibilityString()); accessibilityString); } else { showIcon = false; } Loading Loading
packages/SystemUI/src/com/android/systemui/biometrics/AuthContainerView.java +10 −3 Original line number Diff line number Diff line Loading @@ -56,7 +56,9 @@ import com.android.internal.annotations.VisibleForTesting; import com.android.internal.widget.LockPatternUtils; import com.android.systemui.R; import com.android.systemui.animation.Interpolators; import com.android.systemui.dagger.qualifiers.Background; import com.android.systemui.keyguard.WakefulnessLifecycle; import com.android.systemui.util.concurrency.DelayableExecutor; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; Loading Loading @@ -110,6 +112,8 @@ public class AuthContainerView extends LinearLayout @ContainerState private int mContainerState = STATE_UNKNOWN; private final Set<Integer> mFailedModalities = new HashSet<Integer>(); private final @Background DelayableExecutor mBackgroundExecutor; // Non-null only if the dialog is in the act of dismissing and has not sent the reason yet. @Nullable @AuthDialogCallback.DismissedReason private Integer mPendingCallbackReason; // HAT received from LockSettingsService when credential is verified. Loading Loading @@ -192,7 +196,7 @@ public class AuthContainerView extends LinearLayout return this; } public AuthContainerView build(int[] sensorIds, public AuthContainerView build(@Background DelayableExecutor bgExecutor, int[] sensorIds, @Nullable List<FingerprintSensorPropertiesInternal> fpProps, @Nullable List<FaceSensorPropertiesInternal> faceProps, @NonNull WakefulnessLifecycle wakefulnessLifecycle, Loading @@ -200,7 +204,7 @@ public class AuthContainerView extends LinearLayout @NonNull LockPatternUtils lockPatternUtils) { mConfig.mSensorIds = sensorIds; return new AuthContainerView(mConfig, fpProps, faceProps, wakefulnessLifecycle, userManager, lockPatternUtils, new Handler(Looper.getMainLooper())); userManager, lockPatternUtils, new Handler(Looper.getMainLooper()), bgExecutor); } } Loading Loading @@ -253,7 +257,8 @@ public class AuthContainerView extends LinearLayout @NonNull WakefulnessLifecycle wakefulnessLifecycle, @NonNull UserManager userManager, @NonNull LockPatternUtils lockPatternUtils, @NonNull Handler mainHandler) { @NonNull Handler mainHandler, @NonNull @Background DelayableExecutor bgExecutor) { super(config.mContext); mConfig = config; Loading @@ -277,6 +282,7 @@ public class AuthContainerView extends LinearLayout mBackgroundView = mFrameLayout.findViewById(R.id.background); mPanelView = mFrameLayout.findViewById(R.id.panel); mPanelController = new AuthPanelController(mContext, mPanelView); mBackgroundExecutor = bgExecutor; // Inflate biometric view only if necessary. if (Utils.isBiometricAllowed(mConfig.mPromptInfo)) { Loading Loading @@ -384,6 +390,7 @@ public class AuthContainerView extends LinearLayout mCredentialView.setPromptInfo(mConfig.mPromptInfo); mCredentialView.setPanelController(mPanelController, animatePanel); mCredentialView.setShouldAnimateContents(animateContents); mCredentialView.setBackgroundExecutor(mBackgroundExecutor); mFrameLayout.addView(mCredentialView); } Loading
packages/SystemUI/src/com/android/systemui/biometrics/AuthController.java +12 −6 Original line number Diff line number Diff line Loading @@ -64,11 +64,13 @@ import com.android.internal.widget.LockPatternUtils; import com.android.systemui.CoreStartable; import com.android.systemui.assist.ui.DisplayUtils; import com.android.systemui.dagger.SysUISingleton; import com.android.systemui.dagger.qualifiers.Background; import com.android.systemui.dagger.qualifiers.Main; import com.android.systemui.doze.DozeReceiver; import com.android.systemui.keyguard.WakefulnessLifecycle; import com.android.systemui.plugins.statusbar.StatusBarStateController; import com.android.systemui.statusbar.CommandQueue; import com.android.systemui.util.concurrency.DelayableExecutor; import com.android.systemui.util.concurrency.Execution; import java.util.ArrayList; Loading Loading @@ -139,6 +141,7 @@ public class AuthController extends CoreStartable implements CommandQueue.Callba private boolean mAllAuthenticatorsRegistered; @NonNull private final UserManager mUserManager; @NonNull private final LockPatternUtils mLockPatternUtils; private final @Background DelayableExecutor mBackgroundExecutor; @VisibleForTesting final TaskStackListener mTaskStackListener = new TaskStackListener() { Loading Loading @@ -507,13 +510,15 @@ public class AuthController extends CoreStartable implements CommandQueue.Callba @NonNull UserManager userManager, @NonNull LockPatternUtils lockPatternUtils, @NonNull StatusBarStateController statusBarStateController, @Main Handler handler) { @Main Handler handler, @Background DelayableExecutor bgExecutor) { super(context); mExecution = execution; mWakefulnessLifecycle = wakefulnessLifecycle; mUserManager = userManager; mLockPatternUtils = lockPatternUtils; mHandler = handler; mBackgroundExecutor = bgExecutor; mCommandQueue = commandQueue; mActivityTaskManager = activityTaskManager; mFingerprintManager = fingerprintManager; Loading Loading @@ -839,6 +844,7 @@ public class AuthController extends CoreStartable implements CommandQueue.Callba // Create a new dialog but do not replace the current one yet. final AuthDialog newDialog = buildDialog( mBackgroundExecutor, promptInfo, requireConfirmation, userId, Loading Loading @@ -934,9 +940,9 @@ public class AuthController extends CoreStartable implements CommandQueue.Callba } } protected AuthDialog buildDialog(PromptInfo promptInfo, boolean requireConfirmation, int userId, int[] sensorIds, String opPackageName, boolean skipIntro, long operationId, long requestId, protected AuthDialog buildDialog(@Background DelayableExecutor bgExecutor, PromptInfo promptInfo, boolean requireConfirmation, int userId, int[] sensorIds, String opPackageName, boolean skipIntro, long operationId, long requestId, @BiometricMultiSensorMode int multiSensorConfig, @NonNull WakefulnessLifecycle wakefulnessLifecycle, @NonNull UserManager userManager, Loading @@ -951,8 +957,8 @@ public class AuthController extends CoreStartable implements CommandQueue.Callba .setOperationId(operationId) .setRequestId(requestId) .setMultiSensorConfig(multiSensorConfig) .build(sensorIds, mFpProps, mFaceProps, wakefulnessLifecycle, userManager, lockPatternUtils); .build(bgExecutor, sensorIds, mFpProps, mFaceProps, wakefulnessLifecycle, userManager, lockPatternUtils); } /** Loading
packages/SystemUI/src/com/android/systemui/biometrics/AuthCredentialView.java +34 −18 Original line number Diff line number Diff line Loading @@ -53,6 +53,8 @@ import com.android.internal.widget.LockPatternUtils; import com.android.internal.widget.VerifyCredentialResponse; import com.android.systemui.R; import com.android.systemui.animation.Interpolators; import com.android.systemui.dagger.qualifiers.Background; import com.android.systemui.util.concurrency.DelayableExecutor; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; Loading Loading @@ -99,6 +101,8 @@ public abstract class AuthCredentialView extends LinearLayout { protected int mEffectiveUserId; protected ErrorTimer mErrorTimer; protected @Background DelayableExecutor mBackgroundExecutor; interface Callback { void onCredentialMatched(byte[] attestation); } Loading Loading @@ -217,6 +221,10 @@ public abstract class AuthCredentialView extends LinearLayout { mContainerView = containerView; } void setBackgroundExecutor(@Background DelayableExecutor bgExecutor) { mBackgroundExecutor = bgExecutor; } @Override protected void onAttachedToWindow() { super.onAttachedToWindow(); Loading Loading @@ -377,6 +385,7 @@ public abstract class AuthCredentialView extends LinearLayout { } private void showLastAttemptBeforeWipeDialog() { mBackgroundExecutor.execute(() -> { final AlertDialog alertDialog = new AlertDialog.Builder(mContext) .setTitle(R.string.biometric_dialog_last_attempt_before_wipe_dialog_title) .setMessage( Loading @@ -384,20 +393,25 @@ public abstract class AuthCredentialView extends LinearLayout { .setPositiveButton(android.R.string.ok, null) .create(); alertDialog.getWindow().setType(WindowManager.LayoutParams.TYPE_STATUS_BAR_SUB_PANEL); alertDialog.show(); mHandler.post(alertDialog::show); }); } private void showNowWipingDialog() { mBackgroundExecutor.execute(() -> { String nowWipingMessage = getNowWipingMessage(getUserTypeForWipe()); final AlertDialog alertDialog = new AlertDialog.Builder(mContext) .setMessage(getNowWipingMessage(getUserTypeForWipe())) .setMessage(nowWipingMessage) .setPositiveButton( com.android.settingslib.R.string.failed_attempts_now_wiping_dialog_dismiss, null /* OnClickListener */) .setOnDismissListener( dialog -> mContainerView.animateAway(AuthDialogCallback.DISMISSED_ERROR)) dialog -> mContainerView.animateAway( AuthDialogCallback.DISMISSED_ERROR)) .create(); alertDialog.getWindow().setType(WindowManager.LayoutParams.TYPE_STATUS_BAR_SUB_PANEL); alertDialog.show(); mHandler.post(alertDialog::show); }); } private @UserType int getUserTypeForWipe() { Loading @@ -412,6 +426,7 @@ public abstract class AuthCredentialView extends LinearLayout { } } // This should not be called on the main thread to avoid making an IPC. private String getLastAttemptBeforeWipeMessage( @UserType int userType, @Utils.CredentialType int credentialType) { switch (userType) { Loading Loading @@ -442,6 +457,7 @@ public abstract class AuthCredentialView extends LinearLayout { } } // This should not be called on the main thread to avoid making an IPC. private String getLastAttemptBeforeWipeProfileMessage( @Utils.CredentialType int credentialType) { return mDevicePolicyManager.getResources().getString( Loading
packages/SystemUI/src/com/android/systemui/qs/QSSecurityFooter.java +22 −18 Original line number Diff line number Diff line Loading @@ -143,9 +143,10 @@ class QSSecurityFooter extends ViewController<View> @Inject QSSecurityFooter(@Named(QS_SECURITY_FOOTER_VIEW) View rootView, UserTracker userTracker, @Main Handler mainHandler, ActivityStarter activityStarter, SecurityController securityController, DialogLaunchAnimator dialogLaunchAnimator, @Background Looper bgLooper, BroadcastDispatcher broadcastDispatcher) { UserTracker userTracker, @Main Handler mainHandler, ActivityStarter activityStarter, SecurityController securityController, DialogLaunchAnimator dialogLaunchAnimator, @Background Looper bgLooper, BroadcastDispatcher broadcastDispatcher) { super(rootView); mFooterText = mView.findViewById(R.id.footer_text); mPrimaryFooterIcon = mView.findViewById(R.id.primary_footer_icon); Loading Loading @@ -493,14 +494,15 @@ class QSSecurityFooter extends ViewController<View> private void createDialog() { mShouldUseSettingsButton.set(false); mHandler.post(() -> { String settingsButtonText = getSettingsButton(); final View view = createDialogView(); mMainHandler.post(() -> { mDialog = new SystemUIDialog(mContext, 0); // Use mContext theme mDialog.requestWindowFeature(Window.FEATURE_NO_TITLE); mDialog.setButton(DialogInterface.BUTTON_POSITIVE, getPositiveButton(), this); mDialog.setButton(DialogInterface.BUTTON_NEGATIVE, mShouldUseSettingsButton.get() ? getSettingsButton() : getNegativeButton(), this); mDialog.setButton(DialogInterface.BUTTON_NEGATIVE, mShouldUseSettingsButton.get() ? settingsButtonText : getNegativeButton(), this); mDialog.setView(view); if (mView.isAggregatedVisible()) { Loading @@ -509,6 +511,7 @@ class QSSecurityFooter extends ViewController<View> mDialog.show(); } }); }); } @VisibleForTesting Loading Loading @@ -650,6 +653,7 @@ class QSSecurityFooter extends ViewController<View> } } // This should not be called on the main thread to avoid making an IPC. @VisibleForTesting String getSettingsButton() { return mDpm.getResources().getString( Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java +4 −5 Original line number Diff line number Diff line Loading @@ -292,9 +292,7 @@ public class PhoneStatusBarPolicy mIconController.setIconVisibility(mSlotHotspot, mHotspot.isHotspotEnabled()); // managed profile mIconController.setIcon(mSlotManagedProfile, R.drawable.stat_sys_managed_profile_status, getManagedProfileAccessibilityString()); mIconController.setIconVisibility(mSlotManagedProfile, mManagedProfileIconVisible); updateManagedProfile(); // data saver mIconController.setIcon(mSlotDataSaver, R.drawable.stat_sys_data_saver, Loading Loading @@ -521,7 +519,7 @@ public class PhoneStatusBarPolicy } private void updateManagedProfile() { // getLastResumedActivityUserId needds to acquire the AM lock, which may be contended in // getLastResumedActivityUserId needs to acquire the AM lock, which may be contended in // some cases. Since it doesn't really matter here whether it's updated in this frame // or in the next one, we call this method from our UI offload thread. mUiBgExecutor.execute(() -> { Loading @@ -529,6 +527,7 @@ public class PhoneStatusBarPolicy try { userId = ActivityTaskManager.getService().getLastResumedActivityUserId(); boolean isManagedProfile = mUserManager.isManagedProfile(userId); String accessibilityString = getManagedProfileAccessibilityString(); mHandler.post(() -> { final boolean showIcon; if (isManagedProfile && (!mKeyguardStateController.isShowing() Loading @@ -536,7 +535,7 @@ public class PhoneStatusBarPolicy showIcon = true; mIconController.setIcon(mSlotManagedProfile, R.drawable.stat_sys_managed_profile_status, getManagedProfileAccessibilityString()); accessibilityString); } else { showIcon = false; } Loading