27497 Commits

Author SHA1 Message Date
Svet Ganov
75f6b94a5d Merge "Grant default permissions to the setup app robustly." into mnc-dev 2015-07-15 21:58:50 +00:00
Svet Ganov
50a8bf4da0 Grant default permissions to the setup app robustly.
There is a zoo of components that handle the home intent and
have different priority. There is no reliable way to distinguish
the setup app from the other apps that handle home as some of
them have lower priority than the setup app and some higher.
This change adds a dedicated category to recognize the default
setup app.

Uncommented the code that grants accounts permissions as the
get_accounts permission is now a runtime permission and can be
granted.

bug:22471024
bug:22501463

Change-Id: I41726751fa2567cbcd7d09c7acfa7615b8aba577
2015-07-15 14:46:23 -07:00
Jeff Brown
76c4c6668a Add USB port manager.
Add some new internal APIs to enumerate USB Type C ports, query their
status, determine whether they support changing power or data roles,
and doing so.  The API also adds a new ACTION_USB_PORT_CHANGED broadcast
for port state changes.

The implementation includes a mechanism for simulating the behavior
of the USB stack.  See 'adb shell dumpsys usb -h' for details.

Note that the underlying kernel driver interface is still subject
to change but its behavior has been encapsulated as much as possible.

Bug: 21615151
Change-Id: I0c853ae179248a4550b3e60d02a7a7e65e4546b2
2015-07-15 11:34:29 -07:00
Jeff Brown
2dbccc1926 Clean up USB Manager dump.
Tidy up the dump() implementation in preparation for further work.

Bug: 21615151
Change-Id: If6d94c8dc9457b8e93103541ec1798981eeb5b54
2015-07-15 11:34:29 -07:00
Dianne Hackborn
280a64e793 Improve tracking of screen on reasons.
- New screen on app op to record the last time each app has
  caused the screen to be turned on.
- New battery stats event that tells us the reason the screen
  has been asked to turn on.
- Propagate out power manager API to specify the reason a caller
  is asking to have the screen turned on.

Note that currently the window flag to turn the screen on bypasses
much of this because it is being handled in the window manager by
just directly telling the power manager to turn the screen on.  To
make this better we need a new API where it can specify who it is
calling the API for.

Change-Id: I667e56cb1f80508d054da004db667efbcc22e971
2015-07-15 09:59:07 -07:00
Dianne Hackborn
0b6134b511 Bump mms whitelist time up to 1 minute.
Change-Id: I09074c440430580fcfb2581275defe61c63c8ae8
2015-07-14 18:48:07 -07:00
Dianne Hackborn
fd854ee58c Fix issue #21626564: MMS should be receivied while Dozing
We now place whoever is receiving the MMS on the temporary
whitelist while doing so, so they can get network access to
download it.

There was also an issue that needed to be fixed where we
were no longer updating the list of allowed uids while
dozing based on their proc states...  we now do that.

Also did a bit of optimization of the temp white list update
path do the network policy manager, instead of going through
a broadcast we now directly call in to the network policy
manager.  This also allows us to have a synchronous version
of updating the list, so we can know the app has network access
before we tell it to do anything.

Finally added battery stats events for things going on and off
the whitelist so we can diagnose the behavior there.

Change-Id: Ic7fe010af680034d9f8cb014bb135b2addef7455
2015-07-14 18:33:08 -07:00
Fyodor Kupolov
987241265b Merge "Added sendBroadcastMultiplePermissions method" into mnc-dev 2015-07-15 00:48:40 +00:00
Fyodor Kupolov
d4fd8c766d Added sendBroadcastMultiplePermissions method
Added Context.sendBroadcastMultiplePermissions(Intent intent, String[]
receiverPermissions) method, which allows an array of required permissions
to be enforced.

Bug: 21852542
Change-Id: I27c9130e8f004b428452501ebc8a36aabde1f343
2015-07-14 17:25:42 -07:00
Adam Lesinski
56d82dd28a BatteryStats: Fix deadlock
Bug:22486756
Change-Id: I20e10cc344b128bfa156c5aada93d3fb2b0fcaa3
2015-07-15 00:25:26 +00:00
Fyodor Kupolov
4a817924ec Merge "Revert "Allow array of required permissions in sendBroadcast"" into mnc-dev 2015-07-14 22:43:47 +00:00
Fyodor Kupolov
e37520b49d Revert "Allow array of required permissions in sendBroadcast"
This reverts commit b4e7283c9afd9fb15ebd63f6ce9b75c9c1af658b.

Change-Id: Ie8390964bda5bdfa869cee8f46584043d8e7c664
2015-07-14 22:29:21 +00:00
Fyodor Kupolov
d69a82c107 Merge "Allow array of required permissions in sendBroadcast" into mnc-dev 2015-07-14 21:57:34 +00:00
Fyodor Kupolov
b4e7283c9a Allow array of required permissions in sendBroadcast
Added Context.sendBroadcast(Intent intent, String[] receiverPermissions)
method, which allows an array of required permissions to be enforced.

Bug: 21852542
Change-Id: I3b8ff258fa9f3249c344bb8093b820b24eef00c0
2015-07-14 12:50:22 -07:00
Svetoslav
8b6d5b6b6a Merge "Clear binder id when determining external storage state" into mnc-dev 2015-07-14 19:39:16 +00:00
Dan Sandler
66cc6bb65e Merge "Allow notification strings to be unredacted in dump output." into mnc-dev 2015-07-14 19:38:16 +00:00
Svetoslav
38c3dbb209 Clear binder id when determining external storage state
bug:22472435

Change-Id: I5badd51cb9fb2244395880eb1bbff8f4aa0abb8c
2015-07-14 11:30:10 -07:00
Amit Mahajan
51b4e97ae4 Merge "Add checks for READ_PRIVILEGED_PHONE_STATE." into mnc-dev 2015-07-14 17:59:20 +00:00
Amit Mahajan
7c5befa4a7 Add checks for READ_PRIVILEGED_PHONE_STATE.
Callers will have either PRIVILEGED or regular READ_PHONE_STATE.

Bug: 22468536
Change-Id: I60251f61250a975f4147b027d2539824a728e3b5
2015-07-14 10:26:00 -07:00
Erik Kline
7761294027 Merge "Log NetworkRequestInfo to get more detailed history" into mnc-dev 2015-07-14 04:09:29 +00:00
Erik Kline
7523eb349e Log NetworkRequestInfo to get more detailed history
Bug: 21641983
Bug: 22235775
Bug: 22299819
Bug: 22358164
Change-Id: I48a2d162dd499a3590f06d805267a63822856969
2015-07-14 11:46:51 +09:00
Svet Ganov
8017c647e6 Fix build
Change-Id: I2c97e405eaec7ee1569fcddc872ff2a98c829efe
2015-07-14 02:38:07 +00:00
Svet Ganov
8cee6587e0 Merge "Teach storage appops." into mnc-dev 2015-07-14 01:24:37 +00:00
Svet Ganov
6ee871e598 Teach storage appops.
For modern apps targeting M SDK and up the external storage state
is deterined by granted permissions. For apps targeting older SDK
the storage access is determined by app ops correspning to the
storage permissions as the latter are always granted.

When app ops change we do not remount as we kill the app process
in both cases enabling and disabling an app op since legacy code
is not prepared for dynamic behavior where an operation that failed
may next succeed. Hence, we remount when we start the app.

For modern apps we don't kill the app process on a permission
grant, therefore we synchronously remount the app storage.

bug:22104923

Change-Id: I601c19c764a74c2d15bea6630d0f5fdc52bf6a5a
2015-07-13 18:22:30 -07:00
Christopher Tate
4b9b3e4731 Merge "Default browser should not supersede intent filter priorities" into mnc-dev 2015-07-14 01:08:28 +00:00
Christopher Tate
d13cb79850 Default browser should not supersede intent filter priorities
Bug 22304850

Change-Id: Ie4deffea2621fdc03a9bfe35690ecd109eed1a04
2015-07-13 18:04:56 -07:00
Svet Ganov
fc2bc7f170 Merge "Check signatures of privileged persistent apps for granting defailt permissions" into mnc-dev 2015-07-14 00:58:38 +00:00
Christopher Tate
288ecf98f1 Merge "Prioritize most-recently-enabled link-handling app" into mnc-dev 2015-07-14 00:56:58 +00:00
Svetoslav
56c59d1550 Merge "Fix two grant default permissions edge cases." into mnc-dev 2015-07-14 00:54:36 +00:00
Svetoslav
8b24a1d30f Fix two grant default permissions edge cases.
1. When querying for components to which to grant default
   permissions we are now getting disabled components as
   well as we want such packages to get default pemrissions
   on upgrade as disabled components may get reenabled.

2. When resolving activities to whose packages to grant default
   permissions we skip the corss-profile and skip-profile filters
   as they are set by device policy which should not affect
   implicitly default permission grants. Policy has explicit
   APIs for permission management.

bug:22405963

Change-Id: Idf56d35e567a6fd6e097cd45988d1561422ee6fc
2015-07-13 17:46:50 -07:00
Christopher Tate
f0d6cb38c4 Prioritize most-recently-enabled link-handling app
In the case when multiple apps handle a given web-link action,
all of which have been marked as "launch the app instead of a
browser" and so are otherwise ambiguous, always prefer the app
that was most recently placed into the always-handle-links state.

Bug 22051035

Change-Id: I3f43c19b0d7b74e9843445e41971bb5433affb1c
2015-07-13 17:01:14 -07:00
Jinsuk Kim
e249eb3a6f Merge "Perform One touch play upon pressing home key" into mnc-dev 2015-07-13 23:45:03 +00:00
Amit Mahajan
53e5ba22c1 Merge "Do not check runtime READ_PHONE_STATE if caller has the privileged one." into mnc-dev 2015-07-13 22:08:38 +00:00
Wale Ogunwale
093d8de298 Merge "Finish already paused activity if it should be finished after pausing" into mnc-dev 2015-07-13 20:49:37 +00:00
Etan Cohen
c09544bb88 Merge "Fix filter on CONNECTIVITY_ACTION updates" into mnc-dev 2015-07-13 18:04:43 +00:00
Amith Yamasani
1578357df7 Merge "Check user state after clearing identity." into mnc-dev 2015-07-13 18:03:20 +00:00
Esteban Talavera
0ec43f89d2 Merge "Use correct user when filtering app link candidates" into mnc-dev 2015-07-13 09:48:48 +00:00
Esteban Talavera
2292160320 Merge "Don't send app links to parent profile if status == never" into mnc-dev 2015-07-13 09:48:21 +00:00
Wale Ogunwale
3f529ee7fa Finish already paused activity if it should be finished after pausing
If the app requests its activity to be finished allow it to be finished
immediately if the activity is already paused.

Also, don't schedule stop for an activity that was already finished in
ActivityStack.stopActivityLocked().

Bug: 22170595
Bug: 22397812
Change-Id: If349f7d3070a1fd2c0688fda7381b42f625ed9e4
2015-07-12 15:14:01 -07:00
Billy Lau
96d00ab359 Merge "Bug: 21589105 Rescope WRITE_SETTINGS and SYSTEM_ALERT_WINDOW permission" into mnc-dev 2015-07-12 22:02:37 +00:00
Billy Lau
22b3f4cb15 Bug: 21589105 Rescope WRITE_SETTINGS and SYSTEM_ALERT_WINDOW permission
Raised the protection level of WRITE_SETTINGS permission to appop and also
allowed backwards compatibility with pre23 flag. Also made sure that this
permission is not added as RuntimePermission in DefaultPermissionGrantPolicy as
that breaks a lot of gmscore stuff.

Introduced new action to manage write system settings as a new API and
renamed the string that describes the managing of overlay permission.

Change-Id: Ifd25a6ddc06de68ee37015cb9fb23452e4ef10f4
2015-07-12 22:41:00 +01:00
Amith Yamasani
2d42d5f41e Check user state after clearing identity.
This is to fix the case where the caller has GRANT_REVOKE_PERMISSIONS
but does not have MANAGE_USERS permission.

Related to a recent fix for
Bug: 22356546

Change-Id: Id51157abad14a0bdba3a16d7cd168f61ba25e890
2015-07-11 10:24:45 -07:00
Amith Yamasani
292eb65f1e Merge "Fix new user creation regression due to vold remount calls" into mnc-dev 2015-07-11 02:28:01 +00:00
Svet Ganov
824d453246 Check signatures of privileged persistent apps for granting defailt permissions
bug:22391058

Change-Id: I56d060f0435fadf87a8cf255ea887dd5b3903821
2015-07-10 18:28:52 -07:00
Amit Mahajan
1cfd45701b Do not check runtime READ_PHONE_STATE if caller has the privileged one.
Also removed READ_PHONE_STATE from SystemUI since it has
READ_PRIVILEGED_PHONE_STATE.

Bug: 22376654
Change-Id: I437f9bf324950cb70bae5be76699824da5897a6f
2015-07-10 17:15:59 -07:00
Robert Greenwalt
3ac71b7f87 Fix filter on CONNECTIVITY_ACTION updates
Only send for network types which the network supports.

bug:22411968
Change-Id: I97765544eb653caf0ea4fc5d3feec5742d5d88dc
2015-07-10 16:26:40 -07:00
Wale Ogunwale
26b0f1e420 Merge "Revert "Finish already paused activity if it should be finished after pausing"" into mnc-dev 2015-07-10 22:53:14 +00:00
Wale Ogunwale
12bb956828 Revert "Finish already paused activity if it should be finished after pausing"
This reverts commit bef8a3e39372ca85104b894f7359deddc97a8fec.

Changed caused some existing apps to crash. Reverting to unblock the
build while I investigate.

Bug: 22170595
Bug: 22397812
2015-07-10 15:25:38 -07:00
Jorim Jaggi
0c758805b3 Merge "Fix empty keyguard for once and all" into mnc-dev 2015-07-10 21:16:26 +00:00
Jinsuk Kim
256642aa2f Merge "CEC: Do not switch language if the new one is same as the old one" into mnc-dev 2015-07-10 21:09:14 +00:00