Put AnrTimer behind a feature flag
Add the trunk-stable flag anr_timer_service_enabled that gates the AnrTimer feature. If the feature is disabled, the AnrTimer external methods short-circuit and provide the basic message handler behaviors of sendMessageDelayed() and removeMessages(). The AnrTimer class can take the flag value from an Injector; this is used in the unit test so that AnrTimer can be tested even when the flag is disabled in the build. The notion of a soft delivery timeout is reinstated in BroadcastQueueModernImpl. AnrTimer handles this internally but the stubbed class (with the feature disabled) cannot handle it internally. Test: atest * FrameworksServicesTests:com.android.server.am * FrameworksMockingServicesTests:com.android.server.am * CtsAppTestCases Bug: 282428924 Change-Id: I5c9e03543539e66a0b84df4eb0de66588ffc6e8b
Loading
Please register or sign in to comment