diff options
| author | 2024-11-06 11:40:53 -0800 | |
|---|---|---|
| committer | 2024-11-06 11:40:53 -0800 | |
| commit | 1008b3e89dc1def5a8c0261d3c8786feeeb8a248 (patch) | |
| tree | 0964574fe7ff6b51431cf5fdb1d42d5b1bc39f10 | |
| parent | b0c550dcb2433e2f26fe8f250b299623bf1c894f (diff) | |
java FlagImpl: Clear context without instrumentat
The original change Idecda9c357f6a92b9b4a63b2ec9b0c04ff441a6d
logically conflicted with I4f1872b5d6da5167c69cd236925fee4d622c7487
Add the same logic to else side of the allow_instrumentation block.
Test: atest aconfig.test.java
Bug: 375288788
Change-Id: I3d19f8ad23a07889a69925118a221d147d13a7b1
| -rw-r--r-- | tools/aconfig/aconfig/templates/FeatureFlagsImpl.java.template | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/aconfig/aconfig/templates/FeatureFlagsImpl.java.template b/tools/aconfig/aconfig/templates/FeatureFlagsImpl.java.template index ec86806fdf..cb52150f02 100644 --- a/tools/aconfig/aconfig/templates/FeatureFlagsImpl.java.template +++ b/tools/aconfig/aconfig/templates/FeatureFlagsImpl.java.template @@ -125,6 +125,7 @@ import android.compat.annotation.UnsupportedAppUsage; {{ -endif }} {{ -if runtime_lookup_required }} +import android.os.Binder; import android.provider.DeviceConfig; import android.provider.DeviceConfig.Properties; {{ -endif }} @@ -142,6 +143,7 @@ public final class FeatureFlagsImpl implements FeatureFlags \{ {{ -endfor }} {{ for namespace_with_flags in namespace_flags }} private void load_overrides_{namespace_with_flags.namespace}() \{ + final long ident = Binder.clearCallingIdentity(); try \{ Properties properties = DeviceConfig.getProperties("{namespace_with_flags.namespace}"); {{ -for flag in namespace_with_flags.flags }} @@ -159,6 +161,8 @@ public final class FeatureFlagsImpl implements FeatureFlags \{ + "flag declaration.", e ); + } finally \{ + Binder.restoreCallingIdentity(ident); } {namespace_with_flags.namespace}_is_cached = true; } |