Commit Graph

10273 Commits

Author SHA1 Message Date
Misha Wagner
474e7bece0 Filter threads that have low total CPU usage for CpuTimePerThreadFreq
Test: KernelCpuThreadReader::testReader_filtersLowTotalCpuUsage
Bug: 120016054
Change-Id: If09c8c01e6efffd0d7315613dc7425138528d39c
2018-11-26 16:25:59 +00:00
Marcin Oczeretko
8e90ada67e Merge "LooperStats - add debug entries to output for data validation" 2018-11-23 14:11:40 +00:00
Nicolas Geoffray
850f109ec8 Merge "Start using shared libraries class loader." 2018-11-22 10:24:38 +00:00
Nicolas Geoffray
8d144eb8bd Start using shared libraries class loader.
Change 1/2. Change 2/2 will setup the class loader namespace for
shared libraries.

This change sets up shared libraries class loaders for applications
and for dexopt.

bug: 111174995
Test: DexoptUtilsTest, device boots

Change-Id: Ie9a2b4eaa85cda59951703433f7a2d03bc12095d
2018-11-22 10:06:41 +00:00
Marcin Oczeretko
d32a513541 LooperStats - add debug entries to output for data validation
Test: UT and manually verified that debug entries are included in
adb shell dumpsys looper_stats

Change-Id: Ie2166974cffd18a719aaa06f6e3525eb0337d2a1
2018-11-21 11:51:16 +00:00
Misha Wagner
b96bd1a7d7 Add Pixel 3 time_in_state format parsing to KernelTimeInStateReader
Bug: 119090941
Test: Unit tests in ProcTimeInStateReaderTest

Change-Id: I598672809ccd44e6035ff7baf9f372a6d6cf211a
2018-11-21 10:37:37 +00:00
Misha Wagner
dc797543b8 Add retrieval of thread CPU data for processes owned by specified UIDs
By default, the UIDs collected are all system users, i.e. UIDs in the range
[1000, 2000).

Bug: 119089294
Test: KernelCpuThreadReaderTest#testReader_byUids

Change-Id: I162916f2238aad975b657c9299cb9035718768bb
2018-11-21 10:37:37 +00:00
Eugene Susla
9734fa5330 Merge "Remove exclusive OWNERS for BitUtils" am: 26aff41aa5 am: 60e62c4e20
am: 6b833a4df8

Change-Id: I118be8a8b35a860192aeaebbd7364cd1a3cbf28f
2018-11-19 17:54:04 -08:00
Eugene Susla
6b833a4df8 Merge "Remove exclusive OWNERS for BitUtils" am: 26aff41aa5
am: 60e62c4e20

Change-Id: I5ff9051230f1f24277f8c864ab99a400accd4c3d
2018-11-19 17:44:39 -08:00
Treehugger Robot
26aff41aa5 Merge "Remove exclusive OWNERS for BitUtils" 2018-11-20 01:20:44 +00:00
Eugene Susla
a931f9eec0 Remove exclusive OWNERS for BitUtils
BitUtils is a fairly generic place where all framework engineers should
be able to contribute reusable code.

Test: test after merge in gerrit UI
Change-Id: Ibd00f0618e3e85aab466cedc43605115994cca4f
2018-11-19 14:38:12 -08:00
Misha Wagner
4f8bb6665c Merge "Add frequency bucketing to per-thread CPU usage reading" 2018-11-19 14:45:18 +00:00
Olivier Gaillard
e7ce49d152 Merge "Rename WorkSource methods on Binder and IPCThreadState." 2018-11-19 11:01:23 +00:00
Misha Wagner
0c5edc3647 Add frequency bucketing to per-thread CPU usage reading
This means that instead of returning all frequencies, we return
KernelCpuReader#NUM_BUCKETS frequencies.

Test: Unit tests for bucket creation and usage in KernelCpuThreadReaderTest

Change-Id: Iea0996f642deecae8ce66e5122045a0694fac03b
2018-11-19 10:24:38 +00:00
Peter Collingbourne
31b9aa5d54 Merge "Preserve x18 while preloading SP-HALs in the zygote." am: 23fd045842 am: e03a81cce8
am: ceebc76cb2

Change-Id: Ib2472f7f1d6068f1b232a459a748c441b47e7637
2018-11-15 16:25:47 -08:00
Peter Collingbourne
ceebc76cb2 Merge "Preserve x18 while preloading SP-HALs in the zygote." am: 23fd045842
am: e03a81cce8

Change-Id: I577e0964abbf758234af6f80dcc69a55ee57d736
2018-11-15 16:10:08 -08:00
Peter Collingbourne
23fd045842 Merge "Preserve x18 while preloading SP-HALs in the zygote." 2018-11-15 23:38:36 +00:00
Adam Bookatz
0dee99a7c7 Merge "Statsd atom: Power Use" 2018-11-15 20:20:08 +00:00
Ivan Chiang
9d2ae77ce7 Merge "Extend DocumentsContract search to accept mime types" 2018-11-15 11:07:38 +00:00
Olivier Gaillard
d542b1c3c6 Rename WorkSource methods on Binder and IPCThreadState.
This change only renames methods, there is no behavior changes except
using the new restore methods instead of clear.

Test: unit tests
Change-Id: I35ae966461657e2e2a67e916d752b9ee53381c83
2018-11-15 09:56:37 +00:00
Bookatz
75ee604244 Statsd atom: Power Use
BatteryStats calculates power usage of the device and various components
(such as apps). This information is used, e.g., in the battery panel of
Settings. We now log it to statsd. It can be used for validating how
good the information displayed in Settings is. In the long-term, it is
likely not ideal for off-device calculations, since that can be
hopefully estimated using statsd's raw data.

Three atoms: one for the total power use, one for the power use of each
uid, and one for each non-uid component. Since they will all likely be
pulled together, StatsCompanionService will provide stale data for
BatteryStats pulls called within a second of a previous BatteryStats
pull.

Also in this cl:
Remove StatsLogEventWrapper.writeDouble. Statsd doesn't support actually
writing doubles into its proto reports, so having this function is
misleading (the data will get to statsd and then be completely ignored).
It's less confusing if we don't pretend it does something.

Change-Id: If80bab8ea938afa4632535bb88ff59879fbe8099
Fixes: 119111972
Test: cts-tradefed run cts-dev -m CtsStatsdHostTestCases -t android.cts.statsd.atom.UidAtomTests#testDeviceCalculatedPowerUse
Test: cts-tradefed run cts-dev -m CtsStatsdHostTestCases -t android.cts.statsd.atom.UidAtomTests#testDeviceCalculatedPowerBlameUid
Test: BatteryStatsHelperTest#testDrainTypesSyncedWithProto
2018-11-14 18:13:58 -08:00
TreeHugger Robot
8b46029dbb Merge "Show IME correctly when top-most display focus changed." 2018-11-15 01:20:45 +00:00
Haoyu Zhang
1e7ef6453a Merge "Set SubtitleView.mAlignment default value to be Alignment.ALIGN_CENTER" 2018-11-15 00:50:16 +00:00
TreeHugger Robot
c1d607e90d Merge "Add ColorDisplayManager" 2018-11-15 00:40:26 +00:00
Haoyu Zhang
8896df9d31 Set SubtitleView.mAlignment default value to be Alignment.ALIGN_CENTER
SubtitleView.mAlignment is null by default. This can cause undefined
behavior if mAlignment is passed to StaticLayout.Builder.setAlignment().
As the previous behavior of StaticLayout with alignment equals to null is
same as ALIGN_CENTER, this change uses ALIGN_CENTER as default value.

Bug: 119221721
Test: bit CtsWidgetTestCases:android.widget.cts.CheckedTextViewTest
Test: bit CtsWidgetTestCases:android.widget.cts.EditTextTest
Test: bit CtsWidgetTestCases:android.widget.cts.SwitchTest
Test: bit CtsWidgetTestCases:android.widget.cts.TextViewTest
Test: bit FrameworksCoreTests:android.widget.TextViewTest
Change-Id: Iefd069db449a7fe3d68f6f3e5ebcfcbf1e588962
2018-11-14 21:21:47 +00:00
Ivan Chiang
a972d0449a Extend DocumentsContract search to accept mime types
1. Add the key of query arguments and match method
   in DocumentsContract.
2. Implement new querySearchDocuments method in
   DocumentsProvider, ExternalStoragProvider and
   FileSystemProvider.

Bug: 111786939
Test: Manual Test
Change-Id: I04e9f2be971f10ac1e9584a3486c948aaddea0a4
2018-11-14 15:06:35 +08:00
Alison Cichowlas
277ff273a4 Merge "Flag off new Chooser behavior." 2018-11-13 23:53:38 +00:00
Alison Cichowlas
4691ed41a0 Flag off new Chooser behavior.
Bug: 119480958
Test: Manual
Change-Id: Ide635d08c128c48d8ec488f6d2d5b915e21e82f4
2018-11-13 21:34:12 +00:00
lumark
6f13d20b8e Show IME correctly when top-most display focus changed.
In previous design, the IME focus is changed when receiving
window focus change from ViewRootImpl.

For Multi-Display concept, it should be needed to aware the top
display focus changed in different displays but both are already
had the focused window without change case.

Sending REPORT_FOCUS_CHANGE when top display focus changed for
ViewRootImpl, let IMM can re-focus IME window on right display.

Bug: 117491872
Test: atest ActivityManagerMultiDisplayTests
Test: atest FrameworksServicesTests:DisplayContentTests

Change-Id: Ia46738a5da6dbc334bf937b0f6656a57523c28a7
2018-11-13 17:26:55 +08:00
Kevin Chyn
1b9f8dfb36 Add work background/color to BiometricPrompt for managed profiles
Bug: 117347671

Test: Followed steps in b/119296586#comment1
Test: Background/color changes properly when launching BP from
      managed / unmanaged profiles

Change-Id: Ia0368041540b65b41957d2adbcaa75c0739f62f1
2018-11-12 22:39:29 -08:00
TreeHugger Robot
998b52ba83 Merge "Introduce multi-client IME for special form factors" 2018-11-13 03:43:48 +00:00
Yohei Yukawa
bae5bea23c Introduce multi-client IME for special form factors
An advanced multi-display support is requested for certain Android
form-factors so that user(s) can type text on each display at the same
time without losing software keyboard focus in other displays. This is
not possible in existing Android IMEs that are built on top of
InputMethodService class, because the assumption that a single IME
client can be focused at the same time was made before Android IME
APIs were introduced in Android 1.5 and many public APIs in
InputMethodService have already relied heavily on that
assumption. Updating InputMethodService class to support multi-client
scenario is, however, quite challenging because:

 1. doing so would introduce an unacceptable amount of complexity into
    InputMethodService, which is already hard to maintain,

 2. IME developers still need to update their implementation to be
    able to support parallel requests from multiple focused IME
    client, which may require non-trivial redesign in their side
    (e.g. input decoder, typing history database, ...), and

 3. actual use cases for multi IME clients are expected to be evolved
    rapidly hence the new protocol is not yet stable and not yet ready
    to be exposed as public APIs.

This is why a new type of IME needs to be designed and developed
specifically for such special multi-display environments, rather than
reusing existing InputMethodService public class.

Note that there must be no behavior change unless multi-client IME is
explicitly enabled with 'adb shell setprop', which requires root
permission.

See multi-client-ime.md for details.

Fix: 114662040
Test: Manually verified as follows:
  1. make -j MultiClientInputMethod
  2. adb install -r $OUT/system/priv-app/MultiClientInputMethod/MultiClientInputMethod.apk
  3. adb root
  4. adb shell setprop persist.debug.multi_client_ime \
       com.example.android.multiclientinputmethod/.MultiClientInputMethod
  5. adb reboot
  6. Try multiple text input scenario
Change-Id: I41dfe854557b178d8af740bc2869c936fc88608b
2018-11-12 15:20:20 -08:00
Mike Ma
64fdbf5ff7 Merge "An efficient proc file reader" 2018-11-12 22:51:38 +00:00
Michael Dooley
4d75ccd328 Merge "Converting sound trigger v2.2 getModelState to be asynchronous" 2018-11-12 19:27:39 +00:00
Alison Cichowlas
69f39989c2 Merge changes from topic "sharesheet-refactor"
* changes:
  Add URI shared by screenshot into extras.
  Re-patching in Sharesheet security model changes.
2018-11-12 15:19:11 +00:00
Misha Wagner
78b0211117 Merge "Reduce amount of logging on failed proc file reading" 2018-11-12 11:20:33 +00:00
Adam He
84d49aa8c8 Merge "Added 7th argument to pooled lambdas" 2018-11-09 23:56:03 +00:00
Mike Ma
fa2534351f An efficient proc file reader
A less resource hogging reader for reading proc files in string
format. It is singleton and thread-safe, so all downstream clients
share the same instance to avoid duplicate allocation. It reads
the entire proc file all at once (to mimimize the impact to the
kernel) into a reusable char[] buffer (to prevent frequent GC). A
read lock is automatically held for the client when a valid file
iterator is returned. Client MUST call close() to unlock it or take
advantage of try-with-resources.

The reader keeps an error counter. It rejects further requests if it
has accumulated 5 errors, to prevent log spam. The reader also has
a 500ms cache, which can be bypassed with a parameter.

Bug: 111216804
Test: atest FrameworksCoreTests:com.android.internal.os.KernelCpuProcStringReaderTest
Change-Id: Ifa5213a5c7baf95d62f74486815030d9aa54ca28
2018-11-09 11:21:23 -08:00
Alison Cichowlas
3e34050a42 Re-patching in Sharesheet security model changes.
Previously reverted due to b/72554856, fix for that in topic.

Original commit message:

Security model for moving sharesheet to systemui

ResolverActivity (still in frameworks) now requests a "permission token"
that it hands to a stubbed system ui activity ChooserActivity.

This permission token allows an app (SysUI) with the signed permission
"START_ACTIVITY_AS_CALLER" to call
ActivityManagerService#startActivityAsCaller. Permission tokens are a
one-time use, limited-time offer.

Test: runtest systemui && manual testing
Bug: 69850752
Change-Id: Ia50e21e2f8c6b6d0ed7207625e3b5aef214396bb
2018-11-09 11:01:54 -05:00
mike dooley
b2ab04aefd Converting sound trigger v2.2 getModelState to be asynchronous
Test: built android with checkbuild flag

Change-Id: I4c6f2388c93b6e577113fc7f2cd19242628ee50f
Bug-Id: 70206501
2018-11-09 08:36:15 +01:00
Adam He
c4f03f3a94 Added 7th argument to pooled lambdas
Bug: 118681526
Test: atest CtsAutoFillServiceTestCases
Change-Id: I972e2f4114f3f7c2dd31de3169e0c8216af09892
2018-11-08 10:33:44 -08:00
Jorim Jaggi
05ac00c630 Merge changes from topic "windowinsets-api"
* changes:
  WindowInsets: Annotate nullability
  WindowInsets: Add Builder
  WindowInsets: reimplement WindowInsets on top of Insets
  WindowInsets: make WindowInsets.inset() public
2018-11-07 16:35:06 +00:00
Misha Wagner
cf7a07d0f4 Reduce amount of logging on failed proc file reading
We expect some proc file reading to fail when processes or threads
finish execution while we traverse their proc files. We should not
pollute logs when this traversal fails.

Test: Inspected `adb logcat`
Change-Id: Id811a1e6b5084a8a3a903a892a99e317d1e3ac7f
2018-11-07 12:42:13 +00:00
Christine Franks
ea7d71b3aa Add ColorDisplayManager
Add ColorDisplayManager class, and shift some functionality from
ColorDisplayController

Bug: 111215474
Test: atest FrameworksServicesTest:ColorDisplayServiceTest
Change-Id: Ic38a12e1e0b0619fdad42a89b7ac3e878c8128b2
2018-11-06 21:31:15 +00:00
TreeHugger Robot
8f126e98b7 Merge "Make pattern fade slower" 2018-11-06 06:10:52 +00:00
TreeHugger Robot
891aa9edc9 Merge "Fix "Tracking association..." logspam." 2018-11-06 03:15:27 +00:00
Lucas Dupin
31c0022caa Make pattern fade slower
We went a little too far...

Bug: 74259090
Test: visual
Change-Id: Icdc05a445ecf79689b47bde829bc02164469f370
2018-11-05 18:13:54 -08:00
Makoto Onuki
3a8e5c50bc Fix "Tracking association..." logspam.
In the previous code, updateTrackingAssociationsLocked() was called too early.
There's still code that changes procstates, so let's move
updateTrackingAssociationsLocked() to the end of updateOomAdjLocked().

Also change Slog.w() to Slog.wtf() so we can monitor it on APR.

Also rate limit the WTF to at most one in ten seconds.

Bug: 118826162
Test: Boot with and without the fix and make sure the number of the warnings
reduces.
(We still have a couple WTFs from during a boot with this CL, which requires
further investigation.)

Change-Id: Ifa1fe85de82fa1d1d8f843372c54c1248966a62a
2018-11-05 16:01:09 -08:00
Junyu Lai
e914f1e453 Merge "Extend onDnsEvent callback to report more fields." am: 89eb3e6117 am: 7a782be65d
am: 556ae82025

Change-Id: I50ef791009b0e9301ba10d8e52c3fd6c15e6b938
2018-11-04 21:05:47 -08:00
Junyu Lai
556ae82025 Merge "Extend onDnsEvent callback to report more fields." am: 89eb3e6117
am: 7a782be65d

Change-Id: Ic1b35f2b02dc60e301d39e89008617b341194382
2018-11-04 20:54:14 -08:00