Snap for 9043175 from 66dee9be82 to tm-qpr1-release

Change-Id: Idef9c7bba3203c5735cb4e6a5e3b000f0d7ba837
This commit is contained in:
Android Build Coastguard Worker
2022-09-08 23:26:18 +00:00
6 changed files with 36 additions and 2 deletions

View File

@@ -69,6 +69,8 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="start|top"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="?android:attr/textColorSecondary"
android:gravity="start"
android:layout_weight="1"/>
@@ -77,6 +79,8 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="end|top"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="?android:attr/textColorSecondary"
android:gravity="end"
android:layout_weight="1"/>

View File

@@ -102,6 +102,11 @@ public abstract class AccessibilityQuickSettingsPrimarySwitchPreferenceControlle
}
private void showQuickSettingsTooltipIfNeeded() {
if (mPreference == null) {
// Returns if no preference found by slice highlight menu.
return;
}
final ComponentName tileComponentName = getTileComponentName();
if (tileComponentName == null) {
// Returns if no tile service assigned.

View File

@@ -108,6 +108,7 @@ class TextReadingPreviewController extends BasePreferenceController implements
final PreviewPagerAdapter pagerAdapter = new PreviewPagerAdapter(mContext, isLayoutRtl,
PREVIEW_SAMPLE_RES_IDS, createConfig(origConfig));
mPreviewPreference.setPreviewAdapter(pagerAdapter);
mPreviewPreference.setCurrentItem(isLayoutRtl ? PREVIEW_SAMPLE_RES_IDS.length - 1 : 0);
pagerAdapter.setPreviewLayer(/* newLayerIndex= */ 0,
/* currentLayerIndex= */ 0,
/* currentFrameIndex= */ 0, /* animate= */ false);

View File

@@ -203,7 +203,9 @@ public class FingerprintEnrollEnrolling extends BiometricsEnrollEnrolling {
// Do NOT cancel enrollment progress after rotating, adding mIsOrientationChanged
// to judge if the focus changed was triggered by rotation, current WMS has triple callbacks
// (true > false > true), we need to reset mIsOrientationChanged when !hasFocus callback.
if (!mIsOrientationChanged) {
// Side fps do not have to synchronize udfpsController overlay state, we should bypass sfps
// from onWindowFocusChanged() as long press sfps power key will prompt dialog to users.
if (!mIsOrientationChanged && !mCanAssumeSfps) {
onCancelEnrollment(FINGERPRINT_ERROR_USER_CANCELED);
} else {
mIsOrientationChanged = false;

View File

@@ -118,18 +118,29 @@ public class AccessibilityQuickSettingsPrimarySwitchPreferenceControllerTest {
mController = new TestAccessibilityQuickSettingsPrimarySwitchPreferenceController(mContext,
TEST_KEY);
when(mScreen.findPreference(mController.getPreferenceKey())).thenReturn(mPreference);
mController.displayPreference(mScreen);
}
@Test
public void setChecked_showTooltipView() {
mController.displayPreference(mScreen);
mController.setChecked(true);
assertThat(getLatestPopupWindow().isShowing()).isTrue();
}
@Test
public void setChecked_notCallDisplayPreference_notShowTooltipView() {
// Simulates the slice highlight menu that does not call {@link #displayPreference} before
// {@link #setChecked} called.
mController.setChecked(true);
assertThat(getLatestPopupWindow()).isNull();
}
@Test
public void setChecked_tooltipViewShown_notShowTooltipView() {
mController.displayPreference(mScreen);
mController.setChecked(true);
getLatestPopupWindow().dismiss();
mController.setChecked(false);
@@ -142,6 +153,7 @@ public class AccessibilityQuickSettingsPrimarySwitchPreferenceControllerTest {
@Test
@Config(shadows = ShadowFragment.class)
public void restoreValueFromSavedInstanceState_showTooltipView() {
mController.displayPreference(mScreen);
mController.setChecked(true);
final Bundle savedInstanceState = new Bundle();
savedInstanceState.putBoolean(KEY_SAVED_QS_TOOLTIP_RESHOW, /* value= */ true);

View File

@@ -222,6 +222,16 @@ public class FingerprintEnrollEnrollingTest {
);
}
@Test
public void fingerprintSfpsEnrollment_loseFocus_shouldNotCancel() {
initializeActivityFor(FingerprintSensorProperties.TYPE_POWER_BUTTON);
mActivity.onEnrollmentProgressChange(1, 1);
mActivity.onWindowFocusChanged(true);
verify(mActivity, never()).onCancelEnrollment(anyInt());
}
private void initializeActivityFor(int sensorType) {
final List<ComponentInfoInternal> componentInfo = new ArrayList<>();
final FingerprintSensorPropertiesInternal prop =