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

Skip to content
Commit 23a0529e authored by Lee Shombert's avatar Lee Shombert
Browse files

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
parent e3336d5c
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