Commit Graph

2397 Commits

Author SHA1 Message Date
Prerepa Viswanadham
d1808401ca Merge changes from topic 'mwd-merge-050415' into mnc-dev
* changes:
  Merge commit 'b6f59f4' into master_merge
  Merge commit 'f6db0ce' into master_merge
  Merge commit '17455a3' into master_merge
  Merge commit 'b4d5b32' into master_merge
  Merge commit 'a1a2fa7' into master_merge
  Merge commit '8dfdb98' into master_merge
  Merge commit 'eba66c3' into master_merge
2015-05-05 01:06:38 +00:00
Jeff Sharkey
c840681dbd Avoid NPE when fsUuid is null.
Bug: 20822962
Change-Id: I6340b70dba5a4f94a0f08ddfbda0190db97746f1
2015-05-04 12:04:09 -07:00
Svet Ganov
b9d71a6f89 Add body sensors app op - framework base
Change-Id: Idd5cd573fab3405e5b2a6e51d2d9d115650826e9
2015-05-01 13:56:04 -07:00
Dan Sandler
9fc943d1a6 Merge "Icon: a clean, parcelable place for images." into mnc-dev 2015-05-01 17:57:14 +00:00
Dan Sandler
b9f7aac348 Icon: a clean, parcelable place for images.
Binder APIs which wish to consume Bitmaps *and* drawable
resources can now do so by using Icon, a kind of union type
that accommodates each of these. Icon also accepts byte
arrays holding compressed Bitmaps (PNG, JPEG, etc), which
saves clients the additional memory cost of decoding and
sending full uncompressed bitmaps through Binder interfaces.
Receiving clients can call loadDrawable{,Async} and then
getDrawable to start immediately using the image in an
ImageView or other Drawable-hosting container.

Bug: 19609468
Change-Id: Ic1343711c2ac0b15876b46f0b6008b0108a49470
2015-05-01 13:44:42 -04:00
Jeff Sharkey
a320505f3a Merge "Move both app code and data together." into mnc-dev 2015-05-01 16:22:46 +00:00
Jeff Sharkey
bd0e9e4958 Move both app code and data together.
Refactor app movement code into the normal install flow as a new
flavor of InstallArgs.  It copies both app code and data during the
copy step, and just updates paths during the rename step.

Measure free space before kicking off a move.  Spawn a thread to
derive a hacky progress estimate based on free disk space counting
down.

Remove checkFreeStorage() and getLegacyNativeLibraryPath() which
nobody was calling.  Fix deadlocks around package broadcasts, and fix
wrong lock ordering when loading packages.

Bug: 19993667, 20275578, 20370140
Change-Id: I7bbf14c924a724d6ebb8a41a02434750fa3302bc
2015-04-30 16:04:53 -07:00
Andreas Gampe
fcda22b1fe Merge "am b6d14a00: resolved conflicts for merge of c29791d5 to mnc-dev-plus-aosp" into mnc-dev 2015-04-30 17:53:51 +00:00
Jeff Sharkey
15cbbd5e4b am 21a30889: am 1df4dca2: am 9e98dce6: Merge "Returning to wizard, split move events." into mnc-dev
* commit '21a30889485020bf885ca20e209ed85c6e7d4ea5':
  Returning to wizard, split move events.
2015-04-30 01:21:08 +00:00
Jeff Sharkey
21a3088948 am 1df4dca2: am 9e98dce6: Merge "Returning to wizard, split move events." into mnc-dev
* commit '1df4dca2982acecb526495b30a605d97786df0de':
  Returning to wizard, split move events.
2015-04-30 01:01:48 +00:00
Jeff Sharkey
50a0545479 Returning to wizard, split move events.
Finish wiring up notifications to jump back into in-progress wizard
flow, using moveId as identifier.

Split move events back into separate creation and progress events,
and pass details as bundle to pass extra stuff like UUID.  Null
package still means moving primary storage.

Add explicit "volume forgotten" event for PackageManager to clean
up internal state with.

Plumb through internal path reported by vold, and bring back FUSE
bypass rewriting optimization.

Bug: 19993667
Change-Id: I0f43edbba36c58c5cd33550022c54c4eb9f01a48
2015-04-29 17:24:12 -07:00
Amith Yamasani
98322c8e88 am 278886d5: am 3184b286: am fa4eda44: Merge "Remove network access for idle apps" into mnc-dev
* commit '278886d50a66689529320f9bd735177c068e210d':
  Remove network access for idle apps
2015-04-29 23:04:50 +00:00
Amith Yamasani
278886d50a am 3184b286: am fa4eda44: Merge "Remove network access for idle apps" into mnc-dev
* commit '3184b28648a782a3a037de90bc76f64839b91560':
  Remove network access for idle apps
2015-04-29 22:52:08 +00:00
Amith Yamasani
15e47235c0 Remove network access for idle apps
Track apps going in and out of idle in the NetworkPolicyManagerService.
Apply DROP rules in firewall controller if app is to be blacklisted
for network access.

Firewall can now be in whitelist (old) or blacklist mode. When in
blacklist, it allows all by default and we can selectively DENY
some uids.

Track app idle in UsageStats and update periodically.
Track charging/discharging states.

TODO: Check for appidle temporary parole state

Bug: 20066058
Change-Id: Ia65d7544204b3bcb78a517310ef4adcc05aac6fb
2015-04-29 14:21:53 -07:00
Dianne Hackborn
c5cbdfcfe5 am 8756f9b3: am 599a4e0e: am 9ac2718e: Merge "Implement user-settable power save whitelist." into mnc-dev
* commit '8756f9b34dd04cabae7487bd1941008a6c98c4c6':
  Implement user-settable power save whitelist.
2015-04-29 21:02:36 +00:00
Dianne Hackborn
8756f9b34d am 599a4e0e: am 9ac2718e: Merge "Implement user-settable power save whitelist." into mnc-dev
* commit '599a4e0ea864769e6cd1d04bd766c472b16be4c7':
  Implement user-settable power save whitelist.
2015-04-29 20:51:04 +00:00
Svet Ganov
8baf2b6663 am 0dbaba6c: am 5e47c802: am 56867804: Merge "Respect the record audio app op - framework" into mnc-dev
* commit '0dbaba6c3a7ae0a45e2305a21b0ef5decbde59a4':
  Respect the record audio app op - framework
2015-04-29 20:09:09 +00:00
Svet Ganov
0dbaba6c3a am 5e47c802: am 56867804: Merge "Respect the record audio app op - framework" into mnc-dev
* commit '5e47c802ef1ac9437b012bc70701ffaf048cb399':
  Respect the record audio app op - framework
2015-04-29 19:55:31 +00:00
Dianne Hackborn
0b4daca9ba Implement user-settable power save whitelist.
The whitelist is now maintained by DeviceIdleController,
which is moving out into its own independent system service.
Network stats now queries it for the whitelist, instead of
collecting that itself.

Also did a few improvements in alarm manager -- made the
code for moving alarms out of the pending list more robust,
and fixed the debug output to always print the contents of
the pending list even if we aren't in a pending state.  (That
would have helped me identify the problem much earlier.)

Change-Id: I0f7119d4c553c3af4d77b2f71246fa6e2c13c561
2015-04-29 12:38:09 -07:00
Svet Ganov
5686780404 Merge "Respect the record audio app op - framework" into mnc-dev 2015-04-29 19:34:06 +00:00
Jeff Sharkey
d70088d811 am 572b1078: am 15c7f90c: am b42d6946: Method to wipe all adoptable disks.
* commit '572b1078962437d7495f395bda0bc8125c833465':
  Method to wipe all adoptable disks.
2015-04-29 06:04:37 +00:00
Jeff Sharkey
9f1a1bd82d am a149ba02: am aa4e35eb: am b36586a7: Split some VolumeInfo state into VolumeRecord.
* commit 'a149ba0255c5983b4e0b23b120b388b9236583e9':
  Split some VolumeInfo state into VolumeRecord.
2015-04-29 05:52:54 +00:00
Jeff Sharkey
572b107896 am 15c7f90c: am b42d6946: Method to wipe all adoptable disks.
* commit '15c7f90c8d84ce992659d0ec29bb0e60f1b603d1':
  Method to wipe all adoptable disks.
2015-04-29 05:52:35 +00:00
Jeff Sharkey
a149ba0255 am aa4e35eb: am b36586a7: Split some VolumeInfo state into VolumeRecord.
* commit 'aa4e35eb6540806958cb37c5c564c5d20dd7a978':
  Split some VolumeInfo state into VolumeRecord.
2015-04-29 05:41:33 +00:00
Jeff Sharkey
b42d694691 Method to wipe all adoptable disks.
Will be used by various classes doing factory reset.

Bug: 9433509
Change-Id: I0701abe00abc2fb9085ce1ffe6e28fb27c91ab51
2015-04-28 22:25:26 -07:00
Jeff Sharkey
b36586a7c9 Split some VolumeInfo state into VolumeRecord.
VolumeRecord is a historical record of a volume that we've seen in
the past.  It's now surfaced outside the framework for SystemUI to
drive the notifications that bug users to reinsert missing private
volumes.

Show progress notifications for both storage and package movement
operations.  Notify when an empty disk is inserted (no usable volumes)
which launches into the normal format flow.

Add API to forget volumes.

Bug: 20275424, 20275424
Change-Id: I75602c17fdcd4d1f1f62324e1a08c4a33093eefa
2015-04-28 22:02:36 -07:00
Svet Ganov
fa5ecdc4ac Respect the record audio app op - framework
Change-Id: I5696d2ef22738ccffaf8bd7a0ee68cbc3dea3bf1
2015-04-28 16:31:58 -07:00
Andreas Gampe
27c39f1ade am b6d14a00: resolved conflicts for merge of c29791d5 to mnc-dev-plus-aosp
* commit 'b6d14a009e43a4d61ae2a4f98f6e3b914148d0a9':
  Frameworks/base: Add debug.gencfi property

(cherry picked from commit a5b55a017a)
2015-04-28 13:46:00 -07:00
Narayan Kamath
b40b49577c am 7ecc6b72: am 71fa6862: Merge "Fix NPE in Bundle#hasFileDescriptor on null-valued SparseArray"
* commit '7ecc6b721e5da0cc3a52dc14bdfd8d1308db84bc':
  Fix NPE in Bundle#hasFileDescriptor on null-valued SparseArray
2015-04-28 10:00:25 +00:00
Narayan Kamath
498bf16ef0 am 90601a72: am b736868b: Merge "Fix NullPointerException in Bundle#hasFileDescriptors"
* commit '90601a724efea2a15769195b4c452d854607931e':
  Fix NullPointerException in Bundle#hasFileDescriptors
2015-04-28 10:00:15 +00:00
Narayan Kamath
7ecc6b721e am 71fa6862: Merge "Fix NPE in Bundle#hasFileDescriptor on null-valued SparseArray"
* commit '71fa6862f307796c659fd4e83a7724dd6851b69e':
  Fix NPE in Bundle#hasFileDescriptor on null-valued SparseArray
2015-04-28 09:48:24 +00:00
Narayan Kamath
90601a724e am b736868b: Merge "Fix NullPointerException in Bundle#hasFileDescriptors"
* commit 'b736868be917afd5d3ea7e8a8d3d658c4350a239':
  Fix NullPointerException in Bundle#hasFileDescriptors
2015-04-28 09:48:19 +00:00
Taiju Tsuiki
ecd2184873 Fix NPE in Bundle#hasFileDescriptor on null-valued SparseArray
Add a null check for each values of SparseArray in Bundle#hasFileDescriptor
to avoid NullPointerException.

Change-Id: I43ecc01f2759ccbe85b902fa118d55cb74ebf38b
2015-04-28 09:30:19 +01:00
Taiju Tsuiki
e58c7858a3 Fix NullPointerException in Bundle#hasFileDescriptors
Add null check for array elements in Bundle#hasFileDescriptors to avoid NPE on
null valued array.

Change-Id: Ic6ef8864ca6add023c7a69ba3c9474b0f6291723
2015-04-28 09:27:40 +01:00
Tor Norbye
7b4b844fdf Merge "Annotate some APIs with threading annotations" 2015-04-27 22:51:35 +00:00
Andreas Gampe
b6d14a009e resolved conflicts for merge of c29791d5 to mnc-dev-plus-aosp
Change-Id: I0e3dacbdfb68d6bb31800ff2e9969b96e63634b6
2015-04-27 10:18:08 -07:00
Andreas Gampe
0f94fc6f1d Merge "Frameworks/base: Fix a constructor" 2015-04-25 20:16:12 +00:00
Jeff Sharkey
275e3e43f2 Migrate primary external storage.
Wire up through MountService to call down into vold.  Watch for
unsolicited events that report progress, including special value "82"
that signals that copy has finished.  We use this value to persist
the volumeUuid in case of unexpected reboot, since it indicates the
new volume is ready.

Wire progress updates through existing callback pipeline.

Update the volume mounting code to match against the persisted UUID
when selecting the primary external storage.

Bug: 19993667
Change-Id: Id46957610fb43517bbfbc368f29b7d430664590d
2015-04-24 18:01:45 -07:00
Andreas Gampe
a876b35d48 Frameworks/base: Add debug.gencfi property
Add the debug.gencfi system property that forces generation of
CFI data.

Change-Id: Ida66f8c1567634d05cfdbba1a982be3684e94369
2015-04-24 16:31:41 -07:00
Jens Ole Lauridsen
0525677343 Merge "parcel: Add efficient methods for writing and reading a parcelable." 2015-04-24 22:37:46 +00:00
Jeff Sharkey
620b32b316 Package and storage movement callbacks.
Since package and primary storage movement can take quite awhile,
we want to have SystemUI surface progress and allow the Settings
app to be torn down while the movement proceeds in the background.

Movement requests now return a unique ID that identifies an ongoing
operation, and interested parties can observe ongoing progress and
final status.  Internally, progress and status are overloaded so
the values 0-100 are progress, and any values outside that range
are terminal status.

Add explicit constants for special-cased volume UUIDs, and change
the APIs to accept VolumeInfo to reduce confusion.  Internally the
UUID value "null" means internal storage, and "primary_physical"
means the current primary physical volume.  These values are used
for both package and primary storage movement destinations.

Persist the current primary storage location in MountService
metadata, since it can be moved over time.

Surface disk scanned events with separate volume count so we can
determine when it's partitioned successfully.  Also send broadcast
to support TvSettings launching into adoption flow.

Bug: 19993667
Change-Id: Ic8a4034033c3cb3262023dba4a642efc6795af10
2015-04-23 20:32:17 -07:00
Ben Kwa
62539a220c Move extension checking code into FileUtils.
Move code for checking file extensions and MIME types from
ExternalStorageProvider into android.os.FileUtils, so it can be used by
other clients (e.g. DownloadsProvider).

BUG=20157955

Change-Id: Ib16a16af723c21fb8d2912c8917dfd68653ea6fa
2015-04-23 16:14:20 -07:00
Tor Norbye
83c6896cbf Annotate some APIs with threading annotations
Change-Id: I24bda29261cdecbe78b2529866624b9313ca5c03
2015-04-23 22:14:19 +00:00
Jens Ole Lauridsen
8dea8744ac parcel: Add efficient methods for writing and reading a parcelable.
The documentation used to recommend calling Parcelable.writeToParcel
instead of using the Parcel API for sending Parcelable types.
This leaves the developer to have to deal with null values and makes
it harder to create tools that generate correct efficient code.
I suggest that we add a these 2 methods:
   writeTypedObject and createTypedObject
as an alternative.

Change-Id: I85443417909dcb9590d3f0a72f0130a4da4ead38
2015-04-23 14:12:04 -07:00
Neil Fuller
52dbaa08cd Merge "Add checks for types in Parcel / avoid class initialization" 2015-04-22 13:30:02 +00:00
Jeff Sharkey
e0ef7e8c60 Merge "Blend in force adoptable flag when set." 2015-04-21 19:45:02 +00:00
Jeff Sharkey
74acbbb2cd Blend in force adoptable flag when set.
Bug: 19993667
Change-Id: Ic7f348d171a89e889281b7efb1aa0cbade048975
2015-04-21 12:18:31 -07:00
Dan Sandler
aa861666ed Fix build.
Change-Id: I0e419fdb36cedba67fc6da7f71134d9728f66150
2015-04-21 10:26:13 -04:00
Dan Sandler
954863ab9b Merge "Add ashmem stats to Parcels." 2015-04-21 14:10:20 +00:00
Neil Fuller
44e440cc7e Add checks for types in Parcel / avoid class initialization
Make Parcel more stringent to avoid initializing classes
that are not related to Parcelable.

Two new checks:
1) That the class found on the stream implements Parcelable.
2) That the type of the CREATOR field declared on the class
found on the stream actually implements Parcelable.Creator.

For (1) the new check that a class in the stream is actually
Parcelable. This will affect handling of invalid streams or
code that didn't obey the requirements.

For (2) this change could break some apps that had a CREATOR
field in a Parcelable class that was not declared to be
(at least) a Parcelable.Creator: it is no longer sufficient
for the type to implement Parcelable.Creator, the field
must be declared as such.

This change includes doc updates for Parcelable to make
the requirement around the declared type of the CREATOR
field more concrete.

This change also makes the generics slightly tidier/explicit,
annotates code as unchecked where needed and removes some
assumptions that can not be guaranteed with Java's type
system and the current definitions.

For example, there's no guarantee right now that
Parcelable.Creator returns objects that are actually
Parcelable, or that the CREATOR object associated
with a Parcelable will return objects of the surrounding
class. The first we can't do something about without
breaking the public API (due to implementations like
TextUtils.CHAR_SEQUENCE_CREATOR). The second is
currently typically implicitly enforced with an implicit
cast in the (app's) calling code (e.g. callers to
readParcelable() that causes a language-introduced cast
to the type expected). A larger refactoring of Parcel
would be required to ensure that the class that is
produced by Creator is of a type compatible with the
class that declared CREATOR, and is not a goal for this
change.

A fix is included for a class that doesn't implement
Parcelable like it should and would probably fail
check (1).

Bug: 1171613
Change-Id: I31d07516efee29a320e80f4bc4f96aaac628f81c
2015-04-21 11:32:44 +01:00