Commit Graph

5558 Commits

Author SHA1 Message Date
Jeff Sharkey
4887789e44 Progress towards dynamic storage support.
Storage devices are no longer hard-coded, and instead bubble up from
whatever Disk and VolumeBase that vold uncovered, turning into
sibling Java objects in MountService.  We now treat vold events as
the source-of-truth for state, and synchronize our state by asking
vold to "reset" whenever we reconnect.

We've now moved to a model where all storage devices are mounted in
the root mount namespace (user boundaries protected with GIDs), so
we no longer need app-to-vold path translation.  This also means that
zygote only needs to bind mount the user-specific /mnt/user/n/ path
onto /storage/self/ to make legacy paths like /sdcard work.  This
grealy simplifies a lot of system code.

Many parts of the platform depend on a primary storage device always
being present, so we hack together a stub StorageVolume when vold
doesn't have a volume ready yet.

StorageVolume isn't really a volume anymore; it's the user-specific
view onto a volume, so MountService now filters and builds them
based on the calling user.  StorageVolume is now immutable, making
it easier to reason about.

Environment now builds all of its paths dynamically based on active
volumes.  Adds utility methods to turn int types and flags into
user-readable strings for debugging purposes.

Remove UMS sharing support for now, since no current devices support
it; MTP is the recommended solution going forward because it offers
better multi-user support.

Simplify unmount logic, since vold will now gladly trigger EJECTING
broadcast and kill stubborn processes.

Bug: 19993667
Change-Id: I9842280e61974c91bae15d764e386969aedcd338
2015-03-30 19:46:23 -07:00
Fabrice Di Meglio
607f1f09c3 Merge "Add IntentFilter auto verification" 2015-03-31 00:16:59 +00:00
Makoto Onuki
1040da1d4e Enterprise quick contact 1/2
Now openQuickContact goes thorough DPM.  When a lookup URI is build with
a lookup key returned by the enterprise lookup APIs for a corp contact, the
lookup key will have a special prefix.  In that case we go through DPM
and have it launch QC on the managed profile, if the policy allows.

For now we use the same DPM policy as enterprise-caller-id to disable this.

Design doc: go/cp2-mnc-enterprise-dd

Bug 19546108

Change-Id: I831a8190ae902ae3b1248cce6df02e3a48f602d2
2015-03-30 16:28:39 -07:00
Makoto Onuki
dc0078b794 Merge "Revert "Enterprise quick contact 1/2"" 2015-03-30 20:43:19 +00:00
Makoto Onuki
4fd8d4ab2a Revert "Enterprise quick contact 1/2"
This reverts commit 75a0882b94.

Change-Id: Ibe332885824b228bf1b1147d141c9395554ff67f
2015-03-30 20:42:20 +00:00
Makoto Onuki
b13f44bc6e Merge "Enterprise quick contact 1/2" 2015-03-30 19:24:42 +00:00
Fabrice Di Meglio
1c1b47125d Add IntentFilter auto verification
The purpose of this feature is to prompt the Disambiguation dialog
to Users as less as possible.

- add the new "autoVerify" property to the IntentFilter class
- add new APIs to PackageManager:
 verifyIntentFilter(int, int, List<String>),
 getIntentVerificationStatus(String, int),
 updateIntentVerificationStatus(String, int, int),
 getIntentFilterVerifications(String)
for supporting IntentFilter verification
- add support for multi-user
- update PackageManager for IntentFilter verification:
basically when we are installing a new package, ask for verification
of all domains from the IntentFilters that have the "autoVerify" to true.
This means that the PackageManager will send a well defined protected
broadcast (with a new INTENT_FILTER_NEEDS_VERIFICATION action) to
an IntentFilter verifier to do the real job of verification.
We are passing in the broadcast Intent all the necessary data for
doing the verification. The PackageManager will receive as response
the result code of the domain verifications and, if needed, the list
of domains that have failed the verification.
- add a new INTENT_FILTER_VERIFICATION_AGENT permission that needs to
be set by an intent filter verifier to be considered as a trustable
party by the PackageManager.
- add also a new BIND_INTENT_FILTER_VERIFIER permission for securing
the binding between the PackageManager and a service doing the
intent filter verifications.
- add ResolveInfo filterNeedsVerification which is a boolean
to knows if the IntentFilter is of a type that needs a verification
(action VIEW, category BROWABLE, HTTP/HTTPS data URI)
- add new "domain-preferred-apps" / "d" dump command for listing the
prefered Apps for all domains
- add new "intent-filter-verifiers" / "ivf" command for listing the
IntentFilterVerifier used
- introduce the IntentVerificationService which is a basic service
for verifying IntentFilters. This service will send HTTPS requests
to the domain declared in the IntentFilter(s) for doing the
verification. This service has a low priority level so that it
can be replaced by a more sophisticated one if needed. This service
is updating the PackageManager intent verification states thru
the updateIntentVerificationStatus(...) API.
- update MockPackageManager

Change-Id: I0bfed193d0bf1f7c7ac79f6c1b160b7ab93b5fb5
2015-03-30 10:58:35 -07:00
Makoto Onuki
75a0882b94 Enterprise quick contact 1/2
Now openQuickContact goes thorough DPM.  When a lookup URI is build with
a lookup key returned by the enterprise lookup APIs for a corp contact, the
lookup key will have a special prefix.  In that case we go through DPM
and have it launch QC on the managed profile, if the policy allows.

For now we use the same DPM policy as enterprise-caller-id to disable this.

Design doc: go/cp2-mnc-enterprise-dd

Bug 19546108

Change-Id: I4840e7fad8a6a60249df07d993d26d03619650d4
2015-03-27 17:19:01 -07:00
Christopher Tate
6e6af0d34e Merge "Add payload-size preflight stage to full transport backup" 2015-03-27 23:50:58 +00:00
Christopher Tate
11ae768cf1 Add payload-size preflight stage to full transport backup
We now peform a total-size preflight pass before committing data to the
wire.  This is to eliminate the large superfluous network traffic that
would otherwise happen if the transport enforces internal quotas: we
now instead ask the transport up front whether it's prepared to accept
a given payload size for the package.

From the app's perspective this preflight operation is indistinguishable
from a full-data backup pass.  If the app has provided its own full-data
handling in a subclassed backup agent, their usual file-providing code
path will be executed.  However, the files named for backup during this
pass are not opened and read; just measured for their total size.  As
far as component lifecycles, this measurement pass is simply another
call to the agent, immediately after it is bound, with identical
timeout semantics to the existing full-data backup invocation.

Once the app's file set has been measured the preflight operation
invokes a new method on BackupTransport, called checkFullBackupSize().
This method is called after performFullBackup() (which applies any
overall whitelist/blacklist policy) but before any data is delivered
to the transport via sendBackupData().  The return code from
checkFullBackupSize() is similar to the other transport methods:
TRANSPORT_OK to permit the full backup to proceed; or
TRANSPORT_REJECT_PACKAGE to indicate that the requested payload is
unacceptable; or TRANSPORT_ERROR to report a more serious overall
transport-level problem that prevents a full-data backup operation
from occurring right now.

The estimated payload currently does not include the size of the
source-package metadata (technically, the manifest entry in its
archive payload) or the size of any widget metadata associated with
the package's install.  In practice this means the preflighted size
underestimates by 3 to 5 KB.  In addition, the preflight API currently
cannot distinguish between payload sizes larger than 2 gigabytes;
any payload estimate larger than that is passed as Integer.MAX_VALUE
to the checkFullBackupSize() query.

Bug 19846750

Change-Id: I44498201e2d4b07482dcb3ca8fa6935dddc467ca
2015-03-26 18:57:36 -07:00
Rubin Xu
6a38e43b8b Fix build breakage by ag/661236
Change-Id: Ia42440f238d76066f449dccc463b0485ab558c4d
2015-03-26 14:47:45 +00:00
Rubin Xu
a55c27a79b Merge "Change doc for device initializer agent extra's type." 2015-03-26 13:16:07 +00:00
Rubin Xu
44ef750bd4 Change doc for device initializer agent extra's type.
Change the DIA extra's type to ComponentName, making it consistent with
EXTRA_PROVISIONING_DEVICE_ADMIN_COMPONENT_NAME.

Bug: 19891726
Change-Id: Ib41a9d22ff22e114cde80010fbc41db26f2b5f82
2015-03-26 12:11:04 +00:00
Amith Yamasani
f198900250 Merge "Fix documentation for ACTION_SET_PROFILE_OWNER" 2015-03-25 19:37:43 +00:00
Amith Yamasani
814e9873bd Fix documentation for ACTION_SET_PROFILE_OWNER
Does not require the mentioned permissions.

Bug: 19892754
Change-Id: I22f2563c4f50457dbeb22d734e96a99ef79adf2b
2015-03-25 11:11:54 -07:00
Andrei Kapishnikov
be22970dc2 Merge "Framework: Introduced new NFC provisioning mime-type application/com.android.managedprovisioning.v2" 2015-03-25 16:59:46 +00:00
Zoltan Szatmary-Ban
9c5dfa5c79 Data Usage public API
Added new API consisting of android.app.usage.NetworkUsageManager and
android.app.usage.NetworkUsageStats. Through them data usage on a
network interface can be programmatically queried. Both summary and
details are available.

Bug: 19208876
Change-Id: I0e0c4b37ae23ad1e589d4b0c955b93f28ba4333e
2015-03-25 15:53:38 +00:00
Andrei Kapishnikov
35e71f57b4 Framework: Introduced new NFC provisioning mime-type application/com.android.managedprovisioning.v2
Related CL: https://googleplex-android-review.git.corp.google.com/657588
Bug: 19673809

Change-Id: I292f9a5b5c511c9102fb43fe938b0389af7fbc54
2015-03-25 11:12:01 -04:00
Zoltan Szatmary-Ban
1181ed8a43 Add isActiveAdminWithPolicy to DevicePolicyManagerInternal
This method will be used by other system services to decide whether an
app is a profile owner or device owner.

Change-Id: I9577700d03ce2c80c798a60c6c2f480fd1913f43
2015-03-25 14:40:05 +00:00
Gus Prevas
4e2541c543 am 60b0846f: am c4d7fc10: am 568356ff: Merge "Changes callback to a WeakReference in ActivityContainerCallback." into lmp-mr1-modular-dev
* commit '60b0846fc2be8ba462bcfa535cbaced6c43e532b':
  Changes callback to a WeakReference in ActivityContainerCallback.
2015-03-25 13:16:26 +00:00
Gus Prevas
c4d7fc1021 am 568356ff: Merge "Changes callback to a WeakReference in ActivityContainerCallback." into lmp-mr1-modular-dev
* commit '568356ff9a1deab794d329f8c2e245f5a564a2f3':
  Changes callback to a WeakReference in ActivityContainerCallback.
2015-03-25 13:02:46 +00:00
Rubin Xu
6fd1705fbc Merge "Fix doc for package checksum in DevicePolicyManager." 2015-03-25 00:41:52 +00:00
Gus Prevas
3e7bebf35c Changes callback to a WeakReference in ActivityContainerCallback.
This change prevents the Runnable posted by ActivityContainerCallback
from retaining the ActivityView's callback if it is never cleared out
from ViewRootImpl.sRunQueues.

Bug: 19872883
Bug: 19654978
Change-Id: I6dce4381b96c8c77afcd38a55bfe474f13dfbfba
2015-03-24 17:30:34 -04:00
Craig Lafayette
1cef419688 Merge "Add Bluetooth connection extras to DPM." 2015-03-24 12:19:35 +00:00
Rubin Xu
e30ab114b1 Fix doc for package checksum in DevicePolicyManager.
The checksum should be in the URL-safe base64 encoded form.

Bug: 19895519
Change-Id: I84523b796b980fb0ab8825c1ab9245489039564a
2015-03-24 11:22:28 +00:00
Craig Lafayette
97e473e1e1 Add Bluetooth connection extras to DPM.
These extras will be used in ManagedProvisioning to allow
Bluetooth connections from provisioned devices.

Change-Id: I7118acd4ea71e2028a0c9f0c61031c78deef8908
2015-03-24 07:03:23 -04:00
Svetoslav
c6d1c345f4 Runtime permissions: per user permission tracking.
Before all permissions were granted at install time at once, so the user
was persented with an all or nothing choice. In the new runtime permissions
model all dangarous permissions (nomal are always granted and signature
one are granted if signatures match) are not granted at install time and
the app can request them as necessary at runtime.

Before, all granted permission to an app were identical for all users as
granting is performed at install time. However, the new runtime model
allows the same app running under two different users to have different
runtime permission grants. This change refactors the permissions book
keeping in the package manager to enable per user permission tracking.

The change also adds the app facing APIs for requesting runtime permissions.

Change-Id: Icbf2fc2ced15c42ca206c335996206bd1a4a4be5
2015-03-23 18:50:35 -07:00
Dianne Hackborn
312035232b Merge "Add view ID, rework assist API." 2015-03-24 00:02:38 +00:00
Julia Reynolds
151df5db5f Merge "DPM constants for specifying minimum version numbers for DO and DIA." 2015-03-23 21:01:30 +00:00
Dianne Hackborn
0b071a08d8 Add view ID, rework assist API.
Add view ID information to the assist structure.

Also rework the API to simplify how it works by removing
the ViewNode wrapper around ViewNodeImpl -- these are now
just the same thing.  And then add complexity by introducing
a formal WindowNode object that contains the top-level window
information (so I can add in some more window-specific info
in the future).

Change-Id: I5d525cf61ab6a73193e5cceb4c09d2d21cc27bae
2015-03-23 13:59:47 -07:00
Alex Klyubin
afa10ad39a am 2110a28a: am a4c4c575: Merge "Add android.security.NetworkSecurityPolicy."
* commit '2110a28a6c7ef7d7802028d0a2dd9c14ceb432e1':
  Add android.security.NetworkSecurityPolicy.
2015-03-22 00:40:51 +00:00
John Spurlock
606f1c9c9d Merge "HUN: Implement per-package config." 2015-03-20 20:20:09 +00:00
Alex Klyubin
2110a28a6c am a4c4c575: Merge "Add android.security.NetworkSecurityPolicy."
* commit 'a4c4c575c793d3ba4847107b15ce3a9dd5395878':
  Add android.security.NetworkSecurityPolicy.
2015-03-20 18:08:30 +00:00
Julia Reynolds
c173174a20 DPM constants for specifying minimum version numbers for DO and DIA.
Bug: 19859261
Change-Id: Id2730dc33d433e21f3afab4f0c31c3371f368afc
2015-03-20 08:50:53 -04:00
Rubin Xu
ec32b56cc2 Add DelegatedCertInstaller API in DPMS
Allow device/profile owner to delegate certificate APIs to third-party
certificate installer apps.

Bug: 19551274
Change-Id: Iaf9abb5ecb1dc0975fa98ea14408fe392d52fbf4
2015-03-20 10:11:29 +00:00
John Spurlock
1d881a1e98 HUN: Implement per-package config.
- Keep track of whether or not HUNs are allowed per-package.
- No impact on ranking, purely presentational.
- Simplify RankingHelper with a package table.
- Improve RankingHelper dump.
- Fix some warnings and typos.

Bug: 19776495
Change-Id: I28d69df69b576f4eabbb528eabecb1f736f0e830
2015-03-20 00:04:11 -04:00
Guang Zhu
8d09a7445e Merge "pass stream contents in separate thread for executeShellCommand" 2015-03-19 21:14:15 +00:00
Alex Klyubin
f9034cc4ae Add android.security.NetworkSecurityPolicy.
The initial purpose of the NetworkSecurityPolicy class is to provide a
way for network libraries to check whether cleartext network traffic
(e.g., HTTP, WebSockets, XMPP, IMAP, SMTP) should be blocked from this
process.

The policy is set declaratively by the app developer in the app's
manifest and can be queried from ApplicationInfo.flags. Unfortunately,
several network stacks (bundled and unbundled) do not have a reference
to ApplicationInfo or Context.

Alternatives:
* Keep this API hidden (and thus potentially move it from framework to
  libcore), thus precluding unbundled HTTP stacks from using the API.
* Introduce a new java.lang.System property instead of this API.
  However, such properties are a mess and not as powerful/extensible
  as a public class.

Bug: 19215516
Change-Id: If22056a74d257bf1d805ebb4fc284240b3d338f1
2015-03-19 10:27:48 -07:00
Guang Zhu
14e260125e pass stream contents in separate thread for executeShellCommand
Doing it in binder thread will cause deadlock if stdout of
process under execution is larger than buffer of
java.lang.Runtime#exec(String).

Bug: 19829679
Change-Id: Icf0fccd3e2e80b0db4cc1115e501f79066adf091
2015-03-18 20:54:46 -07:00
Alan Viverette
4a357cd2e5 Replace usages of deprecated Resources.getColor() and getColorStateList()
Change-Id: I8f64fe6c4c44a92ff6d07250223ba590a1d691b0
2015-03-18 18:37:18 -07:00
Jose Lima
77c39392ff New ContentInfoExtender for Notifications
Added a new Extender to add Content Info data to notification objects.

Change-Id: I29a84915ad0c0bb724c2fcdc53d9a4c4db95ba93
2015-03-18 19:26:34 +00:00
Adam Lesinski
9c329b8b64 Merge "Only attempt to load .apk files in AssetManager" 2015-03-16 22:16:04 +00:00
Adam Lesinski
1dd50c54b5 Only attempt to load .apk files in AssetManager
This will reduce the number of files we must open
and reduce log spam.

Change-Id: I595ba4a5ea8466e530915d6ae4cf1d3e3dba15ef
2015-03-16 15:10:56 -07:00
Dianne Hackborn
a501a021c3 Merge "Add new voice request for picking from a list." 2015-03-16 22:01:51 +00:00
Eric Laurent
aff57b7519 Merge "broadcast radio API" 2015-03-16 18:30:23 +00:00
Dianne Hackborn
3d07c94c39 Add new voice request for picking from a list.
Also add API for voice interaction service to control
whether the system should hold a wake lock while it is
working with an activity (and actually *do* hold a wake
lock while doing so, duh!).

And while in there, clean up the launching wake lock to
correctly give blame to the app that is launching.

Change-Id: I7cc4d566b80f59fe0a9ac51ae9bbb7188a01f433
2015-03-16 11:29:12 -07:00
Robin Lee
ee1f24ff29 Merge "Recognise insecure encryption with a new constant" 2015-03-16 14:32:12 +00:00
Nicolas Prevot
8458e531bf Merge "Remove the owner userid of cross-profile intent filters." 2015-03-16 11:25:51 +00:00
Eric Laurent
2035ac85f6 broadcast radio API
Initial implementation of system APIs for broadcast
radio framework. Added manager and interfaces to control
a broadcast radio function exposed by the radio HAL.

- RadioManager: contains data structures and definitions as well as
top level API for feature discovery and tuner interface instantiation.
- RadioTuner: interface to control a broadcast radio tuner.
- RadioModule: framework component implementing the RadioTuner interface
and controlling a HW radio module via the radio HAL.
- RadioMetadata: representation of radio meta data (Station name, PTY,
song title, artwork, etc...) communicated by the framework to the client.

Change-Id: Iee42a185c694503e25f0b2dcfa417d88f5e9549b
2015-03-13 15:34:50 -07:00
Dianne Hackborn
484bc6e5a7 Merge "More work on collecting assist data." 2015-03-13 16:41:29 +00:00