Skip to content

Commit

Permalink
Add missing comments in workarounds
Browse files Browse the repository at this point in the history
The implementation of workarounds uses a lot of reflection code. For
better readability, always write the equivalent using direct Java code.
  • Loading branch information
rom1v committed Dec 14, 2024
1 parent ec4e826 commit 6926470
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions server/src/main/java/com/genymobile/scrcpy/Workarounds.java
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,13 @@ private static void fillConfigurationController() {
try {
Class<?> configurationControllerClass = Class.forName("android.app.ConfigurationController");
Class<?> activityThreadInternalClass = Class.forName("android.app.ActivityThreadInternal");

// configurationController = new ConfigurationController(ACTIVITY_THREAD);
Constructor<?> configurationControllerConstructor = configurationControllerClass.getDeclaredConstructor(activityThreadInternalClass);
configurationControllerConstructor.setAccessible(true);
Object configurationController = configurationControllerConstructor.newInstance(ACTIVITY_THREAD);

// ACTIVITY_THREAD.mConfigurationController = configurationController;
Field configurationControllerField = ACTIVITY_THREAD_CLASS.getDeclaredField("mConfigurationController");
configurationControllerField.setAccessible(true);
configurationControllerField.set(ACTIVITY_THREAD, configurationController);
Expand Down

0 comments on commit 6926470

Please sign in to comment.