Commit Graph

6563 Commits

Author SHA1 Message Date
yuanhuihui
731918e769 Merge "fix wrong algorithm in WifiPowerPerPacket()" am: 16e1007481
am: b2eb8ea894

Change-Id: I5ace39e2b6b679622f9c2ab27831a1e079541e32
2016-09-19 18:40:37 +00:00
yuanhuihui
b2eb8ea894 Merge "fix wrong algorithm in WifiPowerPerPacket()"
am: 16e1007481

Change-Id: I3bacf3deb99b10c5ae8fe22a02ad7066afc321e0
2016-09-19 18:34:42 +00:00
Treehugger Robot
16e1007481 Merge "fix wrong algorithm in WifiPowerPerPacket()" 2016-09-19 18:28:47 +00:00
yuanhuihui
9d8f51cbae fix wrong algorithm in WifiPowerPerPacket()
step1: PowerProfile.POWER_WIFI_ACTIVE represents energy consumption(mAh) per hour
devied by 3600, then WIFI_POWER ==> energy consumption(mAh) per second

step2: WIFI_BPS represents 1000000 bit per second
then (double)WIFI_BPS) / 8  ==> 1000000/8 Byte per second

step3: as upload and download, so divided  by 2;
then   (((double)WIFI_BPS) / 8 / 2048))  ==> 1000000/8/2048 KB per second
==> packet  per second (where 1 packet = 2 KB)

so WIFI_POWER / (((double)WIFI_BPS) / 8 / 2048) represents  mAh per Packet where 1 packet = 2 K.

when  divided by (60*60) again , that make WifiPowerEstimator narrow 3600 times.

Change-Id: Ic055a5145b6dfb1129c8969826329a3024c9e2b6
Signed-off-by: yuanhuihui <yuanhuihui@xiaomi.com>
2016-09-18 09:33:39 +08:00
Lorenzo Colitti
4e3d827695 Give WakeupMessage the ability to transport an object as well.
am: 302c37008f

Change-Id: I06152851a392de80b351f2eb332e31363d916b1d
2016-09-16 18:47:26 +00:00
Etan Cohen
e77c8c6486 Merge changes from topic 'undo_do_not_merge' into stage-aosp-master
* changes:
  Give WakeupMessage the ability to transport an object as well.
  [NAN] Add transport type for NAN.
2016-09-16 18:41:36 +00:00
Robert Sesek
5189f86a36 Move art::Runtime::InitZygote logic from art into frameworks/base. am: e4f8d69c58
am: c1b32fc3ea

Change-Id: Ifae90057835b576ca001a141cb56aa4e4f9ba321
2016-09-16 17:41:17 +00:00
Robert Sesek
c1b32fc3ea Move art::Runtime::InitZygote logic from art into frameworks/base.
am: e4f8d69c58

Change-Id: Ia6fdf02ba9d7cd6e473d2891d5b8e59b4e967347
2016-09-16 17:32:49 +00:00
Lorenzo Colitti
302c37008f Give WakeupMessage the ability to transport an object as well.
(cherry-pick of commit eab17da588)
(cherry-pick of commit 4171cdf303)

Bug: 23113288
Change-Id: Ic98e3bcb3ea8b0b28a309bd647fb4178311c46a3
2016-09-16 10:22:06 -07:00
Robert Sesek
e4f8d69c58 Move art::Runtime::InitZygote logic from art into frameworks/base.
Test: m
Test: aosp_angler-eng boots
Change-Id: I964c70576136e7424797140b2f7d179e70298c44
2016-09-14 14:31:12 -04:00
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
Paul Duffin
4f107811e2 Merge "Fix SuppressWarnings typo." am: 0bd7c54745
am: a155f43794

Change-Id: If228867926149f7cad9b5a479beefc45cacfe7f2
2016-09-08 12:32:31 +00:00
Paul Duffin
a155f43794 Merge "Fix SuppressWarnings typo."
am: 0bd7c54745

Change-Id: I43a9bea860188f55292dcbeac38bf026d87fa634
2016-09-08 12:27:27 +00: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
The Android Automerger
f287780643 Manually merge commit 'b0b6afc' into nyc-dev-plus-aosp 2016-08-30 00:26:21 +00:00
Yuichi Biwa
98a824dbb7 ChooserActivity: Cannot start app that the icon overflows the layout
am: cb3e1237b5

Change-Id: I066aa6f03ea3c45fa1330556bc3a6db29ab48262
2016-08-29 22:18:46 +00:00
Abodunrinwa Toki
6507b8b333 FloatingActionMode: Fix screen coordinates.
am: 99c340cad9

Change-Id: I73ff6d1b3bed01d7738634c67a6f6d1a2e755da1
2016-08-29 22:18:07 +00: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
Yuichi Biwa
cb3e1237b5 ChooserActivity: Cannot start app that the icon overflows the layout
Symptom:
When sharing an image from Album, ChooserActivity can be shown.
But then the app to be located to the bottom part of the list may not
be started even if user tap it.

Root cause:
ChooserActivity uses ResolverDrawerLayout. And ResolverDrawerLayout
can display only some items on the list (known as "Collapse mode").
When the item clipping along the bottom edge is tapped by the user,
ResolverDrawerLayout tries to expand the list and scroll it to a
better position, instead of starting an application.
In this problem case, ResolverDrawerLayout continues to try to expand
the list whenever tapping, so an application will never start.

Solution:
Change a condition so that mOpenOnClick becomes true only when the list
has been collapsed (mCollapseOffset > 0).

Bug: 30153542

Change-Id: I576fb6c8b6a91d79c1e0d46d069146779f4dbd17
(cherry picked from commit 4f3a843ea9)
2016-08-27 01:36:44 +00:00
Abodunrinwa Toki
99c340cad9 FloatingActionMode: Fix screen coordinates.
Use application context to get the screen's display metrics.

Bug: 30127070
Change-Id: I2c453c494ef210c12d89fc7e3ff026728f9ecb0f
(cherry picked from commit afb38c5cc4)
2016-08-27 01:27:28 +00: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
Jim Miller
7329e02153 Fix vulnerability in LockSettings service am: 2d71384a13 am: 485fbda04c am: 229de7088e am: cb83f6188b
am: e3457fc127

Change-Id: I9ec3cc802112160f463fcfb737c6fd5932d62332
2016-08-17 23:31:06 +00:00
Jim Miller
e3457fc127 Fix vulnerability in LockSettings service am: 2d71384a13 am: 485fbda04c am: 229de7088e
am: cb83f6188b

Change-Id: I82302931ab714e25ec21721dc05480e1f2d447b0
2016-08-17 23:22:33 +00:00
Jim Miller
cb83f6188b Fix vulnerability in LockSettings service am: 2d71384a13 am: 485fbda04c
am: 229de7088e

Change-Id: I8e9d946f96933c1338261d8adf80156cb67d3ba1
2016-08-17 23:15:43 +00:00
Jim Miller
229de7088e Fix vulnerability in LockSettings service am: 2d71384a13
am: 485fbda04c

Change-Id: I07def32199ecdbbb32aa6ecaca20724cfc81265c
2016-08-17 23:07:46 +00:00
Jim Miller
485fbda04c Fix vulnerability in LockSettings service
am: 2d71384a13

Change-Id: I62ca5fb150022fe0971329294b1063957f397248
2016-08-17 22:59:27 +00: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
Jim Miller
2d71384a13 Fix vulnerability in LockSettings service
Fixes bug 30003944

Change-Id: I8700d4424c6186c8d5e71d2fdede0223ad86904d
2016-08-16 00:09:33 +00: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