Clean up AnrTimer argument passing
AnrTimer is slated to get more configuration options. Simply adding new options to constructors will not scale. This CL makes the AnrTimer class takes its options via a new Args nested class. The three required parameters to the class are still provided inline; the Args instance is used for optional parameters. This addresses a previous code review comment. Also, the "extend" option is now provided to the native layer when the native timer service is created. It is no longer specified when individual timers are started. Also, the logic to ref-count the native Ticker instance has been removed. AnrTimer is used by ActivityManager and is thus immortal. The logic to delete (and recreate) on demand is probably buggy and will never be used in production code. This change is being done now, before the feature gets promoted out of trunk-staging. Test: atest * FrameworksServicesTests:com.android.server.am * FrameworksMockingServicesTests:com.android.server.am * FrameworksServicesTests:AnrTimerTest Flag: com.android.server.utils.anr_timer_service Bug: 325594551 Change-Id: I0e8455ad61ca9d9395868c95c828661d39d0efca
Loading
Please register or sign in to comment