Commit Graph

3411 Commits

Author SHA1 Message Date
Svetoslav
7bd71f6541 am 122350fc: am 843d7216: am 353835e1: am c88dec32: am 6638c182: Merge "Fix reset permissions on clear data and package uninstall." into mnc-dev
* commit '122350fca781048e0a59260e2bed233b428cf3fd':
  Fix reset permissions on clear data and package uninstall.
2015-07-09 01:33:34 +00:00
Svetoslav
4a5f4a2bc7 Fix reset permissions on clear data and package uninstall.
If the user clears data for an app we reset the permission but
only the changes made by the user. We do not modify syste or
policy flags and also ensure the permission that were granted
by default are granted after the data wipe. This is the same
as starting with a clean slate.

If the package whose data is cleared is a part of a shared user
we resent to initial state only the permissions that the cleared
package contributed. Hence, if another package also declared the
permission as used we do not clear the permission state as it is
still in use.

When a package is deleted for a user but still present for another
user we reset its permissions to their inital state follwoing
above described strategy.

Lastly when a preinstalled package wtih an upgrade is diabled
(triggers upgrade uninstall) and this package is a part of a
shared user, we do not drop permission state (grants and flags)
for permissions used by the shadowed system package. This ensures
that we do not drop runtime permission state (such state is
default grants and user changes).i

bug:22248525

Change-Id: I3a3007476d2cb9f4ff824e1e137a6e1a4d04408b
2015-07-08 16:52:42 -07:00
Dianne Hackborn
ee94484303 am 7b3add61: am f368f6b9: am 6ee8a509: am c55c4a28: am b14dc048: Merge "Add new "preinstalled" permission flag." into mnc-dev
* commit '7b3add61c9e47b708725147dffc23d396db37add':
  Add new "preinstalled" permission flag.
2015-07-08 02:17:58 +00:00
Svetoslav
4e5dac3d6e am 3fd5ebfd: am 7cc8de60: am 0ce19f8e: am 240f8e5f: am 3e07ee07: Merge "Grant installer and verifier install permissions robustly" into mnc-dev
* commit '3fd5ebfd778e540276fb5205a8ba3185e620647d':
  Grant installer and verifier install permissions robustly
2015-07-08 02:05:26 +00:00
Dianne Hackborn
a90c8def2c Add new "preinstalled" permission flag.
This allows you to specify that a permission can be granted to
any pre-installed system app (not just privileged ones).

And as long as I am doing this, clean up the old "system" permission
flag, renaming it to "privileged" which is what it really is today,
deprecating the old names.  And switch the platform's permission
declarations to use the new name.

Change-Id: Iabf484746af232144786851ec7fe90e3de9dddb2
2015-07-07 17:25:25 -07:00
Svetoslav
3e7d977ff7 Grant installer and verifier install permissions robustly
bug:22248271

Change-Id: I3a47ae9a112ba7d88b421fcb5f9651d1168ba7a5
2015-07-07 14:02:51 -07:00
Jeff Sharkey
3bb8c85418 Merge commit '1db64c19' into merge3
Change-Id: I0aea6817876a5820a7d67a4de5bef0f86ce702a2
2015-07-06 17:25:00 -07:00
Jeff Sharkey
38cae6c8bc Merge "Reconcile private volumes when mounted." into mnc-dev 2015-07-06 17:57:46 +00:00
Svet Ganov
f127f42fd4 am b017752a: am 6bc5b226: am c5a759cf: am d8c2bbcf: am 10c111ed: Merge "Show basic feature warning for default granted permissions" into mnc-dev
* commit 'b017752aeb1d6d2ee961580de9edfc3db8722c8a':
  Show basic feature warning for default granted permissions
2015-07-06 17:00:03 +00:00
Jeff Sharkey
6dce4964b4 Reconcile private volumes when mounted.
Many things can happen while a private volume is ejected, so we need
to reconcile newly mounted volumes against known state.

First, user IDs can be recycled, so we store the serial number in the
extended attributes of the /data/user/[id] directory inode.  Since a
serial number is always unique, we can quickly determine if a user
directory "10" really belongs to the current user "10".  When we
detect a mismatched serial number, we destroy all data belonging to
that user.  Gracefully handles upgrade case and assumes current serial
number is valid when none is defined.

Second, we destroy apps that we find no record of, either due to
uninstallation while the volume was unmounted, or reinstallation on
another volume.

When mounting a volume, ensure that data directories exist for all
current users.  Similarly, create data directories on all mounted
volumes when creating a user.  When forgetting a volume, gracefully
uninstall any apps that had been installed on that volume.

Bug: 20674082, 20275572
Change-Id: I4e3448837f7c03daf00d71681ebdc96e3d8b9cc9
2015-07-04 17:08:42 -07:00
Nicolas Prevot
92ebe9a289 am b06aece7: am d16f1252: am 60373e80: Merge "Fix the case where an intent bounces several times between users." into mnc-dev
* commit 'b06aece751cc86aa859005bbb8843c5ed6be7c6f':
  Fix the case where an intent bounces several times between users.
2015-07-04 08:06:54 +00:00
Svet Ganov
e8ce8368fc am 55cd6f44: am 6fe87a56: am 68ffcf88: Merge "Teach receivers, activities, providers, and services app ops." into mnc-dev
* commit '55cd6f44fd1e49164a999e948bb91a03a3b9daf6':
  Teach receivers, activities, providers, and services app ops.
2015-07-04 07:28:18 +00:00
Dianne Hackborn
7e07288c77 am 0783b9a4: am ee987ce4: am 76664d9d: Merge "Work on issue #21589105: Scope WRITE_SETTINGS and SYSTEM_ALERT_WINDOW..." into mnc-dev
* commit '0783b9a47ae682cc85a14284e79643b5087b8c9f':
  Work on issue #21589105: Scope WRITE_SETTINGS and SYSTEM_ALERT_WINDOW...
2015-07-04 07:27:17 +00:00
Svetoslav
279a9a3131 am 90336427: am 56ef372f: am 29563632: Merge "Grant permissions to headless system calendar/contacts sync adapters." into mnc-dev
* commit '90336427fd1fc85e15a43ce36a26576013061d91':
  Grant permissions to headless system calendar/contacts sync adapters.
2015-07-04 07:25:45 +00:00
Svet Ganov
77ab6a888a Show basic feature warning for default granted permissions
bug:22174223

Change-Id: Ie8209e1f678ac459893151b5125e86eb5025aad8
2015-07-03 12:19:02 -07:00
Nicolas Prevot
60373e8060 Merge "Fix the case where an intent bounces several times between users." into mnc-dev 2015-07-02 10:27:58 +00:00
Svet Ganov
68ffcf883c Merge "Teach receivers, activities, providers, and services app ops." into mnc-dev 2015-07-01 23:59:21 +00:00
Svet Ganov
99b6043dad Teach receivers, activities, providers, and services app ops.
Perform app op check in addition to the permisison check for all four
paltform components - activities, content providers, broadcast receivers,
services - if they are guarded by a permssion that has an associated app
op. This ensures that legacy apps will behave correctly if the permission
of the caller has been revoked, i.e. the app op for that permission was
disabled.

bug:22199666

Change-Id: Ia22d1c38d58b3cd6aabdc655cb7c7bddd85da7a2
2015-07-01 16:20:00 -07:00
Dianne Hackborn
76664d9dcf Merge "Work on issue #21589105: Scope WRITE_SETTINGS and SYSTEM_ALERT_WINDOW..." into mnc-dev 2015-07-01 22:21:10 +00:00
Dianne Hackborn
de15edaa9b Work on issue #21589105: Scope WRITE_SETTINGS and SYSTEM_ALERT_WINDOW...
...to an explicit toggle to enable in Settings

Add a new permission flag, saying the permission can be automatically
granted to pre-api-23 apps.  Apply this to SYSTEM_ALERT_WINDOW.

Change-Id: I24a0ceabe7e9f5e458a864d30eda2696ad14a699
2015-07-01 12:37:00 -07:00
Nicolas Prevot
107f7b7bec Fix the case where an intent bounces several times between users.
An intent may bounce several times between users.
In this case, we want mContentUserHint to refer to the original
user.

BUG:19656340
Change-Id: I22a35fab0c228140dcb223899f5e38ff33ee5aed
2015-07-01 17:05:18 +01:00
Svet Ganov
3f69719a1b am ce3b66f5: am aadc90b5: am 67a461ec: Merge "Rename uses-permission-m to uses-permission-23" into mnc-dev
* commit 'ce3b66f542947211ed8ea7e09267bb66ff687a34':
  Rename uses-permission-m to uses-permission-23
2015-07-01 01:24:49 +00:00
Svetoslav
0010b70bea Grant permissions to headless system calendar/contacts sync adapters.
bug:21861781

Change-Id: I5f9905a23ba1b23e387adf2cea842172d34207b0
2015-06-30 18:22:20 -07:00
Svet Ganov
67a461eca8 Merge "Rename uses-permission-m to uses-permission-23" into mnc-dev 2015-07-01 00:55:58 +00:00
Svet Ganov
ffd25bbed1 Rename uses-permission-m to uses-permission-23
bug:20072113

Change-Id: Ia872853274c604a6fee1c1d84f82a98334523bac
2015-06-30 23:06:41 +00:00
Benjamin Franz
932765b45b am aa2b7910: am adb41d8f: am 01b079f7: Merge "Make ContentObservers work across profiles" into mnc-dev
* commit 'aa2b79107918adfe2fbfc7d40dd17845b4739999':
  Make ContentObservers work across profiles
2015-06-30 09:47:14 +00:00
Benjamin Franz
01b079f7d2 Merge "Make ContentObservers work across profiles" into mnc-dev 2015-06-30 07:45:50 +00:00
Svetoslav
ee4e4e79f5 am 358a8362: am ae45cfa6: am 03b5f128: Merge "Grant default permissons to the default SMS, Phone, Browser app." into mnc-dev
* commit '358a8362781736a8ddaa27713a0727d4eac1cfd0':
  Grant default permissons to the default SMS, Phone, Browser app.
2015-06-30 01:22:42 +00:00
Svetoslav
cdfd230a39 Grant default permissons to the default SMS, Phone, Browser app.
The default SMS, Phone, Browser are selected in the UI and we
grant default permissions to these. We do this regardless if
they are on the system image as the user has made an explicit
choice in the UI and the permission we grant are considered
essential for such type of a core app to operate properly.

bug:22104986

Change-Id: Ide8caeb524b43dde11a20460666cf34c4d35f84b
2015-06-29 17:44:19 -07:00
Benjamin Franz
adea1918be Make ContentObservers work across profiles
Currently registering for changes to a cross-user Uri does not work, as
the calling user id is used to identify the Uri. Change this to use the
userId the Uri is associated with. In order to protect Uris across
users, we only allow registration for a Uri when the caller has read
permission. We also only allow notify calls from across users when the
caller has write permission to the Uri.

Bug: 19312280
Change-Id: Ide216b09980ed5ebefe9b37c946dd8160167809f
2015-06-29 16:17:55 +01:00
Christopher Tate
7257462a73 am de3d02e4: am e436e19e: am b035c6d9: Merge "Properly scope the "only http/https schemes" intent filter semantics" into mnc-dev
* commit 'de3d02e4c3057c8ab7e40c0592dc2e94f0b42e64':
  Properly scope the "only http/https schemes" intent filter semantics
2015-06-27 01:21:11 +00:00
Christopher Tate
b035c6d9a6 Merge "Properly scope the "only http/https schemes" intent filter semantics" into mnc-dev 2015-06-27 00:48:10 +00:00
Christopher Tate
2134744efd Properly scope the "only http/https schemes" intent filter semantics
That restriction applies only to default-app linkage verification, and
not to any general questions of "is this app effectively a web browser?"

Bug 21688029

Change-Id: I9f6a7bc6dcac5e12ee07f8da6465ad51c1aeddfb
2015-06-26 17:45:22 -07:00
Rubin Xu
ab446232be am ba5c0728: am d1858a7d: am 0a202eac: Merge "Use StorageManager.wipeAdoptableDisks to wipe external disks" into mnc-dev
* commit 'ba5c07286f9980220bda4ed6e9e29f392669c05c':
  Use StorageManager.wipeAdoptableDisks to wipe external disks
2015-06-26 23:13:01 +00:00
Rubin Xu
0a202eac01 Merge "Use StorageManager.wipeAdoptableDisks to wipe external disks" into mnc-dev 2015-06-26 22:36:13 +00:00
Dianne Hackborn
1b96b13026 am fb46261c: am a5de0eb5: am 7c5b5f71: Merge "Fix issue #22023824: Download folder is not created in internal storage" into mnc-dev
* commit 'fb46261c1eb015896d201a0275b41c3ebae11d02':
  Fix issue #22023824: Download folder is not created in internal storage
2015-06-26 21:04:55 +00:00
Dianne Hackborn
ca8e6da41c Fix issue #22023824: Download folder is not created in internal storage
The media provider and some other things need to be given storage access.

Also, seems like we should give storage access to the camera app as well.

And add a dump dump command that will dump data about a particular
permission name.

Change-Id: Idaaa9bba2ff4dc95290cf6d17e5df933df91e909
2015-06-26 13:28:29 -07:00
Jeff Sharkey
aedb56fd18 Merge commit 'b02c73d5' into manualmerge
Change-Id: I3ec37c9d45d685c2393087bdefa6ab512cc70062
2015-06-26 09:32:09 -07:00
Rubin Xu
e8490f1d78 Use StorageManager.wipeAdoptableDisks to wipe external disks
Retire FORMAT_AND_FACTORY_RESET which is more fragile.

Bug: 9433509
Change-Id: I158ee987274bb4db41d466de9f1e3c60ffc1d140
2015-06-26 15:58:21 +01:00
Jeff Sharkey
9527b223a9 Let's reinvent storage, yet again!
Now that we're treating storage as a runtime permission, we need to
grant read/write access without killing the app.  This is really
tricky, since we had been using GIDs for access control, and they're
set in stone once Zygote drops privileges.

The only thing left that can change dynamically is the filesystem
itself, so let's do that.  This means changing the FUSE daemon to
present itself as three different views:

/mnt/runtime_default/foo - view for apps with no access
/mnt/runtime_read/foo - view for apps with read access
/mnt/runtime_write/foo - view for apps with write access

There is still a single location for all the backing files, and
filesystem permissions are derived the same way for each view, but
the file modes are masked off differently for each mountpoint.

During Zygote fork, it wires up the appropriate storage access into
an isolated mount namespace based on the current app permissions.  When
the app is granted permissions dynamically at runtime, the system
asks vold to jump into the existing mount namespace and bind mount
the newly granted access model into place.

Bug: 21858077
Change-Id: I62fb25d126dd815aea699b33d580e3afb90f8fd2
2015-06-25 22:25:48 -07:00
Svetoslav
dcbe525ed1 am be17a55c: am 6a01c7ff: am 263b6e69: Merge "Prevent certain actions of app has revoked permissions" into mnc-dev
* commit 'be17a55c923f057f3f14656e7f56b2744607db45':
  Prevent certain actions of app has revoked permissions
2015-06-25 20:15:59 +00:00
Svetoslav
263b6e6983 Merge "Prevent certain actions of app has revoked permissions" into mnc-dev 2015-06-25 18:20:16 +00:00
Svetoslav
7008b51817 Prevent certain actions of app has revoked permissions
bug:21808294

Change-Id: I7214c1fe47c15fe185423a54a74b58caf8d82daa
2015-06-25 10:55:11 -07:00
Christopher Tate
46b9d3cf44 am 425bd876: am d1741ef9: am 1af5fe23: Merge "Require that verified intent filters only have http/https <data> decls" into mnc-dev
* commit '425bd87661e318d715458fdfa5de440a2474d437':
  Require that verified intent filters only have http/https <data> decls
2015-06-24 21:08:31 +00:00
Christopher Tate
413020a6ca Require that verified intent filters only have http/https <data> decls
It is malformed to write a single intent filter like this:

  <intent-filter android:autoVerify="true">
    <data android:host="foo.example"
          android:path="/"
          android:scheme="http" />
    <data android:host="*"
          android:path="/custom"
          android:scheme="fooexamplecustomscheme" />
  </intent-filter>

In practice this app is accidentally defining a filter that will match
"http://*".  This is now detected, and will never be auto-verified for
any of the mentioned domains.

Verified intent filters must *only* handle the http & https schemes.

Bug 21920537

Change-Id: I933cddbea23185d242565cac940e1e7a7e4e289b
2015-06-24 13:16:20 -07:00
Svetoslav Ganov
b96d1f1e69 am 242c1f33: am 4475dbca: am 2c99ea35: Merge "Remove not needed contacts related permissions." into mnc-dev
* commit '242c1f333431b32445336faed18feb1a90ebd6e4':
  Remove not needed contacts related permissions.
2015-06-23 23:42:34 +00:00
Svetoslav Ganov
2c99ea3524 Merge "Remove not needed contacts related permissions." into mnc-dev 2015-06-23 23:04:20 +00:00
Svetoslav Ganov
6d2c0e5ee2 Remove not needed contacts related permissions.
This reverts commit ed5ff51b2c.

Change-Id: If2407e4e474a438d95e1b7ad1aa6f441bb3ace08
2015-06-23 23:03:55 +00:00
Xiaohui Chen
b1cc316dce Merge "Introduce system user and primary user." 2015-06-23 22:44:03 +00:00
Xiaohui Chen
70f6c38644 Introduce system user and primary user.
Bug: 19913735
Change-Id: I2c7855915d778cf80a7154314321ddd90e2eaaac
2015-06-23 15:25:37 -07:00