Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit f44c09c2 authored by Eran Messeri's avatar Eran Messeri
Browse files

Refactoring: Helper method for calling with clean binder identity

Introduce a helper method for executing a runnable that returns a value
with the binder caller's identity cleared.

Replace multiple call sites which employed the pattern of saving the
caller identity, clearing it and restoring it in the 'finally' block.

This would make the code safer as there'd be no chance of forgetting to
restore the caller's identity or restoring the wrong caller's identity.
This refactoring introduces no functional changes.

Bug: 146552069
Test: atest CtsDevicePolicyManagerTestCases:com.android.cts.devicepolicy.MixedDeviceOwnerTest
Test: atest FrameworksServicesTests:DevicePolicyManagerTest
Change-Id: I7eb84b00009778580560fa5f0bdd0a584f1d454b
parent 8ffc40aa
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