Commit Graph

6396 Commits

Author SHA1 Message Date
Robert Sesek
96b49848e7 Split the zygote logic out of android.os.Process into a new ZygoteProcess class.
There is no functional change. This is to support adding new types of zygotes
that all operate using the same protocol.

Bug: 21643067
(cherry picked from commit 94e824bc1b)

Merged-In: Ie673ee816cae34ac20ffb8c774ec3e6461c3fd0a
Change-Id: I104e6133a90dc93a9854836b5e92d3cd542163a3
2016-09-09 12:42:52 -04:00
Tobias Sargeant
b9679dc1fa Refactor ZygoteInit to support a WebView-specific zygote.
This is a non-functional change that separates out functionality
that should be shared between the system zygote and the WebView
zygote from that which is system zygote specific.

* Move MethodAndArgsCaller to Zygote.
* Split out server socket functions into ZygoteServer.
* Add a new (stub, for now) WebViewZygoteInit class.

Bug: 22084679
Bug: 21643067
(cherry picked from commit ba816e0c9e)

Merged-In: I4c508a42af7ab7b53d10570ad53b846df7782cc4
Change-Id: I54f04c03443d10dabe6426697d1ff8a0cc66b985
2016-09-09 12:42:43 -04:00
Ian Rogers
e09ac05b35 Fix SuppressWarnings typo.
As Error Prone states:
Suppressing "deprecated" is probably a typo for "deprecation"
Bug: 27723540

(cherry picked from commit a7f834f1ce)

Change-Id: I0c6a9fc0a160769955cccf97ec7decb1f2b9b8fb
2016-09-08 13:11:37 +01:00
Lorenzo Colitti
4171cdf303 Give WakeupMessage the ability to transport an object as well. [DO NOT MERGE]
(cherry-pick of commit eab17da588)

Bug: 23113288
Change-Id: Ic98e3bcb3ea8b0b28a309bd647fb4178311c46a3
2016-09-06 15:54:16 -07:00
Mitchell Wills
07e317c3cd Add Log.wtf when transitionTo is used improperly
Using transitionTo in exit/enter (except in the terminal state) is
documented as undefined behavior and may cause unexpected results.
The current implementation appears to finish the current transition and
then transition to the new target state.

TEST=flash and play with the phone, no sign of immediate WTFs

Change-Id: I38a34b85c43d53c51514339587fc1269a069a454
(cherry picked from commit 8d3ed21583)
2016-08-29 11:26:53 -07:00
Mitchell Wills
009ae99582 Reenable the unit tests for StateMachine
In order to make the tests run a few methods must be made public so that
they can be called from a class loaded by a different class loader.

Fixed: 28217358
Change-Id: I98ce1e952a78528ae6ebd3a0e843c9ddfe937337
(cherry picked from commit 36afe5b5cc)
2016-08-29 11:26:51 -07:00
Rebecca Silberstein
934535bfe5 DO NOT MERGE StateMachine: remove final from SendMessage
Removed final from public sendMessage and sendMessageDelayed commands to
unblock unittest development.  This allows tests to verify calls to
sendMessage and sendMessageDelayed.

Also fixed one checkstyle error with import order.

BUG: 28593024
Change-Id: I26e02c3d75049d385ded7891c4fc9967273c27be
TEST: builds
TEST: runtest frameworks-wifi
(cherry picked from commit 0dbeb9e01a)
2016-08-29 11:26:42 -07:00
Roshan Pius
820f592220 XmlUtils: Add missing readThisByteArrayXml method
Add the missing XML to byte array conversion method.

While there,
1. Fix writeByteArrayXml method to store the hex chars of the value.
2. Cleanup couple of error strings in |readThisIntArrayXml| method.

BUG: 29039296
Change-Id: I6386f7df7c5c8b7bc3bc5a268196da617209cea9
TEST: Compiles & manual testing.
(cherry picked from commit 651209b597)
2016-08-26 13:22:43 -07:00
Glenn Kasten
67ffd5e617 resolve merge conflicts of c76a3ac to stage-aosp-master
Change-Id: Ifff16bdc42e8326f3f60cf4b92688c445cb4db25
2016-08-17 13:28:04 -07:00
Glenn Kasten
1fda533936 Squashed commit of the following:
commit efa6f355b06675aa4d0879fd279e22c16d5c046c
Author: Mikhail Naganov <mnaganov@google.com>
Date:   Wed Aug 10 12:25:13 2016 -0700

    MIDI: Use server-side socket in blocking mode for virtual devices

    Since virtual MIDI servers may misbehave, blocking mode will throttle
    them if clients are not coping with their sending speed.

    Bug: 29413812
    Change-Id: I9c4a2a7a7ea3ea060c93fedc7d0f033427c557c9

commit 755dfb5f83749d3963c63d98d692307f8271c804
Author: Mikhail Naganov <mnaganov@google.com>
Date:   Fri Jul 8 13:26:19 2016 -0700

    Protect MIDI framework against client blocks in MidiReceiver.onSend

    Make the server-side socket non-blocking when creating MidiOutputPort
    for clients. Thus if a client ceases to read from its side of the
    socket pair, the server will just fail to write instead of blocking.

    One drawback is that the MidiOutputPort on the client can't indicate
    that it has become dysfunctional, but it's not possible without
    changing the API.

    Bug: 29413812
    Change-Id: I9dfcbdd214a815cea8fd1365324fd78ca459268a

commit c740b13953761f58233ac651a0b5227733b1bdcc
Author: Mikhail Naganov <mnaganov@google.com>
Date:   Fri Jun 17 04:11:25 2016 -0700

    UsbMidiDevice: Clean up terminology and fix comments

    When working with physical MIDI devices, an *input* stream is used
    for reading from *output* port of the device, and vice versa. Thus,
    using "input" and "output" without specifying whether it's a stream
    or a port is confusing.

    Clarify names of counter variables, and fix a couple of comments
    that were incorrect due to this confusion. No functional changes.

    Change-Id: If561eaca4bade94e9296d2c703c9fcebc91296e2

commit 4269c6417287737624f6165a8bbeb5aa427de9a0
Author: Glenn Kasten <gkasten@google.com>
Date:   Thu May 5 18:49:16 2016 -0700

    Update MIDI package summary

    Bug: 28625060
    Change-Id: If552ca8e1a0666d402b5f536699bf3fb09c1e324

commit 862d40b73168bde7d0be5280d997985c18061014
Author: Phil Burk <philburk@google.com>
Date:   Tue Apr 19 15:56:24 2016 -0700

    MidiDevice: do not open ports on closed device

    Fix involves client side mIsDeviceClosed flag.

    Bug: 24949216
    Change-Id: I666284a787fbb9a710d2372fb424e8e54f6a2825
    Signed-off-by: Phil Burk <philburk@google.com>

commit 6f1de358b9f2616e03f4655f01454770915ddd66
Author: Phil Burk <philburk@google.com>
Date:   Mon Apr 18 16:05:28 2016 -0700

    MidiService: fix resource leak

    The proxy object was being used to match when adding or removing objects.
    But they are different each time. So now we use an asBinder() object.

    Bug: 28153736
    Change-Id: I1bccebf1e9464668db757ff08b41902d0cf0e3a7
    Signed-off-by: Phil Burk <philburk@google.com>

commit f7386bd535bb8a1d7f8df8f44a1748ab770c991a
Author: Phil Burk <philburk@google.com>
Date:   Tue Apr 5 14:19:53 2016 -0700

    MidiDevice: fix connectPorts for same Process

    If connectPorts() was called for a device in the same process then
    the connection would die when the ParcelFileDescriptor was closed.

    Bug: 26406775
    Change-Id: Id0538452593b4761ac2a93d366ade76d2e35ce73
    Signed-off-by: Phil Burk <philburk@google.com>

Change-Id: I4dfc2a2cbaf04bf1a790ae2cb39bf74fb5bb16ac
2016-08-17 08:45:39 -07:00
Tobias Thierer
8431c55fb8 Merge "Ensure apps cannot prevent uncaught exceptions being logged."
am: f61a449ee9

Change-Id: I826c175547a73123cd438ebe6991efee39a433d0
2016-08-09 09:02:27 +00:00
Tobias Thierer
addbf9015a Ensure apps cannot prevent uncaught exceptions being logged.
Let RuntimeInit use an UncaughtExceptionPreHandler to log an exception
rather than relying on UncaughtHandler, which apps can replace. This
makes it easier to diagnose application death, especially during app
compatibility testing for a new version of Android.

Test: Verified manually, with the help of a small sample app (not
checked in), that stacktraces for RuntimeExceptions thrown on main
or background threads are logged even when the app set a default
UncaughtExceptionHandler that swallows the exception with no action.

Note that such an inappropriate UncaughtExceptionHandler will still
cause threads to die without the app being killed, which it should be.
In an exception then happens on the main thread, the app will freeze
until the ANR dialog kicks in after a few seconds. I have manually
verified that this behavior is unchanged from before this CL.

No new integration tests are included because the default system
behavior has not changed.

Bug: 29624607
Change-Id: Ie87377b0bcadc3ba4083a8ab1bedb8f3dd95a4bd
2016-08-08 17:59:28 +01:00
Tobias Thierer
258a554f62 Merge "Stop profiling on uncaught exception." 2016-08-03 10:42:37 +00:00
John Stultz
5e23ab394a Merge "Zygote: Add CAP_WAKE_ALARM to system_server to properly support timerfd alarms"
am: 1085be0ce3

Change-Id: I23d7c2af33db8621b0c3b3415669543e0e3b740f
2016-08-03 00:12:32 +00:00
Tobias Thierer
8ad86a3d1a Stop profiling on uncaught exception.
When "handling" an uncaught exception, make an attempt to stop
profiling. In case profiling was active, this will avoid losing
the profiling buffer.

This change is required as a base in order for
https://android-review.googlesource.com/#/c/249721/
to merge cleanly.

(Cherry picked from commit 4c79fea9ef)
Bug: 26291225
Change-Id: I35f352e5f28eafe4702da9eae587c3b65c360b3a
2016-08-02 17:32:39 +01:00
John Stultz
5733f387be Zygote: Add CAP_WAKE_ALARM to system_server to properly support timerfd alarms
The when the timerfd alarm logic was added to the kernel, an oversight was made
and the interface does not check for the CAP_WAKE_ALARM permissions as required
via other kernel methods to trigger an alarm timer.

In v4.8-rc kernels, the change 2895a5e5b3a ("timerfd: Reject ALARM timerfds
without CAP_WAKE_ALARM") was added by Eric Caruso <ejcaruso@google.com>.

After this change (which may be backported to -stable), the AlarmManager will
fail on the first timerfd_create call, and will not be able to set the time
or handle other necessary functions.

The solution here is to add CAP_WAKE_ALARM to the system_server process.

Change-Id: Ifdb16f3ef42711e553f727165de3922d484b5be4
Signed-off-by: John Stultz <john.stultz@linaro.org>
2016-07-28 12:41:04 -07:00
Dan Sandler
3fae8ae0c6 One final tweak to the platlogo.
am: 4b7e415803

Change-Id: Ieef461bb4c1b59fd22e5f830b2b25311422cedae
2016-06-28 07:07:31 +00:00
Dan Sandler
4b7e415803 One final tweak to the platlogo.
Bug: 27376882
Change-Id: Ie60600018204f48593975b947d6fc10f4dd8a69f
2016-06-27 22:59:24 -04:00
Dan Sandler
fadfc8e5e5 Cats are not, technically, tasty treats.
am: 27a9fcc618

Change-Id: I04dd4cf9573e88635e814d75162b742fe19b316d
2016-06-26 22:56:01 +00:00
Dan Sandler
27a9fcc618 Cats are not, technically, tasty treats.
Bug: 27376882
Change-Id: I97183339e51c5d07fe6e9404bbcc5178ca605c05
Copilot: Jason Monk <jmonk@google.com>
2016-06-26 15:00:11 +00:00
John Reck
c86a2e325e Merge \"Remove FD from the right Looper\" into nyc-dev
am: db13dd41a9

Change-Id: I451ef3649426d9b8ea1bf15e388d0efa82dae442
2016-06-23 18:39:44 +00:00
John Reck
ac04f4e69a Remove FD from the right Looper
Bug: 29586513

Also gives BackdropFrameRenderer a direct-destroy
of Choreographer since it's hammering on new Threads
and we don't want to wait for the GC to release
FDs.

Change-Id: Id2ec0af2ee4d5304961c4ab87a104ccb92f35fc2
2016-06-23 11:00:00 -07:00
Adam Lesinski
31ef27c249 Merge \"Prevent early boot crash reading PowerProfile\" into nyc-dev
am: ec6db57ac7

Change-Id: I6366fcaa2b1a85b271d74df321100d590fd258a1
2016-06-22 17:37:41 +00:00
Adam Lesinski
ec6db57ac7 Merge "Prevent early boot crash reading PowerProfile" into nyc-dev 2016-06-22 17:31:35 +00:00
Adam Lesinski
1a76a62b8d Prevent early boot crash reading PowerProfile
The PowerProfile in BatteryStatsImpl may not be ready when
resetting stats early in the boot sequence.

Bug:29559031
Change-Id: I51bba762231a08804f1b68505bb1b0523476081d
2016-06-22 10:28:47 -07:00
Roozbeh Pournader
1f2f328025 Merge \"Mark Serbian in Latin script as non-localized [DO NOT MERGE]\" into nyc-dev
am: 160126e2d8

Change-Id: I0897fc904264955dddf459c893bd774fb1ff74e1
2016-06-20 21:44:50 +00:00
Roozbeh Pournader
160126e2d8 Merge "Mark Serbian in Latin script as non-localized [DO NOT MERGE]" into nyc-dev 2016-06-20 21:39:22 +00:00
Adam Lesinski
145e50243e Merge \"BatteryStats: record best estimated battery capacity\" into nyc-dev
am: c2e06a55f9

Change-Id: Ifb3d993b085040c17f136dd0f91433762d3d548f
2016-06-20 19:55:37 +00:00
TreeHugger Robot
c2e06a55f9 Merge "BatteryStats: record best estimated battery capacity" into nyc-dev 2016-06-20 19:49:46 +00:00
Adam Lesinski
f9b20a9ec4 BatteryStats: record best estimated battery capacity
Using the coulomb counter, record the estimated max battery
capacity.

Bug:28743761
Change-Id: I1270b062cf4a1e6fd69ea1da3de11a85a81b3663
2016-06-20 10:58:37 -07:00
Roozbeh Pournader
e977b0ae59 Mark Serbian in Latin script as non-localized [DO NOT MERGE]
Serbian in Latin script is only partially localized in Android N. We
should not show it as localized in either Setup Wizard or Settings.

Bug: 29460424
Change-Id: I6829a89c49c1b5e8768b1527daa3aa9508deb491
2016-06-17 17:34:13 -07:00
Selim Cinek
0630d92064 Merge \"Added dismiss, expand, and collapse accessibility actions\" into nyc-dev
am: c1720dce1b

Change-Id: I25bd41f1307233bba14067952086ca7be3118505
2016-06-16 04:25:26 +00:00
TreeHugger Robot
c1720dce1b Merge "Added dismiss, expand, and collapse accessibility actions" into nyc-dev 2016-06-16 04:19:48 +00:00
Mihai Nita
d80a8e8fe7 Merge \"Fix for NullPointerException in SuggestedLocaleAdapter\" into nyc-dev
am: c8c9afeacb

Change-Id: Ib9d44296bbb851940a0da0a9a6234f2023dfef25
2016-06-16 00:37:54 +00:00
Mihai Niță
c8c9afeacb Merge "Fix for NullPointerException in SuggestedLocaleAdapter" into nyc-dev 2016-06-16 00:28:37 +00:00
Mihai Nita
1711d430cb Fix for NullPointerException in SuggestedLocaleAdapter
Bug: 28748150
Change-Id: Ide2d176d3bc0bb7529bf831b553db3ade37ddb69
2016-06-15 17:07:10 -07:00
Selim Cinek
e9bad242f3 Added dismiss, expand, and collapse accessibility actions
Fixes: 20343017
Fixes: 29368014
Change-Id: Ib571242aac04c67aea2f3c3ce76139eaedc1f3f1
2016-06-15 16:30:09 -07:00
Yohei Yukawa
bb587122c6 Merge \"Quick workaround for a performance regression in IME APIs.\" into nyc-dev
am: 6fe4865e85

Change-Id: Id039d1dd681483c1d86349ee7e765b2f1f4fa95f
2016-06-14 22:47:28 +00:00
Yohei Yukawa
6fe4865e85 Merge "Quick workaround for a performance regression in IME APIs." into nyc-dev 2016-06-14 22:43:19 +00:00
Yohei Yukawa
ccb024aa2b Quick workaround for a performance regression in IME APIs.
It turns out that the performance of
InputMethodManager#getCurrentInputMethodSubtype() is regressed from ~1ms
to ~20ms when
 - Settings.Secure.SELECTED_INPUT_METHOD_SUBTYPE == -1 and
 - The active IME supports many subtypes (~100)
because we try to find a fallback subtype based on the system locales
every time when IMM#getCurrentInputMethodSubtype() is called.

This could be contributing UI janks because spell checker clients
running in the UI thread indirectly depend on that method.

Fortunatelly the critical path is in
InputMethodUtils#getImplicitlyApplicableSubtypesLockedImpl(), which is
basically a state-less method. We can easily and safely cache its
result by using LocaleList and InputMethod as cache keys.

With this CL the performance basically recovers to the Android M level.

Bug: 28889203
Change-Id: I5ed16c7f14cc18052854f4fd6c9bae8550c332ee
2016-06-14 21:01:41 +00:00
Adrian Roos
0a91c8dddf Merge \"Add MessagingStyle transitions\" into nyc-dev
am: a5e2aa99c0

Change-Id: I96170c3811dd624969a1f93bb7a2dc65b8d5df0a
2016-06-13 22:20:05 +00:00
Adrian Roos
a5e2aa99c0 Merge "Add MessagingStyle transitions" into nyc-dev 2016-06-13 21:45:08 +00:00
Adrian Roos
feafa052f3 Add MessagingStyle transitions
Fixes a particularly bad transition in the case where there
is one incoming message to a group.

Change-Id: Ieddece4a496292a69e14cdcd74d94986938d8223
Fixes: 29043489
2016-06-13 14:31:51 -07:00
Andrii Kulian
6e6b0ce1a6 Merge \"Reinflate primary action mode view after detach\" into nyc-dev
am: 82f2df6108

Change-Id: I80f1aa56145ea12001942c57161305b3fcdcc226
2016-06-11 01:38:37 +00:00
TreeHugger Robot
82f2df6108 Merge "Reinflate primary action mode view after detach" into nyc-dev 2016-06-11 01:31:15 +00:00
Andrii Kulian
8d6ac26504 Reinflate primary action mode view after detach
When app is resized in multi-window mode we preserve the window along
with the decor view. If action mode view was shown before such config
change, its view is detached, but the mPrimaryActionModeView variable
is not cleared. So when action mode view is shown again after that it
thinks that its view is still alive.
This CL adds additional check to inflate new mPrimaryActionModeView
if it is not attached to any window.

Bug: 28971666
Change-Id: Ia8c24d4322be32e8b2c8967301beb3a4d889d501
2016-06-10 16:07:43 -07:00
Adam Lesinski
643fc8341a Merge \"BatteryStats: Fix read/write parcel order\" into nyc-dev
am: e8a442ccd6

Change-Id: Ic0a5b9acedd9ed56aaa189aaf89aaa10f273f019
2016-06-10 22:43:49 +00:00
Adam Lesinski
e8a442ccd6 Merge "BatteryStats: Fix read/write parcel order" into nyc-dev 2016-06-10 22:29:15 +00:00
Adam Lesinski
67c134f849 BatteryStats: Fix read/write parcel order
Also moves discharge coulomb data to BATTERY_DISCHARGE_DATA checkin line.

Bug:29264326
Bug:28743761
Change-Id: I78881e166c11f40b2397e04d2cab8d5200c71eea
2016-06-10 15:24:16 -07:00
Adam Lesinski
ae903e100f Merge \"BatteryStats: Record fine grained battery discharge\" into nyc-dev
am: 094c40b2cc

Change-Id: Ia25345a4ae48ad181edb58fd4b5940145ce19107
2016-06-10 02:21:50 +00:00