Fixed
Status Update
Comments
[Deleted User] <[Deleted User]> #2
Duplicate of internal issue
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 45a1bc4a15b5b10d0635d79fb55df2aced5a2a4a
Author: Alan Viverette <alanv@google.com>
Date: Thu May 14 18:06:25 2020
Only apply DayNight changes to Activity-hosted delegates
Dialogs can't receive configuration change callbacks, so there's no point
in updating their configurations. They'll have to be destroyed and re-
created by their host activities. Also, dialogs were eating the changes.
Fixes: 155379937
Test: NightModeForegroundDialogTestCase and appcompat test suite
Change-Id: Ifa18d9d42268ec8821223942dc6c817ecabbed7f
A appcompat/appcompat/src/androidTest/java/androidx/appcompat/app/NightModeDialogFragment.java
A appcompat/appcompat/src/androidTest/java/androidx/appcompat/app/NightModeForegroundDialogTestCase.kt
M appcompat/appcompat/src/main/java/androidx/appcompat/app/AppCompatDelegate.java
M appcompat/appcompat/src/main/java/androidx/appcompat/app/AppCompatDelegateImpl.java
[Deleted User] <[Deleted User]> #3
I think, sActiveDelegates
meant "live" delegates. Anyway, now there's a mess :(
private static final ArraySet<WeakReference<AppCompatDelegate>> sActivityDelegates;
private static final Object sActivityDelegatesLock;
static void addActiveDelegate(@NonNull AppCompatDelegate delegate);
static void removeActivityDelegate(@NonNull AppCompatDelegate delegate);
private static void removeDelegateFromActives(@NonNull AppCompatDelegate toRemove);
private static void applyDayNightToActiveDelegates();
Source:
Description
Version used:0.5
What steps will reproduce the problem?
1. Have a test wtih @RequiresDevice in the suite
2. Create an emulator with x86_64 ABI
3. Run suite from step #1 on emulator from #2
How are you running your tests (via Android Studio, Gradle, adb, etc.)?
Android Studio, but I don't think it matters
Expected output: @RequiresDevice test is not executed
Actual output: @RequiresDevice test IS executed
TestRequestBuilder$RequiresDeviceFilter checks for "goldfish" value on Build.HARDWARE which is correct for ABI x86, but not for ABI x86_64 - value is "ranchu" there.