Commit Graph

9805 Commits

Author SHA1 Message Date
Philipp Weiß
cbe76a0f1e Merge "Show notification when network logging is enabled" 2016-12-20 15:58:44 +00:00
Michael Kwan
cd6be5bdab Fix OnCancelListener for Dialogs on swipe to dismiss. am: 67639a5f67 am: 5a0c0ffd03
am: 95ccfb0dcc

Change-Id: I25f9462c60a59582d26a68c2cc7a2ca5a1c11857
2016-12-19 19:34:41 +00:00
Michael Kwan
95ccfb0dcc Fix OnCancelListener for Dialogs on swipe to dismiss. am: 67639a5f67
am: 5a0c0ffd03

Change-Id: Id8faa62cb551424036aae9f542f2d0776cfea522
2016-12-19 19:17:48 +00:00
Michael Kwan
5a0c0ffd03 Fix OnCancelListener for Dialogs on swipe to dismiss.
am: 67639a5f67

Change-Id: I92bc472b3519020eeadf61b1e8047aee9e8bd96c
2016-12-19 19:11:48 +00:00
phweiss
5edfd11bea DO NOT MERGE Add network logging icon to Quicksettings when enabled
am: c94b637305

Change-Id: I227210c1d938b98bfb8b2a5f895b837fad1c6181
2016-12-19 18:03:47 +00:00
phweiss
a0cb251ca6 Show notification when network logging is enabled
A notification is shown after network logging is enabled
and after the next three reboots that are at least one day apart.

Clicking it sends an intent to quick settings to shown its device monitoring
dialog.

Bug: 29748723
Bug: 33126577

Test: Manual, CTS-Verifier tests will be added later
Change-Id: I2bf517bd27ab23ad3f66270602dbf062efab8cbb
2016-12-19 15:59:58 +01:00
Andrew Scull
7cd4536e80 Merge "Don't save the password metrics to disk." 2016-12-19 14:48:37 +00:00
TreeHugger Robot
805e893e35 Merge "Enforce DISALLOW_ADD_MANAGED_PROFILE" 2016-12-19 11:57:13 +00:00
Esteban Talavera
01576869a3 Enforce DISALLOW_ADD_MANAGED_PROFILE
Only the device owner should be able to create a managed
profile if that restriction is set

Test: runtest -c com.android.server.devicepolicy.DevicePolicyManagerTest    frameworks-services

Bug: 31952368

Change-Id: Ia5170e54594ccba1e5bcedffaec98c2af42264c0
2016-12-19 11:54:11 +00:00
Calin Juravle
12e15a9c22 Merge "Report non-primary dex files loads to PM" 2016-12-19 11:23:53 +00:00
Michael Kwan
67639a5f67 Fix OnCancelListener for Dialogs on swipe to dismiss.
Swipe to dismiss on dialogs did not dispatch onCancel events
to OnCancelListeners. Resolve by adding listener to monitor
swipe to dismiss events and dispatch onCancel events when
that occurs.

Bug: 33663411
Change-Id: I64ff29e008d485a4559eb3d1ff7f0e74dccff404
2016-12-16 13:43:16 -08:00
phweiss
c94b637305 DO NOT MERGE Add network logging icon to Quicksettings when enabled
Add the network logging icon in Quick Settings' footer if
network logging is enabled, possible next to the VPN icon.
Quicksettings has to be able to tell that network logging
is enabled, so this CL changes DPM.isNetworkLoggingEnabled() to be
callable from the device owner or from any app with the MANAGE_USERS
permission.

The icon is only a placeholder until the official icon is finished.

CTS Verifier tests will be added when all Network logging UX changes are
done.

Cherry-picked from master, and then modified to work in N:
I had to remove the QSFooterTest change because the testing infrastructure
is not there in N. Also, I had to add DPMS.enforceDeviceOwnerOrManageUsers()
to which did not exist in N before.

BUG: 33126618
BUG: 29748723
Test: Manual, CTS-Verifier tests will be added in a follow-up

(cherry picked from commit a4e169ed68)

Change-Id: Ib35d323605ab11f883a4b6199d1db79b9e53c49b
2016-12-16 19:25:29 +01:00
Joe Onorato
10e237e5c8 Merge changes from topic 'incident_1'
* changes:
  First checkin of incident reporting.
  Add a native class to interact with DropBoxManager.
2016-12-16 18:19:50 +00:00
Andrew Scull
5daf273b7e Don't save the password metrics to disk.
Only store the metrics in RAM, computing them at first log in.

Test: com.android.cts.devicepolicy.DeviceAdminHostSideTestApi24
Bug: 32793550
Change-Id: Iaf9516c193f054331e3e2c68cb3f627bd543b408
2016-12-16 15:30:14 +00:00
TreeHugger Robot
c3138934c9 Merge "Use local locks in SharedPreferencesImpl." 2016-12-16 04:01:34 +00:00
TreeHugger Robot
5fb5881dbd Merge "Adding support for PIP actions." 2016-12-15 22:52:30 +00:00
Philip P. Moltmann
ac6f7e412f Use local locks in SharedPreferencesImpl.
Fixes: 33430093
Test: SharedPreferences CTS tests
Change-Id: Ia2ac48a0273608d5be6a227dc6669cea9d44bc1d
2016-12-15 14:44:50 -08:00
Chris Craik
9180f64186 Merge "CriticalNative for RenderNode and DisplayListCanvas" 2016-12-15 21:48:17 +00:00
Victor Chang
ab10237900 Merge "Add EXTRA_PROVISIONING_DISCLAIMERS" 2016-12-15 20:34:31 +00:00
Chris Craik
fc29424a3c CriticalNative for RenderNode and DisplayListCanvas
Bug: 33460152
Test:  adb shell am instrument -w -e class android.view.ViewShowHidePerfTest com.android.perftests.core/android.support.test.runner.AndroidJUnitRunner

- Also FastNative for setDisplayList, simplifying upcall into field setter.

- Also removes depth sweep parameter for ViewShowHideTests for now, they're not
providing much extra info.

Together with Outline/Path CL, about 25% faster visibility toggles

960MHz Bullhead Before (prior to Outline/Path CL):

$ adb shell am instrument -w -e class android.view.ViewShowHidePerfTest com.android.perftests.core/android.support.test.runner.AndroidJUnitRunner | grep min
INSTRUMENTATION_STATUS: add[Factory:NestedLinearLayoutTree,depth:6]_min=743505
INSTRUMENTATION_STATUS: goneToVisible[Factory:NestedLinearLayoutTree,depth:6]_min=332420
INSTRUMENTATION_STATUS: invisibleToVisible[Factory:NestedLinearLayoutTree,depth:6]_min=354154
INSTRUMENTATION_STATUS: recordAfterAdd[Factory:NestedLinearLayoutTree,depth:6]_min=1106095
INSTRUMENTATION_STATUS: remove[Factory:NestedLinearLayoutTree,depth:6]_min=1261290
INSTRUMENTATION_STATUS: visibleToGone[Factory:NestedLinearLayoutTree,depth:6]_min=356153
INSTRUMENTATION_STATUS: visibleToInvisible[Factory:NestedLinearLayoutTree,depth:6]_min=362149

After (this CL + Outline/Path CL):

$ adb shell am instrument -w -e class android.view.ViewShowHidePerfTest com.android.perftests.core/android.support.test.runner.AndroidJUnitRunner | grep min
INSTRUMENTATION_STATUS: add[Factory:NestedLinearLayoutTree,depth:6]_min=636061
INSTRUMENTATION_STATUS: goneToVisible[Factory:NestedLinearLayoutTree,depth:6]_min=267481
INSTRUMENTATION_STATUS: invisibleToVisible[Factory:NestedLinearLayoutTree,depth:6]_min=289433
INSTRUMENTATION_STATUS: recordAfterAdd[Factory:NestedLinearLayoutTree,depth:6]_min=976827
INSTRUMENTATION_STATUS: remove[Factory:NestedLinearLayoutTree,depth:6]_min=1207286
INSTRUMENTATION_STATUS: visibleToGone[Factory:NestedLinearLayoutTree,depth:6]_min=286148
INSTRUMENTATION_STATUS: visibleToInvisible[Factory:NestedLinearLayoutTree,depth:6]_min=292834

Change-Id: Iaddfa9550bdbab807c662595d005126d98cdc277
2016-12-15 11:30:08 -08:00
Joe Onorato
1754d744a7 First checkin of incident reporting.
There are a few major pieces here:

incidentd
---------
This daemon (started by init) runs and accepts incoming requests to take
incident reports.  When prompted, it calls into various system services
and fills in an IncidentProto data structure, and then writes the report
into dropbox.

The next steps for incidentd:
    - Security review of SELinux policies. These will be a subset of
      the dumpstate permissions.  Until this is done, incidentd is
      not started at boot time.

incident
--------
This shell command calls into incidentd, and can initiate an incident
report and either capture the output or leave for dropbox.

incident_report
---------------
This host side tool can call adb shell with the correct parameters
and also format the incident report as text.  This formatting code
was left of the device on purpose.  Right now it's pretty small, but
as the number of fields increases, the metadata and code to do the
formatting will start to grow.

The incident_report command also contains a workaround to let it
work before incidentd is turned on by default.  Right now, it is
implemented to call adb shell dumpsys <service> --proto directly,
whereas in the future it will go through the full incidentd flow.

incident_section_gen
--------------------
A build-time tool that generates a stripped down set of information
about the fields that are available.

libincident
-----------
This library contains the code to connect to incidentd, and the
meta proto definitions that are used by the framework protos.
The basics are here now, but they are not fully fleshed out yet.
The privacy.proto file contains annotations that can go in the
proto file that we will later use to filter which fields are
uploaded, and which are used by local sources.  For example, a
device in a test lab is safe to upload much much more information
than a real user.  These will share the same mechanism, but the
user's output will be filtered according to these annotations.

frameworks/core/proto
---------------------
These .proto files contain the definitions of the system's
output.  There is one master android.os.IncidentProto file that
is the top level of an incident report, but some other services
(notification, fingerprint, batterystats, etc) will have others
that are used directly by the logging mechanism.

Other files which are shared by several of the services also go
here, such as ComponentName, Locale, Configuration, etc.  There
will be many more.

There is also a first iplementation of a dump method handling
--proto in the fingerprint service.

IncidentManager
---------------
The java API to trigger an incident report.

Test: Not written yet
Change-Id: I59568b115ac7fcf73af70c946c95752bf33ae67f
2016-12-15 11:23:05 -08:00
TreeHugger Robot
8732a47a9d Merge "Change notification shade ordering." 2016-12-15 16:06:00 +00:00
Nicolas Prévot
1548d5c43b Merge "Use affiliation ids when checking bind target users." 2016-12-15 14:31:39 +00:00
TreeHugger Robot
a9db0faecd Merge "Delay SharedPreferences.apply() by 50 ms" 2016-12-15 03:13:39 +00:00
Philip P. Moltmann
3349644872 Delay SharedPreferences.apply() by 50 ms
... so that multiple applies can be combined into a single write.

Do do this I replaces the executor in the QueuedWork by a more Android-y
handler.

Test: Ran shared preferences CTS tests. Looked at log and saw a lot of
      skipped writes
Bug: 33385963

Change-Id: I8f33df717be7091532930ccf6ca8c48940e4edd4
2016-12-14 15:48:39 -08:00
Winson Chung
a29eb98d9f Adding support for PIP actions.
- Introduced generic RemoteAction to represents an action
  that can be made across processes with an icon and text
  description based on a Notification action.
- Modified PinnedStackController to ensure that it notifies
  the listeners from the source of truth, this ensures that
  SysUI is in the right state if killed and re-registers
  itself.

Test: Enable menu & minimize in SystemUI tuner.
Test: android.server.cts.ActivityManagerPinnedStackTests
Test: #testNumPipActions

Change-Id: I5b5d0cf9de3f06b5687337d59cfb91e17355bdb1
Signed-off-by: Winson Chung <winsonc@google.com>
2016-12-14 12:15:07 -08:00
Kang Li
b431d715a3 Merge "Add Sharing Histories to UsageStatsManager." 2016-12-14 19:26:34 +00:00
Esteban Talavera
06fd71abdf Merge "Create DISALLOW_{ADD,REMOVE}_MANAGED_PROFILE user restrictions" 2016-12-14 19:16:26 +00:00
TreeHugger Robot
a97a01e5a2 Merge "Added supports-split-screen-multi-window command to am" 2016-12-14 18:43:28 +00:00
Philip P. Moltmann
fbf2adaf6e Do not write if apply() did not change the file.
am: ea10cc0fbb

Change-Id: I58f1f71dd4a8b4725205555531fa5d66284e3cd0
2016-12-14 18:21:39 +00:00
Philip P. Moltmann
2f1bb85277 Only persist last Shared Preferences state
am: 31d6889f4c

Change-Id: I0324e5e391d3d426cef8ef52ea04f529c5c7580f
2016-12-14 18:21:33 +00:00
Philip P. Moltmann
61b0f84005 Merge changes from topic 'backportSharedpreferencesSpeedUp' into nyc-mr2-dev
* changes:
  Do not write if apply() did not change the file.
  Only persist last Shared Preferences state
2016-12-14 18:13:34 +00:00
Calin Juravle
8d2a51f1b8 Report non-primary dex files loads to PM
Scaffold for the reporting of non-primary dex files loads to the package
manager.

This will enable:
1) monitoring and compilation of secondary dex file
2) better way to track foreign dex file usage (used to determined the
compilation filter of apks).

Test: device boots
Bug: 32871170
Change-Id: Ib0fe076af2c734dd054f092247a1ec7e2a74a70d
2016-12-14 18:01:54 +00:00
Julia Reynolds
4a02afbf04 Change notification shade ordering.
Certain ongoing and people centric notifications can now
(mostly) trump importance-based ordering.

Bug: 30374279
Test: runtest systemui-notification
Change-Id: Ieab6015174f9595c08057dc408233202035aae3e
2016-12-14 17:58:11 +00:00
Victor Chang
c10f6693fc Add EXTRA_PROVISIONING_DISCLAIMERS
- It's Bundle[]
- Each Bundle has EXTRA_PROVISIONING_DISCLAIMER_HEADER
and EXTRA_PROVISIONING_DISCLAIMER_CONTENT for header and content
- the disclaimer header is a localized String

Bug: 32760305
Test: built successfully
Change-Id: Ibc4ed25027f5949a0faa92ebf1f5ea1d518368eb
2016-12-14 16:41:21 +00:00
Nicolas Prevot
d5b036014d Use affiliation ids when checking bind target users.
BUG:32764274
Test: adb shell am instrument -e class
com.android.server.devicepolicy.DevicePolicyManagerTest -w
com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner

Change-Id: Ic79b58dcb583b1d9eb9e7af0d1501cf8cfd0ee86
2016-12-14 15:15:10 +00:00
Michal Karpinski
ea792a7c11 DO NOT MERGE Fixes in comments for NetworkEvent, DnsEvent and ConnectEvent
am: e3639a0a07

Change-Id: Ie91f46915144c0f15e9a058b45ca7e55c54f796c
2016-12-14 10:58:22 +00:00
Michal Karpinski
306b268fb7 DO NOT MERGE Fix Lint errors for network logging API
am: 0c4ec00f85

Change-Id: I3fc8e08509440057c1d87dd2023cd2b7d8177530
2016-12-14 10:57:26 +00:00
Michal Karpinski
fd4ec31313 DO NOT MERGE [DPM] DO uses batch token to retrieve network logs, and can retrieve the same batch many times
am: bbf352a2c1

Change-Id: I6df35873ec30044780fab02329bab327af8df161
2016-12-14 10:52:18 +00:00
Michal Karpinski
d1c710d5cf DO NOT MERGE [DPM] Management and retrieval of network logs
am: 4c47adef60

Change-Id: I39486c9d6116023f1ee9bd576b7fcd0fe20023a1
2016-12-14 10:51:33 +00:00
Michal Karpinski
b2e8690507 DO NOT MERGE [DPM] DO can start network logging and listen for events
am: c3abd34cfe

Change-Id: I7952d67d22a141040f3ee3ac2b6c3aa2cfccbbf7
2016-12-14 10:50:36 +00:00
Lenka Trochtova
3c9c96d8dc Merge "DevicePolicyManager: make 3 hidden provisioning methods system API." 2016-12-14 09:22:02 +00:00
Kang Li
53b4314ad9 Add Sharing Histories to UsageStatsManager.
This CL is for Android O Smart-Sharing (b/30982298). By this CL, sharing
counts are logged with UsageStatsManager.

Bug: 30982298
Test: manual - shared images in Camera and texts in Chrome using a mobile device.

Change-Id: I0b4aa0506f99b3083d140a48f7b4bdd5b1c5afb6
2016-12-13 17:35:38 -08:00
Philip P. Moltmann
ea10cc0fbb Do not write if apply() did not change the file.
Bug: 33385963
Test: SharedPreferences CTS tests
Change-Id: I39955f8fbcdaa54faa539a3c503e12cb00808136
2016-12-14 01:00:37 +00:00
Philip P. Moltmann
31d6889f4c Only persist last Shared Preferences state
If multiple async shared preferences writes are queued, all but the
last one can be ignored as they will be overwritten by the last one
anyway.

For commit() we need to make sure that we have at least persisted the
state of the commit.

Generation counts are 64 bit, hence they never overflow.

Test: Produced a lot of SharedPreferences.Editor.apply and did not see
excessive writes anymore, ran SharedPreferences CTS tests
Bug: 33385963
Change-Id: I3968ed4b71befee6eeb90bea1666a0bb646544f6
2016-12-14 00:56:03 +00:00
Philip P. Moltmann
60b98d391f Merge "Do not write if apply() did not change the file." 2016-12-13 22:50:31 +00:00
Esteban Talavera
6c9116a643 Create DISALLOW_{ADD,REMOVE}_MANAGED_PROFILE user restrictions
Bug: 31952368

Test: runtest -c com.android.server.devicepolicy.DevicePolicyManagerTest    frameworks-services
Test: runtest -c com.android.server.pm.UserManagerTest frameworks-services
Test: cts-tradefed run cts --module DevicePolicyManager --test com.android.cts.devicepolicy.UserRestrictionsTest

Change-Id: I240ab99c2409bbabffbc574bef202f2457026905
2016-12-13 18:14:19 +00:00
Michal Karpinski
e3639a0a07 DO NOT MERGE Fixes in comments for NetworkEvent, DnsEvent and ConnectEvent
Test: the APIs will be tested by CTS when unhidden
Bug: 29748723

(cherry picked from commit da9d3ad3ac)

Change-Id: Iaff05eb6d4a2fd12e0271c703d694ecfc0dc9a17
2016-12-13 17:25:49 +00:00
Michal Karpinski
0c4ec00f85 DO NOT MERGE Fix Lint errors for network logging API
Bug: 29748723

(cherry picked from commit 0879eb41ca)

Change-Id: I187aa5b96c283323edb6a1ebe5005d70e19bf563
2016-12-13 17:25:24 +00:00
Michal Karpinski
bbf352a2c1 DO NOT MERGE [DPM] DO uses batch token to retrieve network logs, and can retrieve
the same batch many times

This allows DO to:
a) know that some logs were dropped (by trying with token and not
getting anything)
b) know how many logs were there in each batch (useful especially
for the dropped ones)
c) retry batch retrieval if it failed

Test: will be CTS tested once APIs unhidden
Bug: 29748723

(cherry picked from commit a9ff206af2)

Change-Id: Iac10e61cdf3b100719a9c029ff897bd5ef5c8e2f
2016-12-13 17:22:07 +00:00