OSDN Git Service

Replace the RequestRecommendationCaller if the timeout changes.
authorJeremy Joslin <jjoslin@google.com>
Tue, 17 Jan 2017 23:48:13 +0000 (15:48 -0800)
committerJeremy Joslin <jjoslin@google.com>
Thu, 19 Jan 2017 21:25:50 +0000 (13:25 -0800)
commit8b9226b487b1f38de840f22f830b62dc05df457d
treeb793ddb0058b44763e8cf954baad4ca2e4bfb210
parent44e2b84b27dea139796299528e5cdd3abc4640f7
Replace the RequestRecommendationCaller if the timeout changes.

The timeout associated with a TimedRemoteCaller can't be changed
after creation so we have to create a new instance anytime the
timeout changes (which shouldn't be too often). The instance is
stored and retrieved from an AtomicReference to avoid concurrency
issues.

Test: runtest frameworks-services -c com.android.server.NetworkScoreServiceTest
Bug: 34060959
Change-Id: I52f5d617feb9b3536ff3474b5d032113e3caea5c
Merged-In: I1662ac27f7442a16d2ffd7257469f1983b7f0e5c
services/core/java/com/android/server/NetworkScoreService.java