Do not override SUW Glif theme when onApplyThemeResource() callback

1. Accodring to settings & setupdesign lib theme architecture
Only force apply sytle SetupWizardPartnerResource for current
activity/contextThemeWrapper is sufficient, override GlifV3Theme
again will cause incorrect resource mapping of private attributes.

2. Set Theme_AlertDialog style for AlertDialog in for Material design
- FingerprintEnrollEnrolling
- FingerprintEnrollFindSensor

3. Add test for AlertDialog theme, and fix broken test cases

Fixes: 245684949
Bug: 249789759
Bug: 248994476
Test: manual in SUW `adb shell cmd uimode night yes` and check visual
Test: manual in SUW enrolling check timeout dialog apply theme
Test: manual in SUW enroll UDFPS tips lottie view showing expectedly
Test: manual in SUW enroll UDFPS landscape showing correct layout
Test: m RunSettingsRoboTests -j30 ROBOTEST_FILTER= \
      SetupFingerprintEnrollFindSensorTest
Test: m RunSettingsRoboTests -j30 ROBOTEST_FILTER= \
      FingerprintEnrollEnrollingTest
Test: m RunSettingsRoboTests -j30 ROBOTEST_FILTER= \
      FingerprintEnrollFindSensorTest
Change-Id: I17cbf26e38318e6681ba124d23bf86317a0f1e1d
This commit is contained in:
lbill
2022-09-29 14:55:21 +00:00
parent 995dbc4f45
commit 39175b2f87
6 changed files with 27 additions and 17 deletions

View File

@@ -64,7 +64,6 @@ import androidx.appcompat.app.AlertDialog;
import com.android.internal.annotations.VisibleForTesting;
import com.android.settings.R;
import com.android.settings.SetupWizardUtils;
import com.android.settings.biometrics.BiometricEnrollSidecar;
import com.android.settings.biometrics.BiometricUtils;
import com.android.settings.biometrics.BiometricsEnrollEnrolling;
@@ -216,9 +215,8 @@ public class FingerprintEnrollEnrolling extends BiometricsEnrollEnrolling {
@Override
protected void onApplyThemeResource(Resources.Theme theme, int resid, boolean first) {
final int newResid = SetupWizardUtils.getTheme(this, getIntent());
theme.applyStyle(R.style.SetupWizardPartnerResource, true);
super.onApplyThemeResource(theme, newResid, first);
super.onApplyThemeResource(theme, resid, first);
}
@Override
@@ -1062,7 +1060,8 @@ public class FingerprintEnrollEnrolling extends BiometricsEnrollEnrolling {
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity(),
R.style.Theme_AlertDialog);
builder.setTitle(R.string.security_settings_fingerprint_enroll_touch_dialog_title)
.setMessage(R.string.security_settings_fingerprint_enroll_touch_dialog_message)
.setPositiveButton(R.string.security_settings_fingerprint_enroll_dialog_ok,