Commit Graph

9668 Commits

Author SHA1 Message Date
Jeff Sharkey
7ff418d9a9 Grant MMS Uri permissions as the calling UID.
A recent security fix prevents the system UID from handing out Uri
permission grants directly from itself.  Instead, services need to
issue grants as the original calling UID to ensure that the caller
actually has access to the Uris.

Test: builds, boots, send/recv MMS works in primary/secondary users
Bug: 33231106
Change-Id: Ia9fe19843b52977c8a94ee5349b907beda1882fc
2016-11-30 14:30:02 -07:00
Jeff Sharkey
589f309909 Relax missing service check for normal apps.
The new missing-service behavior was mostly added for core system
components, so don't wtf() when normal apps ask for missing services.

Continue to emit one-line log for third-party apps so they know why
getSystemService() might be returning null.

Test: builds, boots
Bug: 33109365
Change-Id: I3a6118a3db570d796a26da5b8d63015b13e53a87
2016-11-29 12:56:59 -07:00
TreeHugger Robot
d25cf04e98 Merge "Add explicit method to dismiss Keyguard" 2016-11-29 14:30:46 +00:00
TreeHugger Robot
82b13b79c6 Merge "Fix NPE when a shared element doesn't have a matching transitionName." 2016-11-28 19:39:47 +00:00
Nicolas Prévot
22b2a81f75 Merge "Send callbacks to DO when a user is added or removed." 2016-11-28 16:50:08 +00:00
Julia Reynolds
b6c1f99bd9 Allow listeners more snoozing options.
(snooze indeterminately and unsnooze)

Test: runtest systemui-notification and cts tests in same topic.
Change-Id: I5ce74638f55ed796bc6b26af167b32b0040f4222
2016-11-28 08:53:14 -05:00
Mahaver Chopra
d0835e45f7 Merge "Add provisioning successful intent" 2016-11-25 19:15:35 +00:00
Mahaver Chopra
3c58cfe2d9 Add provisioning successful intent
Add a new activity intent action which will be launched after
provisioning has successfully completed.

Currently when provisioning is done we junt send an ordered broadcast
for PO and a normal brodcast for DO case. This results in HOME screen
being launched for 2 sec. To remove this jank we have introduced a
new intent action which can be directly received by the DPC in their
post provisioning activity.

Test: b/33138551, this bug tracks the cts coverage for the new action.

Bug: 30956199
Change-Id: I889b0cec74799bb7be93de48d46d5da68f17be92
2016-11-25 16:29:44 +00:00
Bartosz Fabianowski
8d76e72251 Allow DO to access bookkeeping information about its own actions
The getLastSecurityLogRetrievalTime(), getLastBugReportRequestTime()
and getLastNetworkLogRetrievalTime() methods are meant to be used by
system code. However, there is no harm in allowing the DO to access the
information they return - because it is information about actions that
the DO itself took.

The advantage of opening up these methods to the DO is that we can
CTS-test them.

Bug: 32692748
Test: DevicePolicyManager unit test + CTS test in separate CL

Change-Id: I1470fca2a82b9955f7aed5e8b50220bea8b56fc9
2016-11-25 12:36:20 +01:00
TreeHugger Robot
8d4527db19 Merge "Add getBindDeviceAdminTargetUsers API" 2016-11-24 18:02:23 +00:00
Nicolas Prevot
e95c2817f7 Send callbacks to DO when a user is added or removed.
BUG:32764090
Test: manual
Change-Id: Icfac801fd2c9670f3d68cf6971f7aba2332dbb6b
2016-11-24 17:18:25 +00:00
Esteban Talavera
fc291bcbe0 Add getBindDeviceAdminTargetUsers API
Add getBindDeviceAdminTargetUsers API. To be used
for the device or profile owner in a COMP setup to
know the UserHandle of their instance running on
the other profile.

Bug: 31952368,33033966
Test:  cts-tradefed run cts --module DevicePolicyManager --test com.android.cts.devicepolicy.DeviceOwnerPlusManagedProfileTest

Change-Id: I05c9ac0f6c3cdce1ec17cf2910ca7a7214064af2
2016-11-24 16:15:44 +00:00
Adam Lesinski
9276b0adfb Merge "Move Resource creation out of ContextImpl constructor" 2016-11-23 19:19:35 +00:00
Michal Karpinski
0d250200e3 Merge "Unhiding strong auth timeout API" 2016-11-23 17:42:58 +00:00
Abodunrinwa Toki
4cf097cf78 Merge "Introduce TextAssistant for Smart Text Share feature." 2016-11-23 16:29:42 +00:00
Jorim Jaggi
241ae10b21 Add explicit method to dismiss Keyguard
The flag is a bit clunky for most cases, and a method is more
clear.

Test: cts/hostsidetests/services/activityandwindowmanager/util/run-test
android.server.cts.KeyguardTests

Test: cts/hostsidetests/services/activityandwindowmanager/util/run-test
android.server.cts.KeyguardLockedTests

Test: runtest systemui -c
com.android.systemui.keyguard.DismissCallbackRegistryTest

Bug: 30961403
Bug: 27422134
Change-Id: I39de90c7cfecd99350a74f72cd76418e337f2b79
2016-11-23 16:27:35 +01:00
Michal Karpinski
a20d8bb249 Unhiding strong auth timeout API
Unhiding the API that was previously hidden (in order to ship in MR1).

Bug: 29825955
Change-Id: Ifce73b1917b939e68e9a8dd2cc7379717214b8b7
2016-11-23 12:09:15 +00:00
Ian Pedowitz
a53e2bc3c0 Merge "Revert "Move Resource creation out of ContextImpl constructor"" 2016-11-22 21:30:01 +00:00
Adam Lesinski
8fa7107678 Move Resource creation out of ContextImpl constructor
Resource creation is going to get much more nuanced
than just passing in a static set of paths, so move
the creation of Resources out to where the context
of the creation is more easily understood.
Test: Existing CTS tests pass

Change-Id: I49482bd637f305a5b953ddd39ff7390aa432f46b
2016-11-22 12:57:38 -08:00
Adam Lesinski
304321ed8d Revert "Move Resource creation out of ContextImpl constructor"
This reverts commit 16efc5e68d.

Caused issue with device protected settings: http://b/33066012

Change-Id: Ib485bed68ea8ac199d553b666c18d048a5624c98
2016-11-22 19:41:55 +00:00
Jean-Michel Trivi
6d5723fe4e Merge "Define stream type for accessibility volume control" 2016-11-22 16:28:48 +00:00
Abodunrinwa Toki
d0d9ceb30c Introduce TextAssistant for Smart Text Share feature.
Bug: 30982298
Test: CTS tests to be added in a follow up CL.
Future CLs will add implementation detail.

Change-Id: Iad550447a4b3552340c0ada75fda60f97f0913aa
2016-11-22 14:41:16 +00:00
Neil Fuller
3dfca02da4 Merge "Change EXTRA_TIME_PREF_24_HOUR_FORMAT from boolean to int" 2016-11-22 11:55:27 +00:00
George Mount
4efeb4f4d4 Fix NPE when a shared element doesn't have a matching transitionName.
Bug 33053923

Also added an early error check when the same shared element is
used for multiple shared elements in the source or target fragment.

Test: If5dfbac66cfd9e60660439ce5c519547de3ef1d0

Change-Id: Iac3ab8c1b8ea0208a0c76e043654184dd634948d
2016-11-21 17:30:11 -08:00
Jean-Michel Trivi
3f0945a608 Define stream type for accessibility volume control
New stream type for accessibility volume.
Add related appOps.

Test: see added CTS tests in AudioManagerTest & Stub
Bug 30448020

Change-Id: I34f96713b22fedf75322b8ffe2b96a7c566f5009
2016-11-21 15:15:45 -08:00
Adam Lesinski
7f79e1e476 Merge "Move Resource creation out of ContextImpl constructor" 2016-11-21 22:56:18 +00:00
Nancy Zheng
40cd8e410d Merge commit '2a12d8520ea6f41bd2db8577a8da82204e341c51' into manual_merge_2a12d85
Test: compiled everything, CTS verifier passes
Change-Id: I96641860890e413342bcb6a3b24e87d6aeff0c99
2016-11-21 12:58:16 -08:00
Nancy Zheng
2a12d8520e Fix createConfirmDeviceCredentialIntent for wear for CTS. am: 43f166dfb4
am: a2193c0b76

Change-Id: I9f216231ff600972e3ddec195158fc2489693a1e
2016-11-21 18:25:12 +00:00
Torne (Richard Coles)
2c0dc3e094 Merge "Precreate the classloader for the WebView." am: 566b1c80e4 am: 1feb782f01 am: 9565860b08
am: 7e17c6b0f1

Change-Id: Ie512327827e48319b3244a8d3041cb78538109d3
2016-11-21 17:18:55 +00:00
Torne (Richard Coles)
9565860b08 Merge "Precreate the classloader for the WebView." am: 566b1c80e4
am: 1feb782f01

Change-Id: Iec0bf848e4c25afc6a6b9ee83339a03f314adee9
2016-11-21 17:08:46 +00:00
Torne (Richard Coles)
1feb782f01 Merge "Precreate the classloader for the WebView."
am: 566b1c80e4

Change-Id: Ic79079748dae515cb8d89ef99148755ac65f1d47
2016-11-21 17:04:22 +00:00
Treehugger Robot
566b1c80e4 Merge "Precreate the classloader for the WebView." 2016-11-21 16:54:53 +00:00
Jeff Sharkey
ca50c360bf Merge "Check provider access for content changes." 2016-11-21 16:19:43 +00:00
Torne (Richard Coles)
3b6ca99b10 Precreate the classloader for the WebView.
We want to create the classloader for the WebView in advance in the
zygote so that it can preload Java and native code for its children, but
the zygote can't talk to the package manager (so doesn't have a
PackageInfo for the APK) and also doesn't have an ActivityThread, so
constructing a LoadedApk is difficult.

Instead, we use the fact that ApplicationLoaders contains a
process-global cache of classloaders for APKs, and prepopulate a cache
entry without constructing a LoadedApk. This requires making
ApplicationLoaders public. To calculate the correct library paths from
the information the zygote has, we reuse the logic in LoadedApk (which
is already public, and just needs a small change to allow a null
ActivityThread when checking for instrumentation).

The other parameters for classloader creation (target SDK, bundled app,
etc) are hardcoded to usable values for the WebView's case. WebView
never needs to use any system libraries that aren't public so claiming
it's not bundled is fine even when that isn't actually true, and WebView
will always target the current platform API level.

Once the classloader is created, look up the factory class and call
preloadInZygote on it to give it a chance to preload the native library
and do other shared initialisation.

Bug: 21643067
Test: enable multiprocess WebView, examine librank output to see sharing
Change-Id: I696ead637e3f7382bcc58cfaf61eac5921862015
2016-11-21 15:04:13 +00:00
Neil Fuller
b7146fec0d Change EXTRA_TIME_PREF_24_HOUR_FORMAT from boolean to int
... on Intent.ACTION_TIME_CHANGED.

This is to better represent the possible settings values for
the "use 24 hour format" setting. These are "12" (use 12 hour
formatting), "24" (use 24 hour formatting), unset
(use locale default formatting).

The EXTRA_TIME_PREF_24_HOUR_FORMAT for the ACTION_TIME_CHANGED
is now an int, not a boolean. 0 means "12", 1 means "24" and
2 means "use locale default". This is not a backwards compatible
change but the EXTRA_TIME_PREF_24_HOUR_FORMAT is not public
and so should only affect platform code that generates or
consumes the intent like settings code.

There are associated changes to Settings code to update the source
of the Intent.

The related underlying code that is triggered in response to the
intent and previously assumed a boolean now takes a Boolean.

Other changes:

The ActivityManagerService now only sends a binder notification
to running services if the EXTRA_TIME_PREF_24_HOUR_FORMAT
is present. There is an example of ACTION_TIME_CHANGED
being sent from the platform (AlarmManagerService, when the system
clock is noticed to have changed independently of the RTC) that
does not set the extra and would previously have misinterpreted
to mean "user wants 12 hour formatting", which would have been a
bug.

i.e. the code from ActivityManagerService that would interpret the
missing extra as false:

final int is24Hour =
        intent.getBooleanExtra(
                Intent.EXTRA_TIME_PREF_24_HOUR_FORMAT, false) ? 1 : 0;

Some methods and constants have be renamed to better reflect their
use.

Bug: 32761619
Bug: 32933009
Test: Manual testing
Change-Id: Ie7e9c62ce65e7e3a056b2751b45fe6cb9de86498
2016-11-21 12:22:32 +00:00
Nancy Zheng
43f166dfb4 Fix createConfirmDeviceCredentialIntent for wear for CTS.
Bug: 33000237
Change-Id: I1fdb5a518c41ab005f12d3142763e374b38d7553
2016-11-18 18:15:09 -08:00
Adam Lesinski
16efc5e68d Move Resource creation out of ContextImpl constructor
Resource creation is going to get much more nuanced
than just passing in a static set of paths, so move
the creation of Resources out to where the context
of the creation is more easily understood.
Test: Existing CTS tests pass

Change-Id: If5d79e0f84a111790c15a7b44db3f44c75e7141c
2016-11-18 18:13:55 -08:00
TreeHugger Robot
c58e7899be Merge "Define getLooper() method" 2016-11-18 23:06:15 +00:00
Adam Powell
cd09af7282 Merge "Fix FragmentManager.FragmentLifecycleCallbacks scope" 2016-11-18 22:18:42 +00:00
Julia Reynolds
f22d457eeb Merge "Prioritize channel sound & vibration settings." 2016-11-18 22:12:28 +00:00
Todd Kennedy
63d7a9dd6a Define getLooper() method
The default implementation uses the main looper to handle service
operations. This is generally okay until we have to make network
calls to retrieve resolution data.

Bug: 25119046
Test: manual
Change-Id: I22b0f279e6c1fde21f207578d2930ab4858bbc78
2016-11-18 12:55:41 -08:00
Sudheer Shanka
12b3f27e1c Merge "Remove transaction ids in IActivityManager.aidl." 2016-11-18 18:55:41 +00:00
Julia Reynolds
0c299d4d63 Prioritize channel sound & vibration settings.
Unless the app is not targeting O and the user hasn't set
a preference in Settings.

Also apps no longer need the vibration permission to vibrate with
a notification.

Test: runtest systemui-notification
Change-Id: Ia84b1c97d13cb479db07035ca622b1fe52261329
2016-11-18 09:29:26 -05:00
TreeHugger Robot
29993074b0 Merge "Keep track of admin actions for DO disclosures" 2016-11-17 21:40:46 +00:00
TreeHugger Robot
3613a0caee Merge "Wire up PM.getInstalledApplicationsAsUser(flags, userId) as hidden API" 2016-11-17 21:34:08 +00:00
TreeHugger Robot
5bec219934 Merge "Phase-2 API takes a hostname" 2016-11-17 20:39:54 +00:00
Adam Powell
74827260a8 Fix FragmentManager.FragmentLifecycleCallbacks scope
Static class is much more useful here.

Bug: 32938039
Test: n/a
Change-Id: I0010fde25e3b2a4f59b360c0035505c831c07c53
2016-11-17 12:20:26 -08:00
Bartosz Fabianowski
b21b241f0f Keep track of admin actions for DO disclosures
This CL adds bookkeeping to DPMS which will allow us to tell the user
in the Settings UI whether/when the admin requested a bug report or
retrieved logs from the device.

Bug: 32692748
Test: Full DevicePolicyManagerTest unit test coverage; end-to-end tests
        will follow as Settings CTS verifier tests

Change-Id: I89728fce4b7e0ff061b354c73caf3742e95a3a3e
2016-11-17 20:52:03 +01:00
Sudheer Shanka
d9a42f2e2c Merge "Remove transaction ids in IApplicationThread." 2016-11-17 19:49:39 +00:00
Bartosz Fabianowski
1133424c2b Wire up PM.getInstalledApplicationsAsUser(flags, userId) as hidden API
Settings needs to access a variant of getInstalledApplications() which
takes a |userId| argument. Since this is not currently exposed by
PackageManager, Settings calls into PackageManagerService directly. This
is ugly and breaks the regular abstraction layer hierarchy.

The CL fixes the problem by exposing the required variant of
getInstalledApplications() as a hidden API, analogously to what was done
before with getInstalledPackages().

Bug: 32692748
Test: Will be CTS-verifier-tested together with Settings
Change-Id: Id9c4e8e18524d312159821f1a4d5527263c7e950
2016-11-17 20:49:16 +01:00