605 Commits

Author SHA1 Message Date
Robin Lee
1b83651e7f Merge "Internal API for system apps to determine default network for other apps" into nyc-dev 2016-04-07 16:43:15 +00:00
Robin Lee
d2baf792f8 Internal API for system apps to determine default network for other apps
Callers with CONNECTIVITY_INTERNAL permission can read off the netId
that an application is assigned to by default.

Necessary for making connections as the default network for a client
app eg. when downloading stuff on its behalf.

Bug: 27074270
Change-Id: I8d35e8e99126875f55f3c545090326f3e9be43fb
2016-04-07 14:55:59 +00:00
Dianne Hackborn
141f11c82a More work on issue #26390151: Add new JobScheduler API...
...for monitoring content providers

- Improve media provider change reporting so that observers can
  avoid spurious reports of the top-level content directory changing.
- Fix a bug where collected content changes while a job was running
  were not being properly propagated to the next job.

Change-Id: I29e3c2960e6fec75b16ee3ee6588d47342bf8c75
2016-04-05 15:58:42 -07:00
Makoto Onuki
ac21497f17 ShortcutManager: More command for CTS, more tests..
and fix flakey tests.

Bug 27548047

Change-Id: Ia5f189278f6111850277ca16aa747469f48c5f14
2016-04-04 11:02:06 -07:00
Makoto Onuki
b1a684c646 Merge "ShortcutManager: implement backup & restore" into nyc-dev 2016-04-01 23:18:43 +00:00
Makoto Onuki
2e210c4d0f ShortcutManager: implement backup & restore
Also:
- Fix cross profile pinning.  Now ShortcutLauncher correctly keeps
track of target package user IDs.

- Add performance stats for package manager calls and show them on
dumpsys.

Bug 27548047

Change-Id: I2472980b2955b6c70947aaaa9b76f75d0616db6e
2016-04-01 14:06:56 -07:00
Chris Wren
b38fa4e724 Merge "actually cancel sounds when we get a quiet update" into nyc-dev 2016-04-01 19:58:46 +00:00
Chris Wren
93bb8b8006 actually cancel sounds when we get a quiet update
Also add some tests to the notification manager service
to make the refactor more palatable.

Bug: 27742532
Change-Id: I745915299aa2b92ab077e0c801d47864cb562325
2016-04-01 14:13:57 -04:00
Lorenzo Colitti
f5120236c4 Merge "Honour the DHCP MTU option." into nyc-dev 2016-04-01 00:55:08 +00:00
Victor Chang
e04ac3d7d2 Merge "Unit test for isProvisioningAllowed" into nyc-dev 2016-03-31 17:04:38 +00:00
Lorenzo Colitti
77fdf23d6f Honour the DHCP MTU option.
Bug: 25590369
Bug: 27719279
Change-Id: I473b5ec9c13f0d74e1ddd55e9d4abcff374a83ef
2016-03-31 23:51:32 +09:00
Victor Chang
3e794afb82 Unit test for isProvisioningAllowed
Note:
DevicePolicyManagerService is changed to inject ContentObserver notifier

Test: all test cases in DevicePolicyManagerTest pass

BUG: 25710621
Change-Id: I347cec71769d0e9dd6a334d7d6339d5ce6a3fa6a
2016-03-30 20:27:22 +01:00
Makoto Onuki
e3ae7ec14a ShortcutManager: Support secondary text field.
Bug 27548047

Change-Id: I2d184bab2c26e351b7326945fa0cacf826f16d1e
2016-03-29 16:42:12 -07:00
Makoto Onuki
9da23fc6ac ShortcutManager: proper work profile support
Bug 27548047

Change-Id: I8acea3355f8974a551f53814624dec30732f7b2f
2016-03-29 14:42:02 -07:00
Makoto Onuki
590096a0e3 Extract signature related utilities
So that they can be used from services/core.

Bug 27548047

Change-Id: I610e267cba320418e766c0e609fa26c485dc6e1f
2016-03-29 10:09:43 -07:00
Makoto Onuki
d99c6f04bb ShortcutManager: Fix work profile
- Pinned shortcuts need to know not only which package
has pinned them, but also on which user's, due to work profile.

- Launcher can always launch shortcuts that it has pinned.

Bug 27548047

Change-Id: I23b4e7dfbb6ecc42099d31008bcfd61d44e2c7fb
2016-03-28 18:47:39 -07:00
Makoto Onuki
905e8855e7 ShortcutManager: Cleanup package info handling
Bug 27548047

Change-Id: I598b25d1901230cec6fb3760fe5efeff3b3fef96
2016-03-28 10:46:08 -07:00
Makoto Onuki
0acbb14574 ShortcutManager: Handle package broadcasts.
- Do a cleanup when an app is gone.
- Record the app version and signatures.
- Also make saveToXml() capable of saving for backup.

Bug 27548047

Change-Id: I7eb2bbec7665b4d625630e7312c0f2a8b03c5ffa
2016-03-25 15:39:38 -07: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
Erik Kline
1d511ab13d Request vendor info option (43) to get metered hint
Bug: 26241591
Change-Id: I688029826a79f9cbf0116fb197f82026980788af
2016-03-25 11:55:19 +09:00
Makoto Onuki
3145924596 ShortcutManager: Extract helper classes.
Bug 27548047

Change-Id: I08656291a8dd509fde169f229ca9c503362254f3
2016-03-22 11:24:53 -07:00
Erik Kline
a2d29407d0 Support registering a request for the default network
Change-Id: I079f5be97b585cf5692dd4c7a144b993d168a9a5
2016-03-22 15:44:16 +09:00
Makoto Onuki
cdc78f7137 ShortcutManager: Clean up for uninstalled packages.
Bug 27548047

Change-Id: I95ca832af496fbf71023eb27a7e2647c124ffb86
2016-03-21 15:54:27 -07:00
Victor Chang
d3c0cf50b6 Merge "Api change of DPM.setApplicationRestrictionsManagingPackage()" into nyc-dev 2016-03-21 13:08:14 +00:00
Victor Chang
cd14c0a9da Api change of DPM.setApplicationRestrictionsManagingPackage()
Throws NameNotFoundException instead of IllegalArgumentException

Can't throw NameNotFoundException directly from DPMS as
aidl doesn't support checked exception

Bug: 27532565
Change-Id: I202721f41057f92ad2dd851d4769ba4502a8f9b3
2016-03-18 16:44:21 +00:00
Suprabh Shukla
07317df6ab Merge "Added a unit test for TaskPersister" into nyc-dev 2016-03-18 02:19:40 +00:00
Suprabh Shukla
f50b458e71 Added a unit test for TaskPersister
Added a simple unit test which checks the methods used to save and load the set
of taskids to file. The test creates a user, adds some task ids to the
set of taskids for that user, saves it and loads it to see whether the
set loaded is the same as the one that was saved.

Change-Id: If92be8abf9a7e3ef90630a3786867f0e1ba12f3e
2016-03-17 18:14:15 -07:00
Makoto Onuki
aa8b94aa79 Improve ShortcutSrvice
- Delayed save
- Reset logic update

Bug 27548047

Change-Id: Ibd52f90a7986991974301b7ff1f1d8520f9ef0d9
2016-03-17 14:37:14 -07:00
Makoto Onuki
fb3f3f5b28 Merge "Support multi-launcher" into nyc-dev 2016-03-17 17:27:10 +00:00
Lorenzo Colitti
5eaaf747b4 Fix IdleableHandlerThread.
Occasionally, ConnectivityServiceTest fails with "BUG: only one
idle handler allowed". I have not been able to reproduce this
consistently, but code inspection reveals an unsafe access to
mIdleHandler inside queueIdle. Wrap that in a synchronized block.

Change-Id: I27307e2e55fa8d937d7f043bd436894091c3c667
2016-03-17 10:52:57 +09:00
Makoto Onuki
de66737ae9 Support multi-launcher
Each launcher can have its won set of pinned shortcuts.
- Shortcuts pinned by others should look like not pined to this
  launcher.  This affects how ShortcutQueryFLAG_GET_PINNED works,
  as well as what ShortcutInfo.isPinned() returns.

- When pinning a shortcut, it should be a visible one to itself --
  a non-dynamic shortcut that's pinned by another launcher but
  not by the caller is not visible, so this launcher cannot pin it
  either.

- Also clean up the dynamic shortcut adding.

Bug 27548047

Change-Id: Ia478a2ea19b7d35557ec6ea42384c79a84d6b8de
2016-03-15 16:55:04 -07:00
Makoto Onuki
ed1b89878b Merge "Fix launcher side callback" into nyc-dev 2016-03-15 21:02:48 +00:00
Mahaver Chopra
1216ae5d02 Update DPM.reboot with new restriction
DPM.reboot() should not be called when there is an ongoing call on the
device.

Bug:27531799
Change-Id: Idc1fa4c7aa79b20ec9c2afcccf855455ee316787
2016-03-15 19:46:05 +00:00
Makoto Onuki
4dbe0ded4a Fix launcher side callback
- Fix crash in work profile case
- Calculate shortcuts for each caller
- Add tests

Bug 27548047

Change-Id: I1a5b6a96956abac75d01eb5cc1cec9a9e8e379a3
2016-03-15 12:38:41 -07:00
Makoto Onuki
4554d0e5b6 Make "reset-throttling" per-user
Also don't reset the counter when the time is invalid

Bug 27549307

Change-Id: Ib9ad030e348ec5e32936709f1284e3c76e88e254
2016-03-14 15:53:59 -07:00
Makoto Onuki
49f6fbcd1f Merge "Implement the launcher side permission." into nyc-dev 2016-03-14 22:12:16 +00:00
Makoto Onuki
2d5b465fa9 Implement the launcher side permission.
Only the default launcher can call the LauncherApps shortcut APIs.

Bug 27548047

Change-Id: I6d597fcad80c5201a2f93b8cbecd567fc79926d8
2016-03-14 15:00:58 -07:00
Jeff Davidson
1c0c14febf Merge "NetworkStats.Bucket API polish." into nyc-dev 2016-03-14 19:30:23 +00:00
Jeff Davidson
1f7e05eda6 NetworkStats.Bucket API polish.
-Add @IntDef constants for STATE_ and ROAMING_.
-Expand docs for ROAMING_ constants.
-Use ROAMING_NO/YES instead of ROAMING_DEFAULT/ROAMING.

Bug: 27531260
Change-Id: I54ecfb4148caa549214df0bee9983036ffa4cb55
2016-03-14 11:24:12 -07:00
Makoto Onuki
d4c9e541ec Add ENCRYPTION_STATUS_ACTIVE_PER_USER to...
getStorageEncryptionStatus()
Use StorageManager APIs to get the encryption
state instead of from the system properties
directly.

Bug 26547262

Change-Id: Ic27baa9489d43a93873f8bb0428084f8886aed67
2016-03-11 15:50:04 -08:00
Makoto Onuki
7a6a05f0cc Test for ShortcutManager.updateShortcuts(), also
... fix bugs

Bug 27548047

Change-Id: Ia55d35521912dcba2fb1bb9c20588a83d1a2d004
2016-03-10 18:01:06 -08:00
Makoto Onuki
41066a61b9 Refactor ShortcutService
Move PackageShortcuts to the top level.

Change-Id: If19a7dd979f8697e54a45c3aa654bad235f6259d
2016-03-09 16:56:39 -08:00
Makoto Onuki
495d124a67 Merge "ShortcutManaegr: load config from settings, also..." into nyc-dev 2016-03-10 00:18:36 +00: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
4362a66dba ShortcutManaegr: load config from settings, also...
support "cmd override-config" and "cmd reset-config" to help CTS.

Bug 27548047

Change-Id: Id6c9e6f41a2238856dd3470d88d88d0e7e686f26
2016-03-09 15:17:29 -08:00
Makoto Onuki
4a07c34ca8 Merge "ShortcutManager: add remaining APIs." into nyc-dev 2016-03-09 22:28:45 +00:00
Lorenzo Colitti
f55c9c1781 Don't crash if we get a DHCP packet with the wrong port.
This should only happen if we get a packet in the small time
window between binding the packet socket and programming the
BPF filter on it.

Bug: 26696823
Change-Id: I481f1bc74bbaeb9646d96e1841d2a69acdb47d62
2016-03-09 16:16:45 +09: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