312970 Commits

Author SHA1 Message Date
Dianne Hackborn
7da13d7c3e Add new "work queue" feature to JobScheduler.
This gives semantics similar to the start command
queue of services.

The implementation is currently lacking in URI permission
grant handling of the work intents; that will be coming
in a follow-up change.

This includes a first step of adjusting/fixing locking
within JobSchedulerService.  The JobServiceContext class
has a bunch of stuff it does that assumes it doesn't need
locking because it schedules the work on a handler.  However,
to be able to correctly implement the work finish flow (that
takes care of stopping the job when there is no more work),
we can't dispatch these asynchronously so need to get rid of
that and just do explicit locking.

The switch to explicit locking is half-way there (again the
remaining part will be a follow-on CL).  Right now we have
the locking, but still also the handler.  But it turns out
there were a number of things we were doing without a lock
held where we actually should have been holding a lock, so
this is better anyway.

Test: new tests added

Change-Id: Iebd098046209b28e60fd2f4d855d7f91cd3a8b03
2017-04-11 13:57:15 -07:00
Todd Kennedy
4a30689414 Merge "send broadcast to the right users" into oc-dev 2017-04-10 20:10:17 +00:00
Wale Ogunwale
a09111e745 Merge "Do not set outActivity if value is null." into oc-dev 2017-04-10 20:04:10 +00:00
Sudheer Shanka
73edcd7328 Merge "NetworkPolicyManagerService: fix deadlock" into oc-dev 2017-04-10 19:28:31 +00:00
Andrii Kulian
c2ec7bf965 Merge "Fix activity move between displays" into oc-dev 2017-04-10 19:20:37 +00:00
Todd Kennedy
4efa14c784 send broadcast to the right users
Change-Id: Ibda2d922cd58d6ca1c1a4ecdccaa25e5c71c6320
Fixes: 37192695
Test: manual; create restricted profile and see that users haven't been removed
2017-04-10 12:12:11 -07:00
Jerry Zhang
0015a15353 Merge "Just broadcast intent to bring up MTP/PTP as soon as switching function" into oc-dev 2017-04-10 18:52:00 +00:00
Dmitry Dementyev
d401163599 Merge "Make visible only accounts for which authenticator supports contacts operations for callers with READ_CONTACTS permission." into oc-dev 2017-04-10 18:30:53 +00:00
Bryce Lee
1d8b1afeaf Do not set outActivity if value is null.
Recent changes passed down the nullable array to a method where it
was not being properly checked.

Change-Id: Ibf940f9225e4c9901869188aa55a04d0908015c3
Fixes: 37197666
Test: manual via bug repro steps.
2017-04-10 11:06:17 -07:00
TreeHugger Robot
c922c4827a Merge "Add an API to enable disable safebrowsing in WebView" into oc-dev 2017-04-10 16:36:48 +00:00
TreeHugger Robot
0ac8fd7adb Merge "Add ICompanionDeviceManager.getAssociation overload with explicit userId" into oc-dev 2017-04-10 15:06:10 +00:00
Erik Kline
e9ec87d0d4 Merge "Tethering: support Local-only Hotspot mode for downstreams" into oc-dev 2017-04-10 14:57:49 +00:00
Bryce Lee
9c80a16c45 Merge "Update decor LayoutParams when window is already added." into oc-dev 2017-04-10 14:22:53 +00:00
Andrei Stingaceanu
e812e7dc2e Merge "AutoSize TextView - fix measurements" into oc-dev 2017-04-10 12:48:36 +00:00
Charles He
4286c5768d Merge "VPN: cancel always-on notification with new id" into oc-dev 2017-04-10 12:43:36 +00:00
Erik Kline
5f2b7992cf Tethering: support Local-only Hotspot mode for downstreams
Test: as follows
    - built (bullhead)
    - flashed
    - booted
    - "runtest frameworks-net" passes
Bug: 31466854

Change-Id: Ia50e28c8ce0af8cdd7ac63217d921aff213668e7
2017-04-10 21:42:16 +09:00
Eric Sandness
c9a6e75682 Merge "Fix mock of setApplicationRestrictions()" into oc-dev 2017-04-10 12:18:16 +00:00
TreeHugger Robot
b96891e0e3 Merge "DngCreator: Populate baseline exposure tag" into oc-dev 2017-04-10 10:04:05 +00:00
Andrei Stingaceanu
549482bfcb AutoSize TextView - fix measurements
The BoringLayout measurements for auto-size are
incorrect. Removed those and kept the StaticLayout
measurements.

Bug: 36940118
Test: cts-tradefed run cts-dev -m CtsWidgetTestCases -t\
      android.widget.cts.TextViewTest

Change-Id: I772ade08ed26efac05ca56cb7df8cfec0327633b
2017-04-10 09:56:32 +00:00
Hugo Benichi
446c9c9172 NetworkPolicyManagerService: fix deadlock
Callers of addNetworkPolicy() were not taking locks in the correct order
inside NetworkPolicyManagerService:
  - addNetworkPolicy() is an internal method that calls
    setNetworkPolicies which takes both mUidRulesFirstLock and
    mNetworkPoliciesSecondLock in order.
  - both callers of addNetworkPolicy, mWifiStateReceiver and
    mConnReceiver via ensureActiveMobilePolicy, were taking
    mNetworkPoliciesSecondLock before calling addNetworkPolicy.
    - this causes the order of locking to be reversed, which can cause a
    deadlock when another concurrent codepath in
    NetworkPolicyManagerService tries to take both locks in the correct
    order.

This patch fixes this issue by wrapping both problematic codepaths into
addNetworkPolicy() with a lock on mUidRulesFirstLock.

Test: build, flashed, NetworkPolicyManagerServiceTest passes
Bug: 36972283
Change-Id: If7888c11aef8b628e1b013224075c4c75eae0022
2017-04-10 09:56:23 +09:00
TreeHugger Robot
eca0d421d1 Merge "Fix counting problems in StopwatchTimer." into oc-dev 2017-04-09 18:54:34 +00:00
Charles He
15297a67d3 VPN: cancel always-on notification with new id
Previously we used 0 for the id of the "Always-on VPN disconnected"
notification, as did many other system services. In a recent CL, an
effort was made to assign a dedicated id to each of these system
notifications. Unfortunately, this CL only changed the id in the call to
NotificationManager#notify(), but not NotificationManager#cancel(). This
causes the notification to persist even when always-on VPN is turned off
by the user.

This CL changes the id in the cancel() call, thus fixing the issue.

Bug: 37175930
Test: manually enable and disable always-on and observe the notification
Change-Id: I39c7325c78479afe3dc9e1764d54406bd721b067
2017-04-08 22:03:42 +01:00
TreeHugger Robot
73e510e6fa Merge "Import translations. DO NOT MERGE" into oc-dev 2017-04-08 08:01:11 +00:00
TreeHugger Robot
c2f554292e Merge "Import translations. DO NOT MERGE" into oc-dev 2017-04-08 07:59:30 +00:00
TreeHugger Robot
ce1e6999a0 Merge "Import translations. DO NOT MERGE" into oc-dev 2017-04-08 07:58:44 +00:00
TreeHugger Robot
99c95f8dd8 Merge "Import translations. DO NOT MERGE" into oc-dev 2017-04-08 07:53:26 +00:00
TreeHugger Robot
53df9f871a Merge "Import translations. DO NOT MERGE" into oc-dev 2017-04-08 07:49:42 +00:00
TreeHugger Robot
df12f01abd Merge "Import translations. DO NOT MERGE" into oc-dev 2017-04-08 07:47:37 +00:00
TreeHugger Robot
bcc90073ce Merge "Import translations. DO NOT MERGE" into oc-dev 2017-04-08 07:42:22 +00:00
TreeHugger Robot
51785edbe9 Merge "Restore session on new window after app kill" into oc-dev 2017-04-08 02:35:35 +00:00
TreeHugger Robot
42136b209d Merge "Start service from libscheduleservicehidl." into oc-dev 2017-04-08 02:27:06 +00:00
Bill Yi
a48a21c4a6 Import translations. DO NOT MERGE
Change-Id: I46d2b42e600a83d18ae13b2b4e55f244def1a070
Auto-generated-cl: translation import
2017-04-07 19:21:23 -07:00
Andrii Kulian
72790bade5 Merge "Use feature instead of hidden config for multi-display" into oc-dev 2017-04-08 01:51:29 +00:00
TreeHugger Robot
89628f8809 Merge "FingerprintSettings for non-owner should respond to fingerprint touches" into oc-dev 2017-04-08 01:47:35 +00:00
Selim Gurun
ec0a1f2599 Add an API to enable disable safebrowsing in WebView
WebView safebrowsing can be opted in using a manifest value. However,
we also need to control individual WebViews.

Bug:37158813
Test: See change I71e813bccc2fab73d100384661128c7311dd396c

Change-Id: I647dc304787d6406691b5cbadf1c9a4f13ac5604
2017-04-07 18:46:18 -07:00
Andrii Kulian
51c1b67022 Fix activity move between displays
1. ActivityConfigCallback might not have been registered
because DecorView was not yet attached to window and ViewRootImpl
was not available. In this CL the callback is set as soon as a
DecorView is attached to window.
2. When private display was removed from system, its stacks were
moved to bottom in AM but moved to top in WM.
3. When reparenting stack visibility of activities should be updated
before reparenting in WM, because otherwise WM will be resizing
windows that should no longer visible and reporting it to clients.

Bug: 34164473
Test: android.server.cts.ActivityManagerDisplayTests
Test: #testOnMovedToDisplayCallback
Test: #testContentDestroyOnDisplayRemoved
Change-Id: I6ccc27d873d0d60d7650659fb25cbfcaaeb0fd07
2017-04-07 18:39:32 -07:00
Mathieu Chartier
4567c1a1a3 Merge "Enable profiling for system server for userdebug|eng" into oc-dev 2017-04-08 01:26:57 +00:00
Mathieu Chartier
b3eecebddd Enable profiling for system server for userdebug|eng
Only for these two configurations since selinux permissions only
allow system_server to access profiles in these cases.

Motivation is to allow collecting profiles for improving RAM and
performance for preopt.

Setting the property dalvik.vm.profilesystemserver to true is required
to enable the collection of profiles for system server.

Test: device boots

Bug: 34927277
Bug: 36457259

Change-Id: Icbba6dafe376fd9c6c3d0c7feba7f64009f7c2c3
2017-04-08 01:23:05 +00:00
Bill Yi
0ce53e517b Import translations. DO NOT MERGE
Change-Id: I9a94d8ec49ccccaa96264255fb25880194d8b1d1
Auto-generated-cl: translation import
2017-04-07 18:13:06 -07:00
Bill Yi
f20444c9dd Import translations. DO NOT MERGE
Change-Id: If7648048872859a1d4a2032a2f6de6a6e9cf19f6
Auto-generated-cl: translation import
2017-04-07 18:05:51 -07:00
Phil Weaver
af336394a0 Merge "Make a11y node info parceling more robust" into lmp-mr1-dev am: 88698afd01 am: 7cb5e1dfd1 am: d7552dc819 am: e3a1b81c8f am: 879bdbeb37 am: f580a2c257 am: 68a93d2be2 am: c7db1bf43a am: 593df9d186 am: 92e6a1d941
am: fbc531077f

Change-Id: I391a1599854997edc52e704ab75a976d7ba567b3
2017-04-08 00:54:43 +00:00
Philip P. Moltmann
eab62baabf Restore session on new window after app kill
Also:
- Give the session an integer ID as the activityToken is not stable over
  restarts of the activity
- Verify that session is only accessed by one UID
- stabilize AccessibilityViewIds over activity lifecycle at least for
  the IDs we can do that. This required to split the ID namespace in
  "per-app" and "per-activity" views. Only the later ones can be
  restored.
- Do not end session when app is killed (as it can be restarted)

Bug: 35484143
Fixes: 36392498
Test: cts-tradefed run cts-dev -m CtsAutoFillServiceTestCases --test=android.autofillservice.cts.SessionLifecycleTest
      cts-tradefed run cts-dev -m CtsAutoFillServiceTestCases
Change-Id: I229acc1b3ce35fb57262da7d7466b5d4328b49d4
2017-04-08 00:48:55 +00:00
Bill Yi
8e7ad54464 Import translations. DO NOT MERGE
Change-Id: I71ee4b0792217988e13df03f2ced891e83cf038e
Auto-generated-cl: translation import
2017-04-07 17:48:48 -07:00
TreeHugger Robot
ca24a97a15 Merge "Make a11y node info parceling more robust" into oc-dev 2017-04-08 00:45:57 +00:00
TreeHugger Robot
45539511c0 Merge "Fix when vr app launches 2d activity" into oc-dev 2017-04-08 00:41:02 +00:00
Phil Weaver
fbc531077f Merge "Make a11y node info parceling more robust" into lmp-mr1-dev am: 88698afd01 am: 7cb5e1dfd1 am: d7552dc819 am: e3a1b81c8f am: 879bdbeb37 am: f580a2c257 am: 68a93d2be2 am: c7db1bf43a am: 593df9d186
am: 92e6a1d941

Change-Id: I80af3b8d0da4b81c0a48ddcc2c3a9f817afb5c00
2017-04-08 00:40:34 +00:00
Bill Yi
349a2e84a7 Import translations. DO NOT MERGE
Change-Id: Iec85eee89b58459da6cac37267b31b16fc01d14c
Auto-generated-cl: translation import
2017-04-07 17:38:37 -07:00
Steven Moreland
3d8166f885 Start service from libscheduleservicehidl.
Test: internal camera successfully sets priority.
Bug: 29251823
Change-Id: I3c3caeb3e2e169dee483da25cc8217e1aad14adf
2017-04-07 17:34:24 -07:00
Phil Weaver
a33972edaa Make a11y node info parceling more robust am: 1d8eb49073 am: 93c47c9d07 am: 3a7cf1f057 -s ours am: d3a4f4a33c am: 384e51767d am: e4beeeb423 am: 8e6d10c65f am: ba05c14397 am: 88bd259e8d am: 1552348b31 am: 2da1b658dd
am: 92f33c145a

Change-Id: I07b4674c7ef04b620815f7c65b5d1d09d1017220
2017-04-08 00:32:44 +00:00
Phil Weaver
92e6a1d941 Merge "Make a11y node info parceling more robust" into lmp-mr1-dev am: 88698afd01 am: 7cb5e1dfd1 am: d7552dc819 am: e3a1b81c8f am: 879bdbeb37 am: f580a2c257 am: 68a93d2be2 am: c7db1bf43a
am: 593df9d186

Change-Id: I464fafbf67c1985cc56188914e0fabcc0970fac2
2017-04-08 00:32:37 +00:00