Skip to content
Commit d91df331 authored by Jared Duke's avatar Jared Duke
Browse files

Keep UserManagerInternal fields referenced with reflection

Several constant fields in UserManagerInternal are referenced by
way of DebugUtils.constantToString. This tool relies on reflection to
fully populate the field names, but these fields are inlined and removed
by R8 after shrinking. For now, expicitly keep these fields to preserve
the desired behavior.

A better solution might involve an annotation on the method that
triggers the DebugUtils.constantToString call, to keep any fields with
the desired prefix.

Note that there are a few other uses of reflection via DebugUtils in
system_server, but they are generally for framework classes that are not
shrunk by R8, so don't have the same issue.

Bug: 265860655
Test: dexdump services.jar | grep 'USER_START_MODE_'
Change-Id: I79aeeba4e4dd6f52a6f37c70f27d0778ff87d5f8
parent cedba056
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment