utzcoz

utzcoz

Software Engineer. Free time for @robolectric @boringdroid @maruos.

Member Since 3 years ago

Beijing, China

Experience Points
42
follower
Lessons Completed
144
follow
Lessons Completed
855
stars
Best Reply Awards
28
repos

853 contributions in the last year

Pinned
⚡ Android Unit Testing Framework
⚡ Your phone is your PC.
⚡ boringdroid is an AOSP extending project based on AOSP(9.0 - 11.0), and it provides the patch set to use multi-window in AOSP default.
⚡ Personal blog powered by Jekyll.
Activity
Dec
6
21 hours ago
push

utzcoz push utzcoz/robolectric

utzcoz
utzcoz

Add custom JNI_INCLUDE_DIRS for Windows only

Signed-off-by: utzcoz [email protected]

utzcoz
utzcoz

Use write from unistd.h to replace mman.h for native SQLite on Windows

We can use it to replace mman.h to get more cross compatibility.

Signed-off-by: utzcoz [email protected]

utzcoz
utzcoz

Trying to support nativeruntime building for Windows

Only building now.

Signed-off-by: utzcoz [email protected]

commit sha: 9f72c484e283f0f899ca7ad7dbb87d7379ed0d3f

push time in 2 hours ago
Activity icon
delete

utzcoz in utzcoz/robolectric delete branch add-custom-JNI_INCLUDE_DIRS-for-Windows-only

deleted time in 2 hours ago
Activity icon
issue

utzcoz issue comment robolectric/robolectric

utzcoz
utzcoz

Trying to support nativeruntime building for Windows

Only building now. For https://github.com/robolectric/robolectric/issues/6791.

utzcoz
utzcoz

org.robolectric.annotation.processing.RobolectricProcessorTest > shouldGenerateMetaInfServicesFile FAILED Did not find a generated file corresponding to /C:/Users/username/robolectric/processor/build/resources/test/META-INF/services/org.robolectric.internal.ShadowProvider at app//org.robolectric.annotation.processing.RobolectricProcessorTest.shouldGenerateMetaInfServicesFile(RobolectricProcessorTest.java:167)

@hoisie, do you encounter this failed test when running tests in msys2?

Activity icon
issue

utzcoz issue comment robolectric/robolectric

utzcoz
utzcoz

Add custom JNI_INCLUDE_DIRS for Windows only

See related discussion at https://github.com/robolectric/robolectric/pull/6911.

utzcoz
utzcoz

I have tested it on Windows, and I can build nativeruntime on Windows.

push

utzcoz push utzcoz/robolectric

utzcoz
utzcoz

Fix ICU build problems on Windows

Signed-off-by: utzcoz [email protected]

commit sha: 7795bcc2d4d8344e1cdf2ba99be5dc266d554b57

push time in 2 hours ago
Activity icon
issue

utzcoz issue comment robolectric/robolectric

utzcoz
utzcoz

Add custom JNI_INCLUDE_DIRS for Windows only

See related discussion at https://github.com/robolectric/robolectric/pull/6911.

utzcoz
utzcoz

I force-pushed it with consistent code format for if, else and endif.

push

utzcoz push utzcoz/robolectric

utzcoz
utzcoz

Add custom JNI_INCLUDE_DIRS for Windows only

Signed-off-by: utzcoz [email protected]

commit sha: 29bad5294f3a3573fc3123a881d56dc4d36d36bc

push time in 2 hours ago
push

utzcoz push utzcoz/robolectric

utzcoz
utzcoz

Remove some Windows JNI configs

Signed-off-by: utzcoz [email protected]

utzcoz
utzcoz

Add custom JNI_INCLUDE_DIRS for Windows only

Signed-off-by: utzcoz [email protected]

commit sha: 9b4faceed09445ba9edb7364995f3c40cc5219d2

push time in 2 hours ago
Activity icon
delete

utzcoz in utzcoz/robolectric delete branch backport-FindJNI.cmake-from-cmake-v3.22.0

deleted time in 3 hours ago
pull request

utzcoz pull request robolectric/robolectric

utzcoz
utzcoz

Backport FindJNI.cmake from cmake v3.22.0

Backport FindJNI.cmake from cmake v3.22.0 with better Windows and aarch64 supporting.

Activity icon
issue

utzcoz issue comment robolectric/robolectric

utzcoz
utzcoz

Backport FindJNI.cmake from cmake v3.22.0

Backport FindJNI.cmake from cmake v3.22.0 with better Windows and aarch64 supporting.

utzcoz
utzcoz

I will test it on Windows, and close this PR.

Activity icon
issue

utzcoz issue comment robolectric/robolectric

utzcoz
utzcoz

Backport FindJNI.cmake from cmake v3.22.0

Backport FindJNI.cmake from cmake v3.22.0 with better Windows and aarch64 supporting.

utzcoz
utzcoz

What about just this? It seems like JAVA_HOME is required on Windows anyway, so a lot of the logic in findJni may not even be relevant for windows:

IF (WIN32)
  if(NOT DEFINED ENV{JAVA_HOME})
    message(FATAL_ERROR "JAVA_HOME is required in Windows")
  endif()
  # find_package JNI is broken on Windows, manually include header files
  set(JNI_INCLUDE_DIRS "$ENV{JAVA_HOME}/include" "$ENV{JAVA_HOME}/include/win32")
ELSE()
  find_package(JNI REQUIRED)
ENDIF()

It's more concise than before. I created a related PR https://github.com/robolectric/robolectric/pull/6914 for it.

pull request

utzcoz pull request robolectric/robolectric

utzcoz
utzcoz

Add custom JNI_INCLUDE_DIRS for Windows only

See related discussion at https://github.com/robolectric/robolectric/pull/6911.

Activity icon
created branch

utzcoz in utzcoz/robolectric create branch add-custom-JNI_INCLUDE_DIRS-for-Windows-only

createdAt 3 hours ago
Activity icon
issue

utzcoz issue comment robolectric/robolectric

utzcoz
utzcoz

Backport FindJNI.cmake from cmake v3.22.0

Backport FindJNI.cmake from cmake v3.22.0 with better Windows and aarch64 supporting.

utzcoz
utzcoz

I renamed FindROBOJNI to FindJNI to try to fix warnings when testing it on Windows.

push

utzcoz push utzcoz/robolectric

utzcoz
utzcoz

Use backport JNI for nativeruntime

Signed-off-by: utzcoz [email protected]

commit sha: 17b759345c9186ce2b5097fab91c92e14596ea1b

push time in 3 hours ago
push

utzcoz push utzcoz/robolectric

utzcoz
utzcoz

Remove unnecessary DatePickerDialog constructor shadow

The constructor shadow just calls the original constructor, so it's redundant and can be removed.

PiperOrigin-RevId: 413084646

utzcoz
utzcoz

Add matrix computation support to ShadowRenderNode implementations

PiperOrigin-RevId: 403792961

utzcoz
utzcoz

Add support for building Robolectric's nativeruntime with gcc/g++

g++ is sensitive to the order of libraries in command-line arguments. It requires -ldl to be provided after the ICU static libraries, not before. Update the order by placing -ldl and -lpthread as part of the androidsqlite project, where they are required.

PiperOrigin-RevId: 413475269

utzcoz
utzcoz

Switch to Ninja for building the native runtime

The version of make provided in the MSYS2 does not work well with CMake on Windows. This makes it impossible to do incremental nativeruntme builds on Windows.

See https://stackoverflow.com/questions/2401976 for more details on the issue.

Switch to using Ninja everywhere, which seems to be more reliable across platforms.

PiperOrigin-RevId: 413717789

utzcoz
utzcoz

Close android.database.Cursor objects in tests

Around 30-40% of log lines in GitHub CI contain CloseGuard stack traces from open cursors being closed.

Also close some ContentProviderClient objects.

PiperOrigin-RevId: 413737346

utzcoz
utzcoz

Fix remaining CloseGuard warnings in Robolectric tests

CloseGuard warnings and stack traces accounted for ~40% of log lines during Robolectric tests.

This will remove around ~3.5k CloseGuard errors and stack traces in the Robolectric test suite.

PiperOrigin-RevId: 413781118

utzcoz
utzcoz
  1. Adds ShadowVibrator#addSupportedPrimitives to enable shadowing of Vibrator#areAllPrimitivesSupported.
  2. Creates ShadowVibrator#mHandler using main looper to avoid getting null from Looper#myLooper in some occasions.
  3. Stores VibrationEffectSegments in ShadowVibrator and exposes a getter to enable verification of VibrationEffect created by VibrationEffect#startComposition.

PiperOrigin-RevId: 413689184

utzcoz
utzcoz

Use real Android code for ContentProviderClient.release

This fixes two issues:

  1. Because 'release' was shadowed, the underlying CloseGuard for the ContentProviderClient was never closed, leading to CloseGuard errors that could not be suppressed.

  2. The behavior of 'release' was not correct for SDK > 23, where calling it multiple times does not result in an IllegalStateException.

Also, update ShadowContentProviderClientTest to use a real ContentProvider, and remove the interaction test. Trying to release a ContentProviderClient for a mock ContentProvider results in an exception.

PiperOrigin-RevId: 413795247

utzcoz
utzcoz

Update platformStrError to work in Windows

PiperOrigin-RevId: 413996788

utzcoz
utzcoz

Add setIsUniqueDeviceAttestationSupported and isUniqueDeviceAttestationSupported support to ShadowDevicePolicyManager

PiperOrigin-RevId: 413572634

utzcoz
utzcoz

Backport FindJNI.cmake from cmake v3.22.0

Signed-off-by: utzcoz [email protected]

utzcoz
utzcoz

Use backport JNI for nativeruntime

Signed-off-by: utzcoz [email protected]

commit sha: 8fc8887c00be9cc220a624206657a2c5f8b8a9a0

push time in 3 hours ago
Activity icon
issue

utzcoz issue comment robolectric/robolectric

utzcoz
utzcoz

Backport FindJNI.cmake from cmake v3.22.0

Backport FindJNI.cmake from cmake v3.22.0 with better Windows and aarch64 supporting.

utzcoz
utzcoz

The v3.22.0 contains fixes I found for FindJNI. Does it also have problem on Windows?

push

utzcoz push utzcoz/robolectric

utzcoz
utzcoz

Remove unnecessary DatePickerDialog constructor shadow

The constructor shadow just calls the original constructor, so it's redundant and can be removed.

PiperOrigin-RevId: 413084646

utzcoz
utzcoz

Add matrix computation support to ShadowRenderNode implementations

PiperOrigin-RevId: 403792961

utzcoz
utzcoz

Add support for building Robolectric's nativeruntime with gcc/g++

g++ is sensitive to the order of libraries in command-line arguments. It requires -ldl to be provided after the ICU static libraries, not before. Update the order by placing -ldl and -lpthread as part of the androidsqlite project, where they are required.

PiperOrigin-RevId: 413475269

utzcoz
utzcoz

Switch to Ninja for building the native runtime

The version of make provided in the MSYS2 does not work well with CMake on Windows. This makes it impossible to do incremental nativeruntme builds on Windows.

See https://stackoverflow.com/questions/2401976 for more details on the issue.

Switch to using Ninja everywhere, which seems to be more reliable across platforms.

PiperOrigin-RevId: 413717789

utzcoz
utzcoz

Close android.database.Cursor objects in tests

Around 30-40% of log lines in GitHub CI contain CloseGuard stack traces from open cursors being closed.

Also close some ContentProviderClient objects.

PiperOrigin-RevId: 413737346

utzcoz
utzcoz

Fix remaining CloseGuard warnings in Robolectric tests

CloseGuard warnings and stack traces accounted for ~40% of log lines during Robolectric tests.

This will remove around ~3.5k CloseGuard errors and stack traces in the Robolectric test suite.

PiperOrigin-RevId: 413781118

utzcoz
utzcoz
  1. Adds ShadowVibrator#addSupportedPrimitives to enable shadowing of Vibrator#areAllPrimitivesSupported.
  2. Creates ShadowVibrator#mHandler using main looper to avoid getting null from Looper#myLooper in some occasions.
  3. Stores VibrationEffectSegments in ShadowVibrator and exposes a getter to enable verification of VibrationEffect created by VibrationEffect#startComposition.

PiperOrigin-RevId: 413689184

utzcoz
utzcoz

Use real Android code for ContentProviderClient.release

This fixes two issues:

  1. Because 'release' was shadowed, the underlying CloseGuard for the ContentProviderClient was never closed, leading to CloseGuard errors that could not be suppressed.

  2. The behavior of 'release' was not correct for SDK > 23, where calling it multiple times does not result in an IllegalStateException.

Also, update ShadowContentProviderClientTest to use a real ContentProvider, and remove the interaction test. Trying to release a ContentProviderClient for a mock ContentProvider results in an exception.

PiperOrigin-RevId: 413795247

utzcoz
utzcoz

Update platformStrError to work in Windows

PiperOrigin-RevId: 413996788

utzcoz
utzcoz

Add setIsUniqueDeviceAttestationSupported and isUniqueDeviceAttestationSupported support to ShadowDevicePolicyManager

PiperOrigin-RevId: 413572634

utzcoz
utzcoz

Trying to support nativeruntime building for Windows

Only building now.

Signed-off-by: utzcoz [email protected]

utzcoz
utzcoz

Use write from unistd.h to replace mman.h for native SQLite on Windows

We can use it to replace mman.h to get more cross compatibility.

Signed-off-by: utzcoz [email protected]

utzcoz
utzcoz

Backport FindJNI.cmake from cmake v3.22.0

Signed-off-by: utzcoz [email protected]

utzcoz
utzcoz

Use backport ROBOJNI for nativeruntime

Signed-off-by: utzcoz [email protected]

commit sha: ee92f5c25567e08dfa0e09fbb7c19fef7410381e

push time in 4 hours ago
push

utzcoz push utzcoz/robolectric

utzcoz
utzcoz

Remove unnecessary DatePickerDialog constructor shadow

The constructor shadow just calls the original constructor, so it's redundant and can be removed.

PiperOrigin-RevId: 413084646

utzcoz
utzcoz

Add matrix computation support to ShadowRenderNode implementations

PiperOrigin-RevId: 403792961

utzcoz
utzcoz

Add support for building Robolectric's nativeruntime with gcc/g++

g++ is sensitive to the order of libraries in command-line arguments. It requires -ldl to be provided after the ICU static libraries, not before. Update the order by placing -ldl and -lpthread as part of the androidsqlite project, where they are required.

PiperOrigin-RevId: 413475269

utzcoz
utzcoz

Switch to Ninja for building the native runtime

The version of make provided in the MSYS2 does not work well with CMake on Windows. This makes it impossible to do incremental nativeruntme builds on Windows.

See https://stackoverflow.com/questions/2401976 for more details on the issue.

Switch to using Ninja everywhere, which seems to be more reliable across platforms.

PiperOrigin-RevId: 413717789

utzcoz
utzcoz

Close android.database.Cursor objects in tests

Around 30-40% of log lines in GitHub CI contain CloseGuard stack traces from open cursors being closed.

Also close some ContentProviderClient objects.

PiperOrigin-RevId: 413737346

utzcoz
utzcoz

Fix remaining CloseGuard warnings in Robolectric tests

CloseGuard warnings and stack traces accounted for ~40% of log lines during Robolectric tests.

This will remove around ~3.5k CloseGuard errors and stack traces in the Robolectric test suite.

PiperOrigin-RevId: 413781118

utzcoz
utzcoz
  1. Adds ShadowVibrator#addSupportedPrimitives to enable shadowing of Vibrator#areAllPrimitivesSupported.
  2. Creates ShadowVibrator#mHandler using main looper to avoid getting null from Looper#myLooper in some occasions.
  3. Stores VibrationEffectSegments in ShadowVibrator and exposes a getter to enable verification of VibrationEffect created by VibrationEffect#startComposition.

PiperOrigin-RevId: 413689184

utzcoz
utzcoz

Use real Android code for ContentProviderClient.release

This fixes two issues:

  1. Because 'release' was shadowed, the underlying CloseGuard for the ContentProviderClient was never closed, leading to CloseGuard errors that could not be suppressed.

  2. The behavior of 'release' was not correct for SDK > 23, where calling it multiple times does not result in an IllegalStateException.

Also, update ShadowContentProviderClientTest to use a real ContentProvider, and remove the interaction test. Trying to release a ContentProviderClient for a mock ContentProvider results in an exception.

PiperOrigin-RevId: 413795247

utzcoz
utzcoz

Update platformStrError to work in Windows

PiperOrigin-RevId: 413996788

utzcoz
utzcoz

Add setIsUniqueDeviceAttestationSupported and isUniqueDeviceAttestationSupported support to ShadowDevicePolicyManager

PiperOrigin-RevId: 413572634

commit sha: f40cea11cc970fa9780a97b4f14699e636e6ba89

push time in 4 hours ago
Activity icon
wiki
created time in 4 hours ago
push

utzcoz push utzcoz/robolectric

utzcoz
utzcoz

Remove unnecessary DatePickerDialog constructor shadow

The constructor shadow just calls the original constructor, so it's redundant and can be removed.

PiperOrigin-RevId: 413084646

utzcoz
utzcoz

Add matrix computation support to ShadowRenderNode implementations

PiperOrigin-RevId: 403792961

utzcoz
utzcoz

Add support for building Robolectric's nativeruntime with gcc/g++

g++ is sensitive to the order of libraries in command-line arguments. It requires -ldl to be provided after the ICU static libraries, not before. Update the order by placing -ldl and -lpthread as part of the androidsqlite project, where they are required.

PiperOrigin-RevId: 413475269

utzcoz
utzcoz

Switch to Ninja for building the native runtime

The version of make provided in the MSYS2 does not work well with CMake on Windows. This makes it impossible to do incremental nativeruntme builds on Windows.

See https://stackoverflow.com/questions/2401976 for more details on the issue.

Switch to using Ninja everywhere, which seems to be more reliable across platforms.

PiperOrigin-RevId: 413717789

utzcoz
utzcoz

Close android.database.Cursor objects in tests

Around 30-40% of log lines in GitHub CI contain CloseGuard stack traces from open cursors being closed.

Also close some ContentProviderClient objects.

PiperOrigin-RevId: 413737346

utzcoz
utzcoz

Fix remaining CloseGuard warnings in Robolectric tests

CloseGuard warnings and stack traces accounted for ~40% of log lines during Robolectric tests.

This will remove around ~3.5k CloseGuard errors and stack traces in the Robolectric test suite.

PiperOrigin-RevId: 413781118

utzcoz
utzcoz
  1. Adds ShadowVibrator#addSupportedPrimitives to enable shadowing of Vibrator#areAllPrimitivesSupported.
  2. Creates ShadowVibrator#mHandler using main looper to avoid getting null from Looper#myLooper in some occasions.
  3. Stores VibrationEffectSegments in ShadowVibrator and exposes a getter to enable verification of VibrationEffect created by VibrationEffect#startComposition.

PiperOrigin-RevId: 413689184

utzcoz
utzcoz

Use real Android code for ContentProviderClient.release

This fixes two issues:

  1. Because 'release' was shadowed, the underlying CloseGuard for the ContentProviderClient was never closed, leading to CloseGuard errors that could not be suppressed.

  2. The behavior of 'release' was not correct for SDK > 23, where calling it multiple times does not result in an IllegalStateException.

Also, update ShadowContentProviderClientTest to use a real ContentProvider, and remove the interaction test. Trying to release a ContentProviderClient for a mock ContentProvider results in an exception.

PiperOrigin-RevId: 413795247

utzcoz
utzcoz

Update platformStrError to work in Windows

PiperOrigin-RevId: 413996788

utzcoz
utzcoz

Add setIsUniqueDeviceAttestationSupported and isUniqueDeviceAttestationSupported support to ShadowDevicePolicyManager

PiperOrigin-RevId: 413572634

utzcoz
utzcoz

Add test packageInstallerAndGetPackageInfo for ShadowPackageManagerTest

Signed-off-by: utzcoz [email protected]

utzcoz
utzcoz

Remove unused Exception from test methods for ShadowPackageManagerTest

Signed-off-by: utzcoz [email protected]

commit sha: 6260e01341a7452c24bb0cf9efb6af69b5076705

push time in 4 hours ago
Activity icon
delete

utzcoz in utzcoz/Taskbar delete branch bump-Robolectric-to-4.7.3

deleted time in 4 hours ago
Activity icon
issue

utzcoz issue comment robolectric/robolectric

utzcoz
utzcoz

Backport FindJNI.cmake from cmake v3.22.0

Backport FindJNI.cmake from cmake v3.22.0 with better Windows and aarch64 supporting.

utzcoz
utzcoz

It's more concise than current full FindJNI. But it adds a new JAVA_HOME environment dependency. In Linux, FindJNI doesn't need JAVA_HOME, and it can find real java home correctly. If need, I can create a new PR for only including with JAVA_HOME.

started
started time in 18 hours ago
started
started time in 18 hours ago
Previous