Commit Graph

3113 Commits

Author SHA1 Message Date
Tao Bao
9971d02c38 Merge "UpdateEngine: Add resetStatus() as system API." into nyc-dev 2016-03-28 19:51:36 +00:00
Jeff Sharkey
c02bfae73e Include "invisible" volumes in new storage API.
The purpose of the new StorageVolume API is to grant access to
volumes that aren't typically "visible" to a developer, so include
them in the returned results.

Also return the real mounted state instead of augmenting based on
the caller's storage permissions.  Clean up API naming slightly and
return as List.

Bug: 27615770
Change-Id: Ida921a4b91e5af81e418e76f672d9108f45a9781
2016-03-27 15:06:57 -06:00
Jeff Sharkey
bd91e2f3f6 Update PRE_BOOT_COMPLETED for FBE.
Now that CE data isn't available until after a user is unlocked, we
need to delay the PRE_BOOT_COMPLETED broadcasts.  This is done by
adding a new RUNNING_UNLOCKING user state to the UserController
lifecycle.

We now track the last fingerprint a user was logged in under, and we
dispatch PRE_BOOT receivers when that fingerprint changes.  To work
around battery pull issues, we only persist the updated fingerprint
once all PRE_BOOT receivers have finished.  This is less granular
than the original solution, but it's still correct.  We only consider
a user as "logged in" once it transitions into the RUNNING_UNLOCKED
state.

When starting a process, track if the user was "unlocked" when
started, so that we only spin up unaware providers in processes
started before user unlock.

Add generic IProgressListener to communicate PRE_BOOT progress and
strings up to lock screen.  For now, LockSettingsService just blocks
until finished, but it could display these strings in the future.

Bug: 27220885
Change-Id: I349439776b885acd32f6a578d8951ffd95640be2
2016-03-27 10:56:48 -06:00
Felipe Leme
771d0c2be4 Merge "Refactored NetworkManagerService to support Data Saver." into nyc-dev 2016-03-25 20:39:59 +00:00
Felipe Leme
65be3025fd Refactored NetworkManagerService to support Data Saver.
Netd provides 2 bandwidth control rules to restrict which uids can use
metered networks:

- bw_penalty_box is a blacklist-based firewall chain used to determine
  which uids do not have access to metered interfaces.

- bw_happy_box is whitelist-based firewall chain used to determine which
  uids have access to metered interfaces.

Currently, both NetworkManagerService (NMS) and
NetworkPolicyManagerService (NPMS) uses just the bw_penalty_box rule,
which makes turning Data Saver mode on / off too slow (since NPMS needs
to build the bw_penalty_box on demand); this CL adds support for both
rules on NMS, although NPMS doesn't take advantage of it yet (it will be
refactored in a separate CL).

BUG: 27127112
BUG: 26685616
Change-Id: Ib954574f7c86269fc9b4cf8ce4ba72ba5878c23d
2016-03-25 12:33:47 -07:00
Griff Hazen
d3c454db29 Detect ranchu as emulator
Bug: 27780791

Change-Id: I23e5511acfba22260714874baf5e9380480b22bf
2016-03-25 09:35:20 -07:00
Dianne Hackborn
966f1c9348 Merge "Fix issue #25817435: Batterystats missing UIDs for secondary users" into nyc-dev 2016-03-25 01:50:33 +00:00
Ruben Brunk
41f02e5d50 Merge "Allow current VrListenerService to read thermal info." into nyc-dev 2016-03-25 01:08:18 +00:00
Dianne Hackborn
9cfba35020 Fix issue #25817435: Batterystats missing UIDs for secondary users
Change-Id: I9ad907571f04b5825d234758347659544a4de6ab
2016-03-24 17:31:28 -07:00
Felipe Leme
541af9b119 Removed obsolete @NonNull.
BUG: 27676858
Change-Id: Ic3916769c1fa9d557294bcdbbc94e00c68376a5d
2016-03-23 16:05:57 -07:00
Felipe Leme
9eb5555aa6 Merge "Allow Scoped Directory Access on whole volume." into nyc-dev 2016-03-23 17:58:48 +00:00
Ruben Brunk
8f1d5cbabb Allow current VrListenerService to read thermal info.
Bug: 27549685
Bug: 22855417
Change-Id: I2d0cb85b54767876bcbf503b5f198bd7f4065680
2016-03-23 08:23:15 -07:00
Tao Bao
b7e47ae84f UpdateEngine: Add resetStatus() as system API.
It calls update engine to reset an already applied payload.

Also change all the RemoteExceptions in UpdateEngine class to be
rethrown as RuntimeExceptions according to API guidelines [FW9].

Bug: 27123767
Change-Id: I936331019cdb00f4f225f5605e51cc94bb491e24
2016-03-22 16:16:34 -07:00
Aga Wronska
5f7d673f3b Merge "Add config flag to show/hide internal storage. Hide internal storage by default." into nyc-dev 2016-03-22 17:04:28 +00:00
Tony Mak
8673b2899e Revert getUserInfo change and add isManagedPorfile(int userId)
Bug: 26469166
Change-Id: I60b70170ddc80432fc8f638b1f63c4e9f5212785
2016-03-22 15:26:05 +00:00
Jeff Sharkey
a17b7d0163 Merge "Store trace files in app-specific dirs." into nyc-dev 2016-03-22 15:12:44 +00:00
Lorenzo Colitti
bf4a6574b1 Delete dead code.
Change-Id: If8052efaa00f15e5c7eb038435be33206d54276a
2016-03-22 16:27:41 +09:00
Aga Wronska
1719b3555d Add config flag to show/hide internal storage.
Hide internal storage by default.

Revert "Always show intern storage."

This reverts commit 7c4395804e.

Bug: 27683276

Change-Id: I04ea8b9a307babcea003f9bec200d41265a42c7f
2016-03-21 17:33:27 -07:00
Jeff Sharkey
3a6e0ec223 Store trace files in app-specific dirs.
The previous default location of "/sdcard" became painful to use
starting in M, because it required a runtime permission.  So now we
default to storing trace files in app-specific directories on shared
storage, which apps always have write access to with no additional
permissions.

Update docs to be consistent between all overloads.

Bug: 22807654
Change-Id: If4feca7c8778dfdf4ccce8cfb68418dc416260b5
2016-03-21 16:54:11 -06:00
Felipe Leme
db892b84e5 Allow Scoped Directory Access on whole volume.
There are some scenarios where an app needs access to the whole SD Card,
not subdirectories. For example, user might have a SDCard with
directories like vacation_pictures (instead of Pictures/vacation);
another example is a file management app.

BUG: 27676858
Change-Id: I20ef713de7e4dfa7e2d7d07bab11898af186d673
2016-03-21 14:25:17 -07:00
Polina Bondarenko
eb84552ef0 Added skin temperature, thresholds to HardwarePropertiesManager
Bug: 27425887
Change-Id: I13f69ae37906b71d93edbf6bea6daf809d97cfd5
2016-03-19 10:49:18 +00:00
Dianne Hackborn
2fefbcf0d1 Fix issue #27653326: Sync doesn't work in doze maintenance
Add a (configurable) delay between when we start a maintenance
window until the minimum time we will end it.

Also switch to using the alarm manager callback API.  (Yay!)

Also fix a little printing problem in the alarm manager dump
so we put the package name and not some class hash in the
summary string of an alarm entry.

Change-Id: I4281e5c80bc8b26ebc1fb6f603ec33ec0e379daa
2016-03-18 16:52:30 -07:00
Jeff Sharkey
620a28bad2 Merge "Mark more Bundles as being defusable." into nyc-dev 2016-03-18 19:54:52 +00:00
Tony Mantler
e6e08b4a5a Merge "Add safe-mode reboot to PowerManager" into nyc-dev 2016-03-18 18:40:21 +00:00
Tony Mantler
b8009fddd8 Add safe-mode reboot to PowerManager
b/12787723

Change-Id: If7e6ff63532b49b9e758db290a877f7dbfa8a8b7
2016-03-18 11:36:16 -07:00
Jeff Sharkey
a04c7a7c64 Mark more Bundles as being defusable.
They're destined for the system, so they're okay to look inside.

Bug: 27726127
Change-Id: Ic85c308a8efe6f9b8652952717c72b3c663d328a
2016-03-18 12:20:39 -06:00
Jeff Sharkey
2a4e495448 Merge "Update direct boot related documentation." into nyc-dev 2016-03-18 16:32:16 +00:00
Jeff Sharkey
cf3f0a11a8 Update direct boot related documentation.
Also hide a few APIs as requested by council.  Add a method to
easily determine if a given File would already be encrypted at rest
by the OS.

Bug: 27531029
Change-Id: Icad5f1cd56411ad3ac707db85fd7449acdcc4b94
2016-03-17 19:58:05 -06:00
Phil Weaver
6fdd3afdcc Merge "Treat accessibility actions as user activity" into nyc-dev 2016-03-17 22:19:17 +00:00
Jeff Sharkey
8a372a0a28 Refactoring FBE APIs based on council feedback.
Mostly consists of removing the word "encryption" from most APIs,
since we can't actually make promises about the data being encrypted.

Bug: 27531029
Change-Id: Iace9d7c4e64716abf86ed11847c40f3947e1d625
2016-03-17 14:49:08 -06:00
Phil Weaver
da80d676c7 Treat accessibility actions as user activity
Resurrecting ag/665912.

Bug: 19531976
Change-Id: Ibdddd507215e61b9f4313c36eab8845e9940a7ac
2016-03-17 10:09:39 -07:00
Daichi Hirono
1360868de8 Merge "Add suffix number when copying a file." into nyc-dev 2016-03-17 04:53:35 +00:00
Daichi Hirono
fc7fb7533f Add suffix number when copying a file.
If we have an existing file in the destination directory, which has the
same name with the source file, adding suffix number is
DocumentsProvider's responsibility.

Because MTP does not provide a way to check existance of files with
given name, the logic is implemented as try-and error strategy. The CL
lets If we MtpDocumentsProvider assume we have a file that shares the
same name with the source file if it failed to invoke
MtpDevice#sendObjectInfo. In this case MtpDocumentsProvider retry to
invoke sendObjectInfo with new name with suffix number.

BUG=26991190

Change-Id: I223ac5031f079bc91eb27709b0356f621a1ed55b
2016-03-17 13:52:21 +09:00
Jeff Sharkey
7410fb4b39 Oops, missed a default Bundle flag.
Bug: 27706598
Change-Id: Idde1c25ea1b5944657075cd5f0da65396280f757
2016-03-16 21:23:31 -06:00
Jeff Sharkey
d136e51a99 Defuse Bundles parsed by the system process.
It's easy for apps to throw custom Parcelables into Bundles, but
if the system tries peeking inside one of these Bundles, it triggers
a BadParcelableException.  If that Bundle was passed away from the
Binder thread that delivered it into the system, we end up with a
nasty runtime restart.

This change mitigates this trouble by "defusing" any Bundles parsed by
the system server.  That is, if it encounters BadParcelableException
while unpacking a Bundle, it logs and delivers an empty Bundle as
the result.

Simultaneously, to help catch the system process sticking its
fingers into Bundles that are destined for other processes, a Bundle
now tracks if it's "defusable."  For example, any Intents delivered
through ActivityThread are marked as being defusable, since they've
arrived at their final destination.  Any other Bundles are considered
to be "in transit" and we log if the system tries unparceling them.

Merges several Parcel boolean fields into a flags int.  Add better
docs to several classes.

Bug: 27581063
Change-Id: I28cf3e7439503b5dc9a429bafae5eb48f21f0d93
2016-03-16 14:45:26 -06:00
Tony Mak
4dc008cda2 Fix NotificationListenerService fail to mirror work notification
1. Instead of getting application info in runtime, just retrieve the
   one in the context to avoid cross user operation.

2. Functions in PackageManager that retrieve badged icon now return
   badged icon if the targer user is managed profile instead of checking
   whether target user is a managed profile of the user in mContext.

3. Relax the restriction of getUserInfo, if the caller is asking a user
   in the same profile group or having the manage user permission, we let
   it go.

Bug: 26469166

Change-Id: Ia1ffc5743f7d94bd489cdb7571eaed51499ebdd9
2016-03-16 10:49:02 +00:00
Tao Bao
36baafe92c Don't reboot into recovery if block map file is missing.
We added a third parameter to RecoverySystem.installPackage() to let the
caller to indicate the package has been processed (uncrypt'd). We need
to ensure the caller's claim is true by checking the existence of the
block map. Otherwise the device will fail for sure when booting into
recovery.

Bug: 27620932
Change-Id: I6325455253480055f14eb0cf020689ac37328602
2016-03-15 10:36:19 -07:00
Makoto Onuki
f9b941f528 Add a flag to log service side runtime exception
Often during development I get runtime exceptions from system
server but I only see client side stacktrace on logcat, which is
pretty much inconvenient.

Change-Id: I9c60fd92f6008d2c3a7eaf848b89ce3f1dffbe8a
2016-03-10 17:19:08 -08:00
Dianne Hackborn
839ff816a5 Merge "DO NOT MERGE: Add separate information about user whitelist." into nyc-dev 2016-03-10 01:46:03 +00:00
Dianne Hackborn
262ae5c8eb DO NOT MERGE: Add separate information about user whitelist.
Use this in the alarm manager to allow user whitelisted apps
to have free access to scheduling alarms.

Coming next: lifting sync/job restrictions.

Bug #26851107: Allow user whitelist apps more freedom

(Cherry-picked to nyc since it got lost in the branch from master.)

Change-Id: I4dc9f07514627ebdb6b6eff7c7a749f2c51a3797
2016-03-09 17:39:40 -08:00
Joe Onorato
04a72a2a51 Merge "Add an API for apps to get their System Health / Battery Stats data." into nyc-dev 2016-03-10 00:52:03 +00:00
Joe Onorato
713fec85b8 Add an API for apps to get their System Health / Battery Stats data.
Change-Id: Ib27e1be469b826f6d83d73ce6024102bbdb1d47a
2016-03-09 15:47:24 -08:00
Jeff Sharkey
93720d5729 Merge "Log when pre-N apps send too much to DropBox." into nyc-dev 2016-03-09 23:31:01 +00:00
Jeff Sharkey
b8e8a91f54 Log when pre-N apps send too much to DropBox.
Once they target N, they'll start getting exceptions, which is
intended to make sure they pay attention to data that would have
otherwise been dropped on the floor.

Bug: 27571535
Change-Id: I49163679c629cd0788327d2c3a654e757ecdcb99
2016-03-09 16:27:42 -07:00
Makoto Onuki
4a07c34ca8 Merge "ShortcutManager: add remaining APIs." into nyc-dev 2016-03-09 22:28:45 +00:00
Paul Lawrence
d5a3f3df40 Merge "Add API to IMountService to get encryption state" into nyc-dev 2016-03-09 13:42:41 +00:00
Martijn Coenen
2612bbc0f5 Merge "API to query which cores are exclusively assigned." into nyc-dev 2016-03-09 10:31:03 +00:00
Makoto Onuki
5504622fb0 ShortcutManager: add remaining APIs.
- Icons are now persisted. (under /data/system_ce, as PNGs)
- the "load icon" APIs in LauncherApps are supported.
- Implement updateShortcuts()

- Addressed all the comments on the previous CL
- @hide the newly added constructor for PersistableBundle

- Enhance incoming shortcut validation
- A lot of internal clean-up.

Bug 27548047

Change-Id: I8e3c1ccd3e0a997a6d271c84d81170f0c022b60e
2016-03-08 18:37:32 -08:00
Paul Lawrence
20be5d6247 Add API to IMountService to get encryption state
Bug: 18002358
Change-Id: If7d9c9a5ed38ac37849fcf638ec10c76d2f419a1
2016-03-08 15:03:54 -08:00
Martijn Coenen
cd4bdf3eb9 API to query which cores are exclusively assigned.
On devices with cpuset support, the foreground app
may have a core exclusively assigned to it. Add an
API that allows apps to query which core that is,
so it can use that to set scheduling affinity.

Bug: 27381794
Change-Id: Iea148776da6d7abb745ccf9e6ad5ad46491e340a
2016-03-08 13:09:32 +01:00