There is actually already a public API overload for
Context.bindService() which allows binding the service with the user
of Context.getUser() and a custom Executor.
We can construct an Executor from our Handler, but this executor is
required to remain the same instance for different calls to
bindService() for the same ServiceConnection by the API, so we should
keep the Executor instance, as well as the Handler instance, instead
of calling getJobHandler() every time. In fact getJobHandler() is
already required to return the same instance, or bindServiceAsUser()
would have thrown the same exception for different Handlers.
Also removed a check in ContextImpl.bindService() to allow mainline
modules to use the bindService() API with Context multi-user.
Bug: 158736025
Test: presubmit
Change-Id: I95717a4a74267dff4fbe1898a82cdfa7f195cc06
The first parameter of adding idle timer is an unique identity
to communicate between ConnectivityService and netd. Netd will
notify the activity change using the identity, so it's fine to
replace the legacy type with transport type since we should
deprecate the usage of legacy type.
Bug: 170598012
Test: atest FrameworksNetTests
Change-Id: Ia00606539b86872cca9a92285bd940c8a720a033
The existing DropBoxManager APIs require that data be entirely
pre-cooked before it can be added. This adds significant overhead
to Log.wtf() style messages which collect logcat data, since we
need to copy that log data through a pipe to an in-memory buffer.
To avoid that overhead, this change introduces an EntrySource
interface which can either be pre-cooked data or dynamically
generated data written directly to an open FD on disk. Future
changes will adjust the Log.wtf() logic to use this new interface
to have logcat write directly into an FD.
In addition, this interface paves the way for leveraging a newer
F2FS feature which transparently compresses and decompresses data in
the kernel, instead of forcing us to use DEFLATE in userspace.
This change drops periodic quota checking while recording new
entries, and instead adjusts to pre-flight the quota checks before
writing starts. It also drops the expensive fsync(), since these
logs are collected on a best-effort basis.
Bug: 176843501
Test: atest CtsDropBoxManagerTestCases
Test: atest FrameworksServicesTests:com.android.server.DropBoxTest
Change-Id: Ic78e99a32cfaf4edac066a73a6864c9c9e9fdeef
Total CPU time in state added in https://r.android.com/1538886.
Bug: 174245730
Test: cmd stats pull-source 10095
Change-Id: I6cd27ac172e36d2e889429808bd4bd583795d7c9
The CountDownLatch#await() will be unblocked if there is an
InterruptedException happened.
Then it will cause the UnsupportedOperationException when
calling Completable.ValueBase#enforceGetValueLocked(),
Add a retry mechanism if InterruptedException happened.
Bug: 176441559
Test: atest CtsInputMethodTestCases
Change-Id: I6b93e76f78b4b8c94fc4423c33a707207961816d
Add API to set IME will temporarily consumes the input, for
this case, the cursor will be invisible in the app.
Bug: 175362887
Test: atest FrameworksCoreTests:TextViewTest
Test: atest CtsWidgetTestCases:TextViewTest
Change-Id: Ic04cacfd73f1f4cb254bb16caf6b04c00c91a318
Shortening Cuj<> to a more meaningful J<> for jank.
Using L<> for latency will make it easier to search for
Latency traces in trace tools. Using getNameOfAction() for
latencies in all places will simplify finding latencies in code.
Test: manual
Bug: 177018359
Change-Id: Ie3114e7d7f97e7950af19a014d06f5c632a607c3
With this CL the annotation is only digested, but has no behaviour
change yet. Eventually this annotation allows the annotated change id to
be overriden on non-debug builds
Bug: 174043039
Test: atest FrameworksServicesTests:PlatformCompatTest
Change-Id: Ibc1fce37085213b5a02155010189949e193f0882
Add IVoidResultCallback mechanism to emulate
current behavior.
Bug: 163453493
Test: Manual test with keyboard
Test: atest CtsInputMethodTestCases
Change-Id: I009d3a6e09c98166c08e8b9b318d821be36c42a7
By moving to system APIs when applicable. Notable changes include:
1. Re-implement reading/writing Throwables from/to Parcel, without
Parcel private APIs.
2. Use the public API new Handler(Looper.getMainLooper()) instead of
Handler.getMain().
3. Use lambdas directly instead of PooledLambda, because the latter
would require bundling 20+ classes to bootclasspath for each module
using it, while AndroidFuture and ServiceConnector won't be creating a
great number of lambdas in a short time.
4. A bug that calls initCause() with the Throwable itself is fixed.
Bug: 158736025
Test: presubmit
Change-Id: I577da5a3bc4ed537123b7eceaa5addf8f7bb0d92