2975 Commits

Author SHA1 Message Date
Mike Lockwood
7531aa2235 Add support for USB devices with multiple configurations and alternate interfaces
Added UsbConfiguration class, as well as accessors to UsbDevice to get configuration list
Added methods to UsbDeviceConnection to select configurations and alternate interfaces.

Also added accessors for USB descriptor name strings and fixed some memory leaks in the JNI code.

Bug: 12425052
Change-Id: Idb990f4d5c054a8cb997eb3f440f6da9f83bce05
2014-02-27 09:59:02 -08:00
George Mount
94b5ca811e Merge "Change Activity Scene Transitions to be more automatic redo." 2014-02-27 15:15:06 +00:00
Dianne Hackborn
d45665bf0b Collect per-uid mobile radio usage.
We now compute radio active time per application, by distributing
the active time across all applications each time the radio goes
down, weighting it by the number of packets transferred.

Per-app radio power use is now computed using this radio active
time.

This also gives us a new metric "ms per packet", which give an
idea of how effectively an application is using the radio.  This
is collected and reported as a new set of stats in the human-
readable checkin.  (It can be computed from the raw checkin data).

Also improve sync reporting to include the sync source as used
in wake locks, not just the component name.

Change-Id: I0b0185fadd1e47ae749090ed36728ab78ac24c5e
2014-02-26 15:53:44 -08:00
George Mount
e180337ee9 Change Activity Scene Transitions to be more automatic redo.
This reverts commit 206e30cd93afe3eb72ec94178324417db5424ed2
along with removing the additional startActivity* methods
and replaces them with ActivityOptions makeSceneTransitionAnimation
methods.

Change-Id: I52bec31ae3c4cea6d549810ae5a7acd8aea176d8
2014-02-26 15:30:22 -08:00
George Mount
206e30cd93 Revert "Change Activity Scene Transitions to be more automatic."
This reverts commit f10587faadb9080a7bf9991cbe04bac5525da482.

Change-Id: I2785a3d2d6b667cad6d61dcbbc1c624161735fa4
2014-02-26 08:56:30 -08:00
Christopher Tate
c900829c17 Merge "Deal with apps known to LocalTransport backend but with no data" 2014-02-26 02:48:09 +00:00
Christopher Tate
a9b91864a1 Deal with apps known to LocalTransport backend but with no data
An app might have backed something up and later deleted it, in which
case it will have a directory in the LocalTransport bookkeeping but
with no actual dataset.  Skip these packages at restore time, since
we know a priori that there will be nothing to do.

Change-Id: I85853097bc65ed60e5efd217ee6553b50459e445
2014-02-25 17:42:21 -08:00
George Mount
121e25dcf0 Merge "Change Activity Scene Transitions to be more automatic." 2014-02-25 23:47:57 +00:00
Dianne Hackborn
a1f1a3c573 More battery stats.
- Add events for sync.
- Add more descriptive tags for wake events.
- Fix battery reset.
- Fix tracking of wifi data.

Change-Id: Ic07f2a86a5ed33e7da57eb1108c31c777ecd801f
2014-02-25 13:20:07 -08:00
John Spurlock
a77cf87354 Merge "Tabs -> spaces in frameworks/base." 2014-02-25 19:57:33 +00:00
George Mount
f10587faad Change Activity Scene Transitions to be more automatic.
Shared element transitions are enabled by default
when the Window has a TransitionManager.

Shared element location and size are captured and
transferred to the target Activity.

ActionBar is treated as a shared element.

Change-Id: I0f22ea4e5cbe80254e848444e3f235cb742684f4
2014-02-25 11:12:16 -08:00
John Spurlock
8a985d24ce Tabs -> spaces in frameworks/base.
Change-Id: I5a84e8e93ac99b5ed0212b37bf66efa5e53864be
2014-02-25 09:49:29 -05:00
Dianne Hackborn
fb7b50a026 Fix some issues with network usage in battery stats.
Change-Id: I8b354872511fcb55cecb2e09aada2eab41a1e202
2014-02-24 17:06:14 -08:00
Dianne Hackborn
d0c5b9abed Improve how battery stats collects network stats.
This optimizes the path for battery stats to collect
per-uid network usage.  It now collects wifi and mobile
usage separately, with a path that allows it to recycle
all data structures and filter out stats it isn't
interested in before they come back to java.

This is setting us up for the actual goal, to collect
mobile stats independently each time the mobile radio
goes down, allowing us to distribute mobile radio usage
across uids based on the number of packets they transferred
during a session.

Change-Id: I21a0f517cf087ea5aa8b8dd535e20b46e361a52b
2014-02-24 11:35:20 -08:00
Christopher Tate
b048c33d5b Don't assume that we're at start of file at ctor time
BackupDataReader / BackupDataWriter were implicitly assuming that when
instantiated, the underlying fd was positioned at start-of-file.  If one
tried to e.g. open an existing data stream to append further data to it,
things might randomly fail (at read time, possibly when consuming the
stream later) due to incorrect alignment of the data entities: the
appending writer would assume that no padding was needed to achieve
correct alignment, and this might easily be false.

Now the underlying native reader/writer helpers recognize the true
position within the file when constructed, and as a result it's now
safe to e.g. construct a BackupDataOutput for an existing file and
then append to it.

Change-Id: If0484921e687852f923a4b4efabff573a6c16981
2014-02-21 12:58:04 -08:00
Alan Viverette
621e1e8493 Merge "Fix for reveal animated drawables" 2014-02-19 22:41:56 +00:00
Alan Viverette
7f610fed10 Fix for reveal animated drawables
Includes fixes for RevealDrawable clipping, touch feedback constant
state, and action bar background display lists.

BUG: 13065159
Change-Id: Ie4bf03f59da69047e18a8fe9233c3d24b0160576
2014-02-19 14:40:12 -08:00
Adam Lesinski
a78068e7a3 am 13c83996: am 1c532c2e: am 4b07b26e: Merge "Make UsbService optional" into klp-modular-dev
* commit '13c839962e246517a7a95326610ea30c529d79dc':
  Make UsbService optional
2014-02-19 19:48:05 +00:00
Adam Lesinski
1c532c2e2d am 4b07b26e: Merge "Make UsbService optional" into klp-modular-dev
* commit '4b07b26e8654df52ca80bb2165ebdf9352ab9337':
  Make UsbService optional
2014-02-19 19:41:26 +00:00
Alan Viverette
5314b3d593 Merge "Fix alert dialog's background when no custom panel visible" 2014-02-19 19:19:11 +00:00
Dianne Hackborn
b3f38c6398 Merge "Fix issue #13095629: Device is in restart mode for long time..." 2014-02-19 18:57:50 +00:00
Dianne Hackborn
00e2521d2a Fix issue #13095629: Device is in restart mode for long time...
...during taking OTA

Add some sanity checks.

Change-Id: I6bec1b8d8443c4b3c2a706635acf89c8e5051428
2014-02-19 10:49:24 -08:00
Alan Viverette
c3cf19af8d Fix alert dialog's background when no custom panel visible
Also some miscellaneous AlertController cleanup.

BUG: 13077576
Change-Id: I40f669f3a703a49fc53f482c2434b2993ed15326
2014-02-18 18:29:11 -08:00
Dianne Hackborn
dfc60ec523 Fix issue #13065185: Frequent runtime restarts on launching...
..."Hill Climb Racing" app

A service is in use when it is in the restarting state.

Change-Id: Ic92a6e7bcc24b01aeef5f97f994f105d5e11ea7f
2014-02-18 17:42:55 -08:00
Adam Lesinski
2cb6c60c0d Make UsbService optional
Tweaked the services Android.mk to build dependencies
when building with mm[m].

Change-Id: I6dad511c652bcacc085f27ede5f8f22a6982c6bd
2014-02-18 14:57:09 -08:00
Dianne Hackborn
ca1bf21c51 Implement wifi part of issue #12973036: Improve power_profile.xml
Add battery stats tracking of wifi state.

Also update when we retrieve the current time to use a more
consistent value across stats tracking.

Change-Id: I6a7c3efd58ff2c8ea86dac141c8f848e7996d63f
2014-02-18 14:43:14 -08:00
Paul Lawrence
a9f387bdf0 Merge "Support default, pattern, pin and password encryption types" 2014-02-14 15:25:01 +00:00
Jeff Brown
2811490455 am f75aaf02: am ae254a8d: am 3048191b: Remove onCreate() method that should not be there.
* commit 'f75aaf0282531f8e8448bfb1cbdfb239f683ae8b':
  Remove onCreate() method that should not be there.
2014-02-14 09:50:48 +00:00
Jeff Brown
ae254a8d71 am 3048191b: Remove onCreate() method that should not be there.
* commit '3048191b4cf9eff7a72b84065dec2b3dd1e89b3c':
  Remove onCreate() method that should not be there.
2014-02-14 09:14:15 +00:00
Jeff Brown
3048191b4c Remove onCreate() method that should not be there.
Change-Id: I8355dd78f910afa9895d2fa00cb627a0885d9eec
2014-02-13 23:26:59 -08:00
Dianne Hackborn
d39ccd0ad9 Merge "Start tracking radio up time." 2014-02-13 17:56:12 +00:00
Dianne Hackborn
e13c4c0b66 Start tracking radio up time.
We now always turn on network state tracking for mobile,
and push this information down to battery stats.

In battery stats we use this to both log the changes in
the history and keep track of the total time the mobile
radio was active.

Power computation is switched over to using this information
to help determine power use, which will hopefully make it
more accurate (not counting inaccuracies in knowing when it
actually goes down).

Note yet done is aggregating this data per-uid, to better
emphasize which apps are causing the radio to be up.  Right
now we just spread the total time across all uids weighted
by the total number of packets they have sent and received.

Also put in the battery stats infrastructure for bluetooth to
address issue #12973036: Improve power_profile.xml

Change-Id: I39d11b7ff6ae4f336f253d1cba308d8569de7e0d
2014-02-13 17:55:40 +00:00
Paul Lawrence
8e39736f91 Support default, pattern, pin and password encryption types
Java plumbing to expose methods to get/set encryption type in
IMountService, and hooking up of those methods to the Settings app
so the type is set correctly.

Needs matching vold changes from
 https://googleplex-android-review.googlesource.com/#/c/412649/

Bug: 8769627
Change-Id: I70c0ed72d11f5ab6f0958a7f9c101b6822b13baa
2014-02-13 15:46:24 +00:00
Dave Platt
2c7c0a8527 am 5137fa03: am 34cc9f90: am 53c7608a: am a3c3533b: Merge "Finish fixing Zygote descriptor leakage problem"
* commit '5137fa03c3e416c6f68c36f3ec922621853609b1':
  Finish fixing Zygote descriptor leakage problem
2014-02-13 01:11:41 +00:00
Dave Platt
34cc9f9056 am 53c7608a: am a3c3533b: Merge "Finish fixing Zygote descriptor leakage problem"
* commit '53c7608aefb0ed754394e571cac02e96ad6fcdb3':
  Finish fixing Zygote descriptor leakage problem
2014-02-12 23:10:36 +00:00
Christopher Tate
9d6376a1d8 Always call super.onCreate(). Always.
Bug 12991134

Change-Id: Ife16ef93408253e3318a06dc0206ab4b88c7f367
2014-02-12 13:15:46 -08:00
Jeff Brown
cab8617b8c am 25df673b: am 1b51c9cb: Merge "Make SystemService constructor take a Context." into klp-modular-dev
* commit '25df673b849de374cf1de40250dfd8a48b7ac28b':
  Make SystemService constructor take a Context.
2014-02-11 08:33:50 +00:00
Jeff Brown
25df673b84 am 1b51c9cb: Merge "Make SystemService constructor take a Context." into klp-modular-dev
* commit '1b51c9cb96fe2a0818289857a016521eed1ec183':
  Make SystemService constructor take a Context.
2014-02-11 08:18:34 +00:00
Jeff Brown
b880d880c6 Make SystemService constructor take a Context.
This change simplifies the process of initializing a SystemService
by folding the onCreate() step back into the constructor.  It removes
some ambuiguity about what work should happen in the constructor and
should make it possible for services to retain most of their final
fields after refactoring into the new pattern.

Change-Id: I25f41af0321bc01898658ab44b369f9c5d16800b
2014-02-10 20:01:43 -08:00
Dianne Hackborn
68ac5cef63 Merge "Battery stats: more events, fixes." 2014-02-07 21:56:45 +00:00
Dianne Hackborn
eaf2ac464b Battery stats: more events, fixes.
Add new history events for top application package and
foreground application packages.

Doing this involved a fair amount of improvement to history
events.  The event code is now separated out to have "start"
and "finish" identifies, and we use that to now keep track
of which events are active.  With that, when resetting the
stats, we can spit out all of the currently active events at
the front of the new history.

Also fixed some problems when I re-arranged the history delta
int bits that were conflicting with the packing of the battery
status bits.  These packing structures are changed to work
together correctly.

Change-Id: Ic8b815060dd8a50ff4a0a209efc2e1044215cd88
2014-02-07 13:45:01 -08:00
Adam Powell
6250c59e0d Merge "Refactoring of fitSystemWindows to applyWindowInsets for views" 2014-02-06 22:41:14 +00:00
Dave Platt
89d4c897a0 Finish fixing Zygote descriptor leakage problem
In order to prevent Zygote descriptors from leaking into the child
environment, they should be closed by the forked-off child process
before the child switches to the application UID.  These changes close
the descriptors via dup2(), substituting a descriptor open to
/dev/null in their place; this allows the Zygote Java code to close
the FileDescriptor objects cleanly.

This is a multi-project change: dalvik, art, libcore, frameworks/base,
and external/sepolicy are affected.  The CLs need to be approved
together, lest the build break or the software fail to boot.

Round 2: indent change

Bug: 12114500
Change-Id: I090402136a8a8b7d6aad6eb153026e85d7cf6ad3
2014-02-06 13:24:38 -08:00
Dianne Hackborn
6eb0fdb99b Merge "Improve logging of first wake lock, history size." 2014-02-06 00:41:49 +00:00
Dianne Hackborn
3d658bf20e Improve logging of first wake lock, history size.
We now try to have a better label for the first wake lock
that is acquired in the log.  This is done in two ways:

- The alarm manager now sorts the alarms it is going to
  execute so that wakeup alarms are first, which are more
  important w.r.t. which one should be logged.
- There is a new power manager facility to make a wake lock
  as "unimportant for logging," which just means in battery
  stats that a wake lock acquired after that can be considered
  the actual one to log.  This is only used by the alarm manager
  to mark its TIME_TICK alarms as unimportant for logging.

Also reworked the battery history code to be cleaner and a bit
smaller.  There is no longer a separate EVENT command, instead
the event code and tag are just another thing that can be included
in an UPDATE command.

The bits used in the first history int are also re-arrange, so
that only the ones that really change a fair amount in the state
bits are up at the top and there is no longer space used for
the command code (since now it is always just UPDATE).  This
allows us to have more room for the time delta at the bottom,
to better avoid situations where we need to write an int delta.

Change-Id: I1bb860ae5b558a248800b090b03a84fbf7acd68a
2014-02-05 16:40:51 -08:00
Adam Powell
46e38fd9ab Refactoring of fitSystemWindows to applyWindowInsets for views
Applying insets is now handled by:

* WindowInsets class - Encapsulate system insets and local decor
  insets into a single object, written specifically so that new inset
  categories may be added later. Apps cannot construct their own
  WindowInsets, only clone with optional modifications. This is to
  prevent losing data in the event of new insets added in the future.

* onApplyWindowInsets - Actually perform the application of insets.

* OnApplyWindowInsetsListener - Allow an app to use a separate
  Listener object to apply insets to a View. This allows for things
  like support lib integration in custom views written for older
  versions where the verifier would otherwise complain about the use
  of the new WindowInsets class as a method parameter. It also allows
  for applying insets in a custom way without writing a custom view.

* dispatchApplyWindowInsets - Dispatch the call to self and children
  in turn, if applicable. An OnApplyWindowInsetsListener will override
  the behavior of the view's default onApplyWindowInsets method; a
  listener wishing to call down to the 'superclass' implementation as
  part of its own operation should call view.onApplyWindowInsets. App
  code should generally not override this method and instead override
  onApplyWindowInsets or provide a listener.

Compatibility support with the existing fitSystemWindows method has
been provided in both directions: for code that previously called
fitSystemWindows on arbitrary views and also for code that overrode
the fitSystemWindows method in custom views. A view that supports the
newer onApplyWindowInsets mechanism should not mix that behavior with
other calls to fitSystemWindows or vice versa. Support lib-style code
should take care to consistently use one mechanism or the other at
runtime.

Change-Id: Ie88b96e0382beb5d3c3f6cd013f7043acbc0a105
2014-02-04 16:52:22 -08:00
Alan Viverette
8eea3ea559 Add APIs for obtaining themed Drawable from Theme, Context
BUG: 12611005
Change-Id: Ic0057be4e4c2d0c61ce02a019b3f7d0625e3a016
2014-02-03 18:42:24 -08:00
Dianne Hackborn
e8d916c04c Merge "More battery history improvements." 2014-02-03 21:32:33 +00:00
Dianne Hackborn
71fc13eb58 More battery history improvements.
- Better batching of history items.  Fixed problems where empty
  entries would be created because state toggles got lost.
- The string pool is now a HistoryTag pool, containing both a string
  and uid; now an entry only requires 16 bits in the history data.
- Acquiring the first wake lock also now includes a HistoryTag
  identifying who did the aquisition.
- Cleaned up printing of signal strengths and cell radio types.
- There was code that tried to allow you to add new history entries
  while iterating the history...  but these should never happen
  together, so turned that into a failure...  and fixed an issue
  where we could leave the battery stats in a state where it
  thinks it is continually iterating.

Change-Id: I1afa57ee2d66b186932c502dbdd633cdd4aed353
2014-02-03 10:58:50 -08:00
Narayan Kamath
dfd1aa4331 resolved conflicts for merge of 2cd0563c to klp-modular-dev-plus-aosp
Change-Id: Ia28df1c1aa084959ed9289bfe90e7f6a4bffb8a2
2014-01-31 12:57:24 +00:00