Commit Graph

2584 Commits

Author SHA1 Message Date
Jeff Sharkey
a4da90dbab am 28339797: am 6e77499a: am fb10a760: am 79204a32: am 15369c6c: Merge "Fix volume naming when surfaced over MTP." into mnc-dev
* commit '28339797043834e5f1cd196363ef3cfdd66607ad':
  Fix volume naming when surfaced over MTP.
2015-07-08 02:05:19 +00:00
Jeff Sharkey
7a788a865e Fix volume naming when surfaced over MTP.
Otherwise we show everything as "Unknown."

Bug: 22256092
Change-Id: I19fe8a25aff02db8ca9aff288e6715d469f65327
2015-07-07 14:40:28 -07:00
Jeff Sharkey
3aeb218d0d am 6480393a: am c2e16e9b: am 63ba1d9e: am d58ddd82: am 246d6984: Merge "Handle missing migration source volume." into mnc-dev
* commit '6480393a0dc4d96de6f58cf0a1420e82bc8203a0':
  Handle missing migration source volume.
2015-07-07 00:30:45 +00:00
Jeff Sharkey
3bb8c85418 Merge commit '1db64c19' into merge3
Change-Id: I0aea6817876a5820a7d67a4de5bef0f86ce702a2
2015-07-06 17:25:00 -07:00
Jeff Sharkey
ef10ee0145 Handle missing migration source volume.
Users can try migrating primary storage while the current location
is missing/unmounted.  Fail gracefully instead of runtime restarting.

Bug: 21927076
Change-Id: I40645f8ccea05154e7cbacd188f6cba5f4dbbdc4
2015-07-05 14:34:13 -07: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
Jeff Sharkey
6c1721509a am b959b1aa: am c6913187: am a5ed2c4d: Merge "Better handling of trim/benchmark results." into mnc-dev
* commit 'b959b1aaea9fa64e3eb6cee7ce8e64d8a10657a3':
  Better handling of trim/benchmark results.
2015-07-04 07:28:34 +00:00
Dianne Hackborn
9776c69790 am 9fac4c59: am 71b97214: am 36e52cdc: Merge "Device idle fixes: issue #22209630 and issue #22225665" into mnc-dev
* commit '9fac4c590568ae86efe597456955cc4a42ddc8d9':
  Device idle fixes: issue #22209630 and issue #22225665
2015-07-04 07:27:47 +00:00
Jeff Sharkey
a5ed2c4dd3 Merge "Better handling of trim/benchmark results." into mnc-dev 2015-07-02 00:09:16 +00:00
Jeff Sharkey
e8a4b66960 Better handling of trim/benchmark results.
Request benchmarking of devices once per week during normal fstrim
maintenance window.  Tunable parameter gives us the ability to change
frequency through global setting.

Track individual benchmark and trim results for each volume, and
use scrubbed volume identifier (based on adoptiong age) when logging
stats to drop box.  Track last benchmark and trim time for each
volume separately.

Bug: 21831325
Change-Id: I53b3ed788f7820c2e5bceb2840339f5b4aada3f0
2015-07-01 15:48:34 -07:00
Dianne Hackborn
3b16cf4f47 Device idle fixes: issue #22209630 and issue #22225665
Issue #22209630: Only allow whitelisted apps to put apps on the temp whitelist

We now check whether the calling app is a system uid or in the whitelist
and, if not, throw an exception.

Issue #22225665: Alarm still goes off in idle mode (doze)

Fix a bug where we were not clearing the calling identity when coming
through the dump command to the service, and as a result when we would
eventually call out to the alarm manager it wouldn't do what we want.
This was only broken when being controlled by the shell.

Also adjust the network policy manager service's handling of device
idle transitions to only toggle the device idle state, which gets rid
of the long delay we have coming out of idle mode.  And add in a bit
of logging around going in/out of idle mode to try to understand where
things may be slow in the future.

Change-Id: I4a41f790e9b0bb31330314b94111557d479f2ba5
2015-07-01 15:05:04 -07:00
Adam Lesinski
77fa075e6d am 57a32403: am 4718afcd: am 14b57010: Merge "BatteryStats: Record cpu power usage from /proc/uid_cputime" into mnc-dev
* commit '57a324033bcb348a9c0d4d4774f7d5ebb4b56a41':
  BatteryStats: Record cpu power usage from /proc/uid_cputime
2015-07-01 01:20:31 +00:00
Adam Lesinski
14b5701029 Merge "BatteryStats: Record cpu power usage from /proc/uid_cputime" into mnc-dev 2015-07-01 00:40:25 +00:00
Adam Lesinski
e8e322fe3c am 0a7b6d6c: am 509dbdb6: am 49a2a698: Merge "Add helper function to extract app ID from shared app gid." into mnc-dev
* commit '0a7b6d6cf9c73d63339dc0b4cb7867cb90b038db':
  Add helper function to extract app ID from shared app gid.
2015-06-30 23:53:18 +00:00
Amith Yamasani
1df60ca5f1 am 67abd3b3: am da3d7b2b: am 2b64ec47: Merge "Don\'t allow non-admins to adopt sd card for internal storage" into mnc-dev
* commit '67abd3b356794b316e647a9ad20a24b09406823f':
  Don't allow non-admins to adopt sd card for internal storage
2015-06-30 23:43:31 +00:00
Adam Lesinski
49a2a6985d Merge "Add helper function to extract app ID from shared app gid." into mnc-dev 2015-06-30 23:16:20 +00:00
Amith Yamasani
2b64ec470c Merge "Don't allow non-admins to adopt sd card for internal storage" into mnc-dev 2015-06-30 23:00:08 +00:00
Adam Lesinski
f4216d30cd Add helper function to extract app ID from shared app gid.
Bug:22008744
Change-Id: Ifadc7df3777dd74932833f4d22a0e285d7bdaf95
2015-06-30 15:00:22 -07:00
Amith Yamasani
462ac3a2aa Don't allow non-admins to adopt sd card for internal storage
Bug: 21883016
Change-Id: I9af3eeffd860b076e69bb02a3dc06edba5f95898
2015-06-30 14:21:01 -07:00
Christopher Tate
510ac7fcf0 am c2487836: am 46a23872: am c4c239bf: Merge "Don\'t crash in JNI: add DeadObjectException(String msg) ctor" into mnc-dev
* commit 'c2487836618e93e0e2e6f1ca42670ebb73e5c629':
  Don't crash in JNI: add DeadObjectException(String msg) ctor
2015-06-30 00:25:49 +00:00
Christopher Tate
e56db0e3fa Don't crash in JNI: add DeadObjectException(String msg) ctor
Bug 22104446

Change-Id: I0a538119269fe45955130e4e3d0d0bae8ee64993
2015-06-29 16:04:57 -07:00
Nicolas Prevot
2f37bd3921 am d1d1a700: am 64c0c4da: am 6fd49936: Merge "Rename ALLOW_PARENT_APP_LINKING to ALLOW_PARENT_PROFILE_APP_LINKING" into mnc-dev
* commit 'd1d1a700501242cca06b5729c2bd888d6f2d4d52':
  Rename ALLOW_PARENT_APP_LINKING to ALLOW_PARENT_PROFILE_APP_LINKING
2015-06-29 17:41:26 +00:00
Nicolas Prevot
6fd49936ae Merge "Rename ALLOW_PARENT_APP_LINKING to ALLOW_PARENT_PROFILE_APP_LINKING" into mnc-dev 2015-06-29 17:08:34 +00:00
Dianne Hackborn
21002cf256 am c063f1cf: am 97abd672: am d5f387bc: Merge "Looks like MNC is gonna be API 23." into mnc-dev
* commit 'c063f1cf50c4f4b015c763af8476a25a0df7f45b':
  Looks like MNC is gonna be API 23.
2015-06-27 01:07:16 +00:00
Adam Lesinski
a7a4cccf7d BatteryStats: Record cpu power usage from /proc/uid_cputime
For now we are just recording the power usage and not using it
to calculate battery power usage or app blame. If it looks like
it is accurate, we'll adopt the values from the kernel instead of
estimating ourselves.

Bug:21498425
Change-Id: I6617e3c0ff279a65f4ff84472082f36fe4beb336
2015-06-26 17:45:43 -07:00
Dianne Hackborn
2e5cad7868 Looks like MNC is gonna be API 23.
Change-Id: I9c9c62209c949b1a16ed53eafc259e88e2ddb69a
2015-06-26 16:15:55 -07:00
Jeff Sharkey
aedb56fd18 Merge commit 'b02c73d5' into manualmerge
Change-Id: I3ec37c9d45d685c2393087bdefa6ab512cc70062
2015-06-26 09:32:09 -07: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
Nicolas Prevot
f0029c1ddb Rename ALLOW_PARENT_APP_LINKING to ALLOW_PARENT_PROFILE_APP_LINKING
Also improve the javadoc.

BUG:21701782
Change-Id: I88a75ccfa71b0d5df2f4779987cf0fff56001fd3
2015-06-25 19:54:12 -07: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
Hiroshi Yamauchi
ac4d8aab79 am 26898e57: am 189ebe5d: am a1ee09c8: Merge "Clarify art.gc.gc-count-rate-histogram runtime stat." into mnc-dev
* commit '26898e575ca3d977a643657f125b254aed9e0211':
  Clarify art.gc.gc-count-rate-histogram runtime stat.
2015-06-23 21:29:56 +00:00
Dianne Hackborn
4874bd161f am 9a5ea4e9: am 67e2aab1: am b7412897: Merge "Fix issue #21254610: StrictMode uses Log.wtf which crashes apps on L+" into mnc-dev
* commit '9a5ea4e9ca9ba965dc940a2b65224cd5e4ff033b':
  Fix issue #21254610: StrictMode uses Log.wtf which crashes apps on L+
2015-06-23 18:23:12 +00:00
Hiroshi Yamauchi
a1ee09c843 Merge "Clarify art.gc.gc-count-rate-histogram runtime stat." into mnc-dev 2015-06-23 18:14:50 +00:00
Dianne Hackborn
b74128978a Merge "Fix issue #21254610: StrictMode uses Log.wtf which crashes apps on L+" into mnc-dev 2015-06-23 16:46:37 +00:00
Nicolas Prevot
9a0f9682a9 am 69042609: am 2e70cf73: am 3ab6f9e6: Merge "Allow cross-profile app linking from work to personal." into mnc-dev
* commit '6904260904176c67f200654d48fd8046c63011f4':
  Allow cross-profile app linking from work to personal.
2015-06-23 03:04:52 +00:00
Dianne Hackborn
fde298e738 Fix issue #21254610: StrictMode uses Log.wtf which crashes apps on L+
Raise the limit at which we consider the strict mode trace to
be unreasonably large.

Change-Id: I5ec5332dd5aa2631e017d246e4a8b978b82cf318
2015-06-22 17:52:13 -07:00
Rahul Chaturvedi
8ee0c2cf24 Merge "Add binder transaction tracking." 2015-06-22 23:55:09 +00:00
Nicolas Prevot
3ab6f9e691 Merge "Allow cross-profile app linking from work to personal." into mnc-dev 2015-06-22 23:18:32 +00:00
Hiroshi Yamauchi
2d6327d0ad Clarify art.gc.gc-count-rate-histogram runtime stat.
Bug: 21491908
Change-Id: I84d93aa73eebc327513c4663a6b606e2dad9a0b7
2015-06-22 15:58:47 -07:00
Jeff Sharkey
0e5e4eea5e am 4edfd64b: am 421daf85: am c629271d: Merge "Forget private partition keys." into mnc-dev
* commit '4edfd64bc1c69be3107fe924772331c1a974e28c':
  Forget private partition keys.
2015-06-22 21:57:08 +00:00
Nicolas Prevot
9edbda18df Allow cross-profile app linking from work to personal.
If the profile owner sets ALLOW_PARENT_APP_LINKING:

ACTION_VIEW, scheme http/https intents sent from the work profile
can be resolved by personal apps if they specify a host.

BUG:21701782
Change-Id: I372e2405345539eac9d6b4fb08def6bf84da14a6
2015-06-22 14:39:44 -07:00
Jeff Sharkey
c629271d48 Merge "Forget private partition keys." into mnc-dev 2015-06-22 21:09:52 +00:00
Jeff Sharkey
5cc0df214b Forget private partition keys.
When we forget a private partition, ask vold to also forget the key
for that partition GUID.  This means we need to track both the
filesystem UUID and the partition GUID for a private volume.

Bug: 21782268
Change-Id: Icda1cbb65539d61dacc663428daf3d1a2e4c313e
2015-06-22 14:07:10 -07:00
Rahul Chaturvedi
52613f9084 Add binder transaction tracking.
Add the ability to am to be able to track binder transact calls. This
will help us diagnose excessive IPC calls.

This CL adds the trace-ip command to am. The usage is,

To start binder transaction tracking,
am trace-ipc start
To stop tracking and dump the data to a file,
am trace-ipc stop --dump-file <FILE>

Bug: 21398706
Change-Id: Ic0c9b3be757dd0662a2750a0d8447e2a5ef1fa90
2015-06-22 16:28:24 -04:00
Jeff Brown
e689cca19c am 3a9f86a2: am 6903187a: am d63c721e: Merge "Repurpose doze wake lock stats for draw wake lock instead." into mnc-dev
* commit '3a9f86a2df00973b10754fa4011b8e8c32928685':
  Repurpose doze wake lock stats for draw wake lock instead.
2015-06-22 20:01:41 +00:00
Jeff Brown
6a8bd7bc13 Repurpose doze wake lock stats for draw wake lock instead.
The doze wake lock is an internal implementation detail with no
power impact.  However the draw wake lock is much more interesting
to track because it's essentially like a special purpose partial
wake lock which may be acquired while dozing.

Bug: 21949905
Change-Id: Iedd5f366eb010a47a9691374c5cd3d85ea68173d
2015-06-19 17:27:21 -07:00
Adam Lesinski
d28292f319 am 52e7f8c7: am bd9b25ef: am b6a09299: Merge "BatteryStats: Record doze wake locks" into mnc-dev
* commit '52e7f8c76f78176ae33c22118e2f05626923c724':
  BatteryStats: Record doze wake locks
2015-06-19 21:48:37 +00:00
Adam Lesinski
9425fe21c9 BatteryStats: Record doze wake locks
Doze wake locks don't actually hold the CPU awake, so we should record them
separately from full wakelocks, which is what we did before.

Bug:21949905
Change-Id: Ib4db3399069e0ad11f1f0dc6925a87ad0ad21ff9
2015-06-19 14:12:01 -07:00
David Srbecky
f32f7a3ffd Merge "Replace --include-cfi with --generate-debug-info." into mnc-dev 2015-06-19 18:26:42 +00:00