Commit Graph

10275 Commits

Author SHA1 Message Date
Howard Ro
bb67362281 Merge "MetricsLogger writes to both event log and statsd" 2018-10-09 03:18:09 +00:00
Dimitry Ivanov
a60c94aab9 Merge "Respect extractNativeLibs in natively bridged environments" am: 61b9b6c9eb am: a00f278956
am: 7c154d103c

Change-Id: Ibe46c36aa545703781fbc5f56eb5e57f46ece543
2018-10-08 08:33:04 -07:00
Dimitry Ivanov
7c154d103c Merge "Respect extractNativeLibs in natively bridged environments" am: 61b9b6c9eb
am: a00f278956

Change-Id: Ia790b6fed75624cec36577cfc68d12e5a029d500
2018-10-08 08:19:24 -07:00
Dimitry Ivanov
a00f278956 Merge "Respect extractNativeLibs in natively bridged environments"
am: 61b9b6c9eb

Change-Id: I6072e16c1cdf9543d38ec8763931abf095bd2313
2018-10-08 08:05:41 -07:00
Dimitry Ivanov
61b9b6c9eb Merge "Respect extractNativeLibs in natively bridged environments" 2018-10-08 14:50:08 +00:00
TreeHugger Robot
ce10f9b15f Merge "Instantiate InputMethodManager for each display" 2018-10-06 17:19:58 +00:00
Yohei Yukawa
c53d78e992 Instantiate InputMethodManager for each display
InputMethodManager has been a per-process singleton object. In order
to support behavior changes for multi-display support in Android Q,
however, InputMethodManager now needs to be per-display objects.

With this CL, context.getSystemService(InputMethodManager.class) will
start returning per-display InputMethodManager (IMM) instance.

  Why?

There are two major reasons.
 1. To support per-display focused window.
 2. To support more simplified API for multi-session IME.

Currently per-process InputMethodManager instance directly receives
callback from ViewRootImpl upon windowFocusChanged, then it keeps
track of which Window is focused by storing its root view into
InputMethodManager#mCurRootView.

This design assumes that (within the same process) at most one Window
can have window focus, which is no longer true once we start
supporting per-display focused window (Bug 111361570).

  Why we need to do this to support per-display focused window:

For traditional non multi-session IME cases (e.g. apps that use
Virtual Display APIs on phones), internal state of IMM can be easily
messed up once the system starts sending per-display
windowFocusChanged events to the same process, because IMM still
doesn't know that now each display has focused window. It is hard to
precisely predict what kind of issues we would see simply because such
a use case is most likely not expected in the original design.

  Why we need to do this for multi-session IME:

For multi-session IME scenarios, in addition to the above concern in
InputMethodManager, the current design allows at most one IME session
per process. This means that if a process X is showing Activities to 3
different displays, only one Activity can interact with the
multi-session IME at the same time. If we do not change the current
design, the only way to work around is to ask app developers to
explicitly use different processes for each Activity, which may
require a lot of work (e.g. SharedPreference is not optimized for
multi-process use cases). This would also make multi-session IME
development complicated because the IME cannot know on which display
the IME is interacting until startInputOrWindowGainedFocus() is
actually called, and needs to do all the preparation and cleanup tasks
whenever startInputOrWindowGainedFocus() is called for a different
display than it's currently interacting with.

  Alternative solutions considered:

Another possible approach is to update InputMethodManager singleton to
be able to maintain multiple mCurRootView and mServedView for each
display. This approach was abandoned because those fields and methods
are already marked as @UnsupportedAppUsage.  I concluded that touching
@UnsupportedAppUsage things would have bigger compatibility risks than
per-display instance model.

  Implementation note:

* Public APIs in IMM that take View instance as the first parameter
  will verify whether the given View and IMM are associated with the
  same display ID or not.  If there is a display ID mismatch, such an
  API call will be automatically forwarded to the correct IMM instance
  IMM with a clear warning in logcat which tells that app developers
  should use the correct IMM instance to avoid unnecessary performance
  overhead.

* As a general rule, system server process cannot trust display ID
  reported from applications.  In order to enable IMMS to verify the
  reported display ID, this CL also exposes display ID verification
  logic from WMS to other system components via WindowManagerInternal.

* isInputMethodClientFocus() in WindowManagerService (WMS) is updated
  to use top-focused-display to determine whether a given IME client
  has IME focus or not.  This is now necessary because with a recent
  change [1] each display can have focused window.  The previous logic
  to check all the displays that belong to the given pid/uid [2] no
  longer makes sense.

* Currently per-display InputMethodManager instances will not be
  garbage collected because InputMethodManager#sInstanceMap keeps
  holding strong references to them.  Freeing those instances is
  technically possible, but we need to be careful because multiple
  processes (app, system, IME) are involved and at least system
  process has a strict verification logic that lets the calling
  process crash with SecurityException.  We need to carefully
  implement such a cleanup logic to avoid random process crash due to
  race condition.  Bug 116699479 will take care of this task.

 [1]: I776cabaeaf41ff4240f504fb1430d3e40892023d
      1e5b10a217
 [2]: I8da315936caebdc8b2c16cff4e24192c06743251
      90120a8b5b

Bug: 111364446
Fix: 115893206
Test: atest ActivityManagerMultiDisplayTests
Test: atest CtsInputMethodTestCases CtsInputMethodServiceHostTestCases
Test: atest FrameworksCoreTests:android.view.inputmethod.InputMethodManagerTest
Change-Id: I7242e765426353672823fcc8277f20ac361930d7
2018-10-05 15:54:41 -07:00
Hyunyoung Song
16b7af4062 IconFactory should be initialized before mAdapter is created inside ResolverActivity
Bug: 113032889
Test: builds
Change-Id: I9906ee7ec8be64f0a82634796a7e2f3bcbd01800
2018-10-05 14:02:21 -07:00
dimitry
6e44c30f05 Respect extractNativeLibs in natively bridged environments
The extractNativeLibs property was ignored by the package installer
for environments with native bridge. This is not neccessary since
native bridge implementations are required to support
open-directly-from-apk feature and in this respect are not different
from environments without native bridge.

Bug: http://b/116854266
Test: cts-tradefed run singleCommand cts --skip-preconditions -m CtsJniTestCases
Change-Id: I9ea7397183d7ebe2c00e461b95d188b15b51eca2
2018-10-04 16:43:36 +02:00
Chenjie Yu
e388e27e19 Merge "pull PowerProfile into statsd" 2018-10-03 23:28:10 +00:00
Howard Ro
ef89d730c4 MetricsLogger writes to both event log and statsd
For the intermediate period, MetricsLogger logs to both event buffer in
logd as well as stastd socket.

Bug: 110537511
Test: statsd, statsd_test
Change-Id: Ie349b1d202e07c585ab5b085141865f20d1f57cd
2018-10-03 12:49:10 -07:00
Chenjie Yu
ab53020345 pull PowerProfile into statsd
pull constants from PowerProfile into statsd for power model
calculations. The data is mostly from power_profile.xml

power_profile {
  power_profile_proto {
    cpu_suspend: 5.734
    cpu_idle: 1.389
    cpu_active: 18.76
    wifi_controller_idle: 2.0
    wifi_controller_rx: 107.0
    wifi_controller_tx: 371.0
    wifi_controller_operating_voltage: 3700.0
    bluetooth_controller_idle: 0.01
    bluetooth_controller_rx: 8.0
    bluetooth_controller_tx: 7.0
    bluetooth_controller_operating_voltage: 3300.0
    modem_controller_idle: 105.0
    modem_controller_rx: 175.0
    modem_controller_tx: 176.0
    modem_controller_tx: 216.0
    modem_controller_tx: 300.0
    modem_controller_tx: 427.0
    modem_controller_tx: 604.0
    modem_controller_operating_voltage: 3700.0
    gps_signal_quality_based: 49.0
    gps_signal_quality_based: 11.0
    gps_operating_voltage: 3700.0
    screen_on: 178.708
    screen_full: 240.79
    audio: 75.6
    video: 50.93
    flashlight: 298.498
    camera: 1152.292
    battery_capacity: 3450.0
    cpu_cluster {
      cores: 2
      speed: 307200
      speed: 384000
      speed: 460800
      speed: 537600
      speed: 614400
      speed: 691200
      speed: 768000
      speed: 844800
      speed: 902600
      speed: 979200
      speed: 1056000
      speed: 1132800
      speed: 1209600
      speed: 1286400
      speed: 1363200
      speed: 1440000
      speed: 1516800
      speed: 1593600
      core_power: 11.272
      core_power: 14.842
      core_power: 18.497
      core_power: 22.518
      core_power: 25.967
      core_power: 31.694
      core_power: 37.673
      core_power: 42.859
      core_power: 46.872
      core_power: 57.92
      core_power: 67.561
      core_power: 76.303
      core_power: 87.613
      core_power: 97.045
      core_power: 109.544
      core_power: 122.054
      core_power: 136.345
      core_power: 154.435
    }
    cpu_cluster {
      id: 1
      cores: 2
      speed: 307200
      speed: 384000
      speed: 460800
      speed: 537600
      speed: 614400
      speed: 691200
      speed: 748800
      speed: 825600
      speed: 902400
      speed: 979200
      speed: 1056000
      speed: 1132800
      speed: 1209600
      speed: 1286400
      speed: 1363200
      speed: 1440000
      speed: 1516800
      speed: 1593600
      speed: 1670400
      speed: 1747200
      speed: 1824000
      speed: 1900800
      speed: 1977600
      speed: 2054400
      speed: 2150400
      core_power: 7.055
      core_power: 11.483
      core_power: 14.979
      core_power: 19.642
      core_power: 23.167
      core_power: 27.479
      core_power: 31.632
      core_power: 39.192
      core_power: 47.817
      core_power: 55.659
      core_power: 64.908
      core_power: 73.824
      core_power: 85.299
      core_power: 96.036
      core_power: 109.233
      core_power: 118.56
      core_power: 132.959
      core_power: 143.692
      core_power: 161.378
      core_power: 180.616
      core_power: 193.897
      core_power: 214.361
      core_power: 238.338
      core_power: 265.759
      core_power: 297.918
    }
  }
}

Bug: 113353350
Test: manual test on statsd
Change-Id: I1edd4db255c0440ddbff1d40e1515caaccbc73f8
2018-10-03 10:39:49 -07:00
Nandana Dutt
23626416d0 Merge "Bugreport: Fix SystemUI service from being dumped twice 1/2" am: 99c685b0e8
am: ab618e00b2

Change-Id: I066978bd0150c885f60ced73bdb118038b5c15cf
2018-10-03 09:11:53 -07:00
Nandana Dutt
ab618e00b2 Merge "Bugreport: Fix SystemUI service from being dumped twice 1/2"
am: 99c685b0e8

Change-Id: I5d93f3a8bfc1385e629e06848f672b14a2885e6f
2018-10-03 08:54:46 -07:00
Marcin Oczeretko
5a082f6da1 Make BinderCallsStats ignore invalid sampling interval
System Server crashes with ArithmeticException if sampling
interval is set to 0.

Test: Manual
Change-Id: Ia8f5437f5c1cdc68bed607147049abd70ed7af33
2018-10-02 16:17:43 +01:00
Vishnu Nair
5ed09e844b Bugreport: Fix SystemUI service from being dumped twice 1/2
Bug: 110490179
Fix: 110490179

Test: Manual test dumpsys activity
  adb shell dumpsys activity service all-platform-non-critical
  adb shell dumpsys activity service all-platform
  adb shell dumpsys activity service
  Take bugreport and check contents

Test: atest FrameworksCoreTests:DumpUtilsTest

Change-Id: I9173d3fa0cc3aaf42e3ab03e7e2892cf4188b13b
Merged-In: I9173d3fa0cc3aaf42e3ab03e7e2892cf4188b13b
(cherry picked from commit c69cd4480e)
2018-10-02 10:10:41 +01:00
Tej Singh
e7726dc4af Add DiskIo to Statsd
Adds diskio information to statsd. The puller queries the
proc/uid_io/stats file to get cumulative counts since boot.

Bug: b/116331466

Test: unit test
Test: manually verified that the puller and "cat /proc/uid_io/stats"
returned almost identical output when executed at the same time

Change-Id: Iac446f8dd879ab6bf859eed6e779cc16fdee6c5b
2018-10-01 23:36:04 -07:00
Lucas Dupin
493cb6d5cb Merge "Renaming gesture" 2018-09-28 22:00:56 +00:00
Sudheer Shanka
3bc4ab482b Merge "Bind mount pkg specific dirs in the zygote child namespaces." 2018-09-28 20:34:02 +00:00
Lucas Dupin
13b0cb9890 Renaming gesture
Bug: 111414690
Test: make
Change-Id: I9d2a6507a942c56fe5b626d8dce46321ff70014b
2018-09-28 09:27:46 -07:00
Michael Dooley
7e833acdaf Merge "Revert "Revert "Revert "Adding getModelState API to sound trigger"""" 2018-09-28 07:38:34 +00:00
Michael Dooley
be93d52505 Revert "Revert "Revert "Adding getModelState API to sound trigger"""
This reverts commit 7999836ee3.

Reason for revert: broke build

Change-Id: Id02636908aed26ee0ed38042da1ace0125a6d417
2018-09-28 07:30:28 +00:00
Michael Dooley
ea3e73a879 Merge "Revert "Revert "Adding getModelState API to sound trigger""" 2018-09-28 06:24:43 +00:00
Stefano Tommasini
bf8b6c02f3 Merge "Move transport out of system server." 2018-09-28 03:04:05 +00:00
Sudheer Shanka
3f0645ba83 Bind mount pkg specific dirs in the zygote child namespaces.
- Also update vold to create sandboxes for secondary storage devices.
- Since bind mounts are created in the process specific namespaces, we
  don't need /mnt/storage anymore which we were using it to prevent
  some bind mounts from propagating onto /mnt/runtime/write.
- Create bind mounts for {media,obb} dirs similar to data dir in
  per process namespace.
- Also fix a bug where we are not passing correct packages to vold when
  a new user starts.

Bug: 111890351
Test: manual
Change-Id: I1abbafabc58993860305e5a928c980420f89f289
2018-09-27 14:43:45 -07:00
Olivier Gaillard
c2d02b522c Use the background thread instead ActivityManager to update CPU stats.
Updating the CPU stats can be quite slow and blocks the ActivityManager
handler thread.

Bug: 115506775
Change-Id: I9f67acfe2724c11d117703b2c4ccdbcc1f61c5ab
Test: manual - dumpsys batterystats | grep CPU
2018-09-27 13:42:48 +00:00
Jeff Sharkey
5017286aa1 Merge "Fix ExternalStorageProvider always throw exception when rename" am: 8883851c71
am: deb51d8489

Change-Id: I4411270b371f25d7a245f163db8d1a358426b6f2
2018-09-26 09:56:21 -07:00
Jeff Sharkey
deb51d8489 Merge "Fix ExternalStorageProvider always throw exception when rename"
am: 8883851c71

Change-Id: I8c11434930de7f3f51fae6ca4666f1a00a265e64
2018-09-26 09:44:52 -07:00
TreeHugger Robot
cc4cb59223 Merge "add api to get sections of procstats" 2018-09-26 15:07:51 +00:00
Chenjie Yu
4e028d067e add api to get sections of procstats
Add api to collect committed procstats data.
Use highwatermark from the user to filter which files to include. This
way multiple users in the system can use this api.

Also allow ProcessStats.java to dump optional ProcessStatsSectionProto
so that other users can use it.

Test: will add cts test
Change-Id: If37c0fd25814460a1c8d5996d24d138295ff6421
2018-09-25 16:41:26 -07:00
Tony Huang
ac45599364 Fix ExternalStorageProvider always throw exception when rename
ExternalStorageProvider always throw exception when renameDocument
because it will check file exist when getFileForDocId. However,
beforeVisibleFile is not exist after rename, it will throw
exception. Fix it by put getting beforeVisibleFile before rename.

Test: manual test rename in DocumentsUI
Test: atest RenameActualProviderUiTest
Fix: 113302685
Fix: 115304092
Change-Id: I45d60d2f940e3dbc2b121f7cd28acc3c2d085ec4
Merged-In: I45d60d2f940e3dbc2b121f7cd28acc3c2d085ec4
2018-09-25 17:20:28 -06:00
TreeHugger Robot
d6fb462d1e Merge "Remove a special optimization for a quite rare scenario" 2018-09-25 20:09:05 +00:00
Yohei Yukawa
d4d895e2f8 Remove a special optimization for a quite rare scenario
This CL effectively reverts the following 3 CLs.

 * Reduce window resizing during IME transition
   I5723f627ce323b0d12bd7b93f5b35fc4d342b50c
   792faa2c16

 * Clear the inset of previous IME when necessary
   Ib04967f39b2529251e4835c42e9f99dba2cf43f2
   2977eb7b6c

 * Make IMS#clearInsetOfPreviousIme() reliable
   Ib567daa009c1139858dccadcfc6a04465ebecf36
   833bdcedce

The main idea behind the first CL is that the target application can
skil avoid layout resizing if the following two conditions are met.

 A. WindowManagerService (WMS) can remember the last IME's inset until
    the next IME's window is fully shown.
 B. Both the last IME and the new IME have the same inset.

Basically the first CL implements the above A part with an assumption
that some IMEs would do the B part.  However, in reality it is quite
unlikely that two random IMEs have the same inset size.  At the same
time, maintaining this kind of special optimization is getting harder
and harder as more and more use cases and form factors need to be
supported.

Let's remove this optimization given that no one is benefited by it.

Fix: 116492038
Test: atest CtsInputMethodTestCases CtsInputMethodServiceHostTestCases
Test: do not see any noticeable visual difference
Change-Id: I8ffbf9bf7c3a8be54df0ca8eac1a1f041ef7d3c9
2018-09-24 16:01:20 -07:00
Lucas Dupin
1596b659f4 Fix ambient color resolution
resolveColor() now considers that black backgrounds should have
monochromatic icons. Ambient style is an exception because we
do want colors in there.

Change-Id: Ia21202bb354babb77013feda67c313323ec1e070
Fixes: 115887386
Test: visual
2018-09-24 14:40:23 -07:00
Mike Ma
fef5a7ab31 Merge "More robust read mechanism in KernelCpuProcReader" into pi-dev
am: f76c383f82

Change-Id: I6b70fbe607adb37a93d764615decfca243eff347
2018-09-24 13:12:23 -07:00
Michael Dooley
7999836ee3 Revert "Revert "Adding getModelState API to sound trigger""
This reverts commit 81f71f1c27.

Reason for revert: undoing rollback

Change-Id: Ifddfd0c730f03e93788d662a392d538564ce210b
2018-09-21 12:13:01 +00:00
Kevin Chyn
6cf54e8190 3/n: Add FaceDialogView and "confirmation" plumbing
This change adds plumbing from <Biometric>Service to SystemUI for requiring
user confirmation (or not). This change also fixes some layout bugs
that were hard to notice.

Bug: 111461540
Fixes: 113130114
Fixes: 116135579

Test: With confirmation, crypto operation does not work until token
      is added to Keystore
Test: Without confirmation, crypto operation works when biometric is
      authenticated
Test: BiometricPromptDemo works, UI elements are all correct
Test: Talkback messages are correct

Change-Id: I2c05577699a29c09777cae4db6c7334c1e6bc179
2018-09-20 17:53:10 -07:00
Marcin Oczeretko
e0ef793d0a Merge changes If217a9a8,I35af3a9c
* changes:
  LooperStats - don't create entries for unsampled sessions
  Add work source uid collection to LooperStats
2018-09-20 19:43:07 +00:00
Marcin Oczeretko
a674bc9eaf LooperStats - don't create entries for unsampled sessions
This should reduce the size of the data, because we will
not track the very rare calls unless we are collecting
a detailed sample.

Test: Manual and UTs
Change-Id: If217a9a848935878a6efcdfac9df723c6ce54361
2018-09-20 10:52:18 +01:00
Marcin Oczeretko
ec7587283f Add work source uid collection to LooperStats
Add ThreadLocalWorkSourceUid and Message.workSourceUid
which will store the UID which caused, directly or
indirectly, the Message to be enqueued.

This was needed because using Binder.getCallingUid() does
not give us enough data since quite a few Binder services
call Binder.clearCallingIdentity() when processing the
call.

Test: UT and manual
Change-Id: I35af3a9ca5193477070990b41ff5d9c52f420069
2018-09-20 10:52:08 +01:00
Yohei Yukawa
a71bb25cff Let IMMS be responsible for IInputMethodClient lifecycle
This is the last step to remove the dependency on IInputMethodClient
from WindowManagerService.

With my previous CL [1], now WindowManagerService (WMS) depends on
IInputMethodClient just because it implements lifecycle management of
IInputMethodClient on behalf of InputMethodManagerService (IMMS).

This CL mechanically moves that responsibility from WMS to IMMS for
better separation of concerns.  It is a bit ironic that this CL is
partly undoing my previous CLs [2][3] that removed
IInputMethodManager.addClient() though.

This CL aims to preserve the current observable behavior (e.g. when
InputMethodManager instance is being created) as much as possible.
Most likely there would be no observable behavior difference when seen
from other components.

 [1]: I444077b1e4af4033f67ab72c181fac85b601e08a
      41f89c3bcc
 [2]: I453200fd5847e9a78876affb6a1caec221525e1d
      e24ed79edb
 [3]: Id91dd600120e4981aa1d9005ce644728968430c9
      fffc0e53c6

Fix: 115993358
Test: atest CtsInputMethodTestCases CtsInputMethodServiceHostTestCases
Change-Id: I7726c70613ea72d6e78fa5754e9fc840f0a40f11
2018-09-19 19:21:24 -07:00
Yuzhou Jia
35339498ef Merge "Make Changes to VoiceInteraction API for supporting System checking an assistant voice action availability on AAE." 2018-09-20 01:02:44 +00:00
TreeHugger Robot
b6ffc07e06 Merge "Remove the dependency on IInputMethodClient from IME focus check" 2018-09-20 00:19:35 +00:00
Yohei Yukawa
41f89c3bcc Remove the dependency on IInputMethodClient from IME focus check
This is a preparation to remove the dependency on IInputMethodClient
from WindowManagerService.

What inputMethodClientHasFocus(IInputMethodClient) is currently doing
is basically equivalent to comparing PID (and UID), because
InputMethodManager is a per-process instance and comparing two
IInputMethodClient Binder proxies is no more or less than comparing
PID (and UID pair).  We can just change its method signature to
achieve the same behavior by taking a PID/UID pair instead of taking
IInputMethodClient.

Note that we can later add display ID to this method to support
multi-display scenario.

This CL also renames inputMethodClientHasFocus() to
isInputMethodClientFocus() for better consistency with other methods.

There should be no observable behavior difference in this CL anyway.

Bug: 115993358
Test: atest CtsInputMethodTestCases CtsInputMethodServiceHostTestCases
Change-Id: I444077b1e4af4033f67ab72c181fac85b601e08a
2018-09-19 14:30:04 -07:00
jiayuzhou
21a353b701 Make Changes to VoiceInteraction API for supporting System checking
an assistant voice action availability on AAE.

Test: build and test on AAE.
Bug: 110587280

Change-Id: If37036e0dbe021fee9c95caf7e450330ca24ae32
2018-09-19 10:21:59 -07:00
TreeHugger Robot
bd5fed399f Merge "Let InputMethodPrivilegedOperationsRegistry deal with its singleton-ness" 2018-09-19 16:48:54 +00:00
Tony Huang
b3e5edd5ea Merge "Fix ExternalStorageProvider always throw exception when rename" 2018-09-19 02:56:00 +00:00
Yohei Yukawa
d746a7e893 Let InputMethodPrivilegedOperationsRegistry deal with its singleton-ness
This is a preparation to allow InputMethodManager to have per-display
instances rather than the current per-process singleton instance.

When I introduced InputMethodPrivilegedOperationsRegistry [1], there
was an assumption that InputMethodManager was a per-process global
singleton object.

Now that we are going to break up that global per-process instance
into multiple per-display instances, having multiple
InputMethodPrivilegedOperationsRegistry instances probably does not
make much sense, because it would likely to increases the risk of
compability issues in existing IMEs.  Although IME developers soon
really need to use the right Context to obtain the right instance of
InputMethodManager anyway, unnecessarily introducing compatibility
pitfalls that can be avoided in the Framework side is not my
intention.

With this CL, following 9 methods can continue to work no matter
whether InputMethodManager is a per-process singleton or not.
This is fine because those APIs had been mistakenly exposed in
InputMethodManager and already deprecated in favor of newly added ones
in InputMethodService.

 * InputMethodManager.hideSoftInputFromInputMethod
 * InputMethodManager.hideStatusIcon
 * InputMethodManager.setInputMethod
 * InputMethodManager.setInputMethodAndSubtype
 * InputMethodManager.shouldOfferSwitchingToNextInputMethod
 * InputMethodManager.showSoftInputFromInputMethod
 * InputMethodManager.showStatusIcon
 * InputMethodManager.switchToLastInputMethod
 * InputMethodManager.switchToNextInputMethod

 [1]: If762714b2003fa6477e1318110f63e13968c1d7e
      eec552e9e9

Bug: 115893206
Test: atest CtsInputMethodTestCases CtsInputMethodServiceHostTestCases
Change-Id: I4a61470f06ffac5f7a512536f8431489db0108f4
2018-09-18 18:55:02 -07:00
TreeHugger Robot
3427156b2c Merge "More robust read mechanism in KernelCpuProcReader" 2018-09-18 23:54:14 +00:00
Mike Ma
5371273f02 More robust read mechanism in KernelCpuProcReader
KernelCpuProcReader used FileChannel to dump bytes into a large enough
ByteBuffer. However, FileChannel#read stops as soon as there is nothing
left to read. Since the kernel may not deliver all parts of a proc file
simultaneously, previous read mechanism would possibly read only a
portion of the proc file. The impact is that KernelUidCpuFreqTimeReader
gets an incomplete UID list.
New mechanism uses a loop to turn non-blocking FileChannel#read into a
blocking operation. It does not return until hitting EOF. The reason
not to use Files#readAllBytes is that we want to reuse the byte[].

Bug: 111805985
Test: atest KernelCpuProcReaderTest
Test: compared KernelCpuProcReader#readBytes against Files#readAllBytes
      locally
Change-Id: If0d2b6742489632e22c8fec34c627851cda875f2
2018-09-18 23:43:11 +00:00