Commit Graph

8779 Commits

Author SHA1 Message Date
Kenny Guy
22bd044b0c New class to track brightness slider interactions.
Provides system apps with access to the users
brightness slider interactions and context from
when the brightness level was changed.

Test: runtest -c com.android.server.display.BrightnessTrackerTest frameworks-services

Change-Id: Ibdb3c78cb1d11887cb38b24c30754ff2e6f3bda8
2017-11-13 21:52:48 +00:00
David Chen
21582961d7 Tracks isolated uid's and their parent uid.
We push events from BatteryStatsImpl if an isolated uid is added or
removed and we have a custom rule in statsd to use these events to
update our uid map. In the future, we need to use this map to
convert all incoming uid's to their host uid.

Test: Added unit-test to UidMap_test.
Change-Id: I33c0451eb2c886161f22dd12e479d216fad0940d
2017-11-09 13:39:43 -08:00
Christine Franks
69dde2ed8d Merge "Rename NightDisplayController and -Service" 2017-11-09 17:50:11 +00:00
Ricky Wai
0aa3aef95f Hide NetworkStatsFactory class
Test: Able to compile
Change-Id: I37f385c773120405c437643b5de406772a684dcd
2017-11-09 15:22:59 +00:00
Ricky Wai
1a6e667cb6 Add Network security watchlist service
Network security watchlist service is a service to monitor all potential
harmful network traffic. By setting a network watchlist, any connections
that visit any site from watchlist will be logged.

Logs will be aggregated everyday and encoded using differential
privacy before exporting it from framework.

This feature is disabled now, run "setprop ro.network_watchlist_enabled true" to enable it.

All network events are handled in an async bg thread, it should not
cause any delay in netd. Also, it uses the hooks in enterprise network logging,
so we can run netd_benchmark to measure the impact to netd.

Here are the things not included in this CL:
- ConfigUpdater to get and set watchlist
- Differential privacy encoding logic and reporting
- CTS
- Memory and performance optimization for internal watchlist data structure

Test: manual - turn on the feature, hard code a watchlist xml, process
that visited that domain is being logged in sqlite.
Test: run netd_benchmark - seems no obvious performance change.
Test: bit FrameworksCoreTests:android.net.NetworkWatchlistManagerTests
Test: runtest frameworks-net
Test: runtest frameworks-services -p com.android.server.net.watchlist

Bug: 63908748

Change-Id: I09595178bac0070a867bc5e0501a7bf2c840e398
2017-11-08 18:57:46 +00:00
Christine Franks
5397f0353a Rename NightDisplayController and -Service
Bug: 68258004
Test: make -j100 && runtest -x
frameworks/base/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/AutoTileManagerTest.java
&& runtest -c com.android.server.ColorDisplayServiceTest
frameworks-services
Change-Id: I2b89942bd412e4d6958e65b62bc345fb1e60176f
2017-11-08 10:29:01 -08:00
Selim Cinek
c7b5f78765 Merge changes from topic "notification_messaging"
* changes:
  Fixed measuring of messages with excess space
  Fixed the handling of oneToOne conversations for certain apps
  Improved the messaging transformation
  Implemented animations for messaging changes
  Refactored clipping util to be used in core
  Improved the headsup notification for messages
  Redesigned the messaging style
  Fixed a bug where images weren't transforming properly
2017-11-07 18:42:24 +00:00
TreeHugger Robot
7fe465a9e7 Merge "SidekickService (base)" 2017-11-07 02:29:16 +00:00
Selim Cinek
dae97c94a1 Fixed measuring of messages with excess space
Sometimes the layout was measured too big, with additional
white space that wasn't needed because of the way excess
space was handled.

Test: manual write 3 single line messages and 2 two line
Bug: 63708826
Change-Id: I09e728e87e316cb770d5c65bf355a68848e58f0b
2017-11-06 16:22:09 -08:00
Selim Cinek
1d6b50eccf Improved the messaging transformation
The messaging layout now transforms smoothly between
the different views.

Test: manual, send messages really fast, expand, collapse
Bug: 63708826
Change-Id: I79da4092eb03fb41a1963b566602386b25141192
2017-11-06 16:22:08 -08:00
Selim Cinek
d3809996af Implemented animations for messaging changes
The animations for new messages coming in are now happening
more smoothly. They have proper appear and disappear
animations.

Test: manual, add new messages, observe animations
Bug: 63708826
Change-Id: I714e976cfee5c0a2c5187a5c3146a7530739f312
2017-11-06 16:22:08 -08:00
Selim Cinek
5ec560a12a Refactored clipping util to be used in core
We need the possibility to disable clipping
up a view hierarchy also in core, so I'm
moving it and refactoring it.

Test: expand, observe normal clipping
Bug: 63708826
Change-Id: I157395be8f2b7ac75afc0a3967cb0f2068a02fb6
2017-11-06 16:22:07 -08:00
Selim Cinek
e62255ccc5 Improved the headsup notification for messages
Previously the heads up notifications and also the collapsed versions were not
displaying in the new style.
They are now displayed in the new style of heads up notifications.

Test: add messaging notification in heads up
Bug: 63708826
Change-Id: I041584cd6ee740fd8c59f332f727ed83c89e777f
2017-11-06 16:22:07 -08:00
Selim Cinek
88188f2d62 Redesigned the messaging style
The layout now looks much more recognizable
as a messaging template and enables us to
prepare for more useful functionality.

Test: Send messages and observe display
Bug: 63708826
Change-Id: I896b3692a1e84976e8fd37cf37611ddb1d358fb9
2017-11-06 16:22:04 -08:00
Jeff Sharkey
8918298045 Narrower StrictMode defaults.
Until now, userdebug and eng builds have tracked StrictMode
violations on all system apps, including prebuilts that we have no
control over, which results in a lot of unactionable noise.

This CL narrows the set of enabled apps to only "bundled" system
apps, which gives us a much higher chance of burning these violations
down to 0 and keeping them there.  We don't have a good proxy for an
app being "bundled", so we detect it based on being in the "android."
or "com.android." package namespace.

Clean up the entire flow of applying StrictMode defaults to make it
much more human-readable.  This resulted in us fixing a bug where
StrictMode was never actually enabled for jank-sensitive threads in
system_server!

Relax I/O checks in a few places where we know we're interacting with
procfs or sysfs.  Add internal "allow" methods that avoid object
allocation by returning raw mask.

Test: cts-tradefed run commandAndExit cts-dev -m CtsOsTestCases -t android.os.cts.StrictModeTest
Bug: 68662870
Change-Id: I536e8934fbcdec14915fcb10995fc9704ea98b29
2017-11-03 17:36:35 -06:00
TreeHugger Robot
a779b40e3a Merge "Turn default gradient into solid black" 2017-11-02 22:06:43 +00:00
TreeHugger Robot
46fabf34ea Merge "Center align AoD2 notifications" 2017-11-02 20:54:16 +00:00
TreeHugger Robot
27d39bd77e Merge "Add support for minimized mode for right dock side for tablets (1/2)" 2017-11-02 18:43:18 +00:00
David Chen
c8a4324855 Adds pulling for network bytes for statsd.
Adds atoms to collect network bytes transmitted and received via wifi
and mobile data. We need to get the list of correct ifaces from
BatteryStats since NetworkStatsService only tracks the mobile ifaces.
We split the atoms so that we can also capture metrics sliced on
foreground and background since they are available from the kernel.
Also adds an atom for the Kernel Wakelocks.

Test: Manually tested with adb shell cmd stats pull-source after
modifying the StatsPullerManager.cpp

Change-Id: I9467afad799c6d97560e868f8625fefae5c2b5e1
2017-11-02 00:41:51 -07:00
Mike Ma
d2239828d6 Record proto to file in am instrument
Add an option -f to record instrumentdata proto produced by am instrument
to a file in addition to printing to stdout. Default path is
/sdcard/instrument-logs/log-yyyyMMdd-hhmmss-SSS.instrumentation_data_proto.
If the file exits, it will be deleted before writing. Path can be changed
via optional <FILE> argument after -f.
If -f and -m are both present, proto will be written to a file and print
to stdout.

Test: build, flash and run:
bit -bi FrameworksCoreTests
adb shell am instrument -w -r -f tmp/tmp.log \
-e class com.android.internal.os.BatteryStatsNoteTest \
com.android.frameworks.coretests/android.support.test.runner.AndroidJUnitRunner

Change-Id: Iabc320c066d5995eee842c26416623eeb3d403f4
2017-11-01 14:20:31 -07:00
Dianne Hackborn
ad5570f58d Merge "Fully implement "install" and "install-write" in PackageManagerShellCommand." 2017-10-31 19:55:42 +00:00
TreeHugger Robot
f30e0cfca0 Merge "Simple numbering system selector for LocalePicker." 2017-10-31 19:21:53 +00:00
Matthew Ng
f59a4132e8 Add support for minimized mode for right dock side for tablets (1/2)
Tablets have the ability to dock to the right side in landscape. This
change supports minimized mode for right dock side.

Test: run-test CtsActivityManagerDeviceTestCases
android.server.am.ActivityManagerDockedStackTests#
testMinimizedFromEachDockedSide
Change-Id: Ie879bdf7bf74226c0ceda9295f9de2004fd6a9b5
Fixes: 68017311
2017-10-31 11:03:48 -07:00
Dianne Hackborn
ca3872ce36 Fully implement "install" and "install-write" in PackageManagerShellCommand.
We can use the new mechanism to ask the calling shell to open
a file in order to implement the rest of these commands, allowing
you to give the path to an apk to install.  That API is thus
extended to allow you to open readable files, not just opening
file for writing.

Doing this however means we no longer can pass a file path to
AssetManager for the apk to parse, we only have an already open
fd for that.  Extending AssetManager to allow adding apks from
fds is not that hard, however, since the underlying zip library
already supports this.

This main thing this changes is in AssetManager.cpp where we
retrieve the open zip file for a particular apk that has been
added.  This used to look up the zip file by path every time
it was needed, but that won't work anymore now that we can have
things added by fd.  Instead, we keep track of each opened zip
in the AssetManager, so we can just directly retrieve it from
the asset_path representing the item that was added.  As a
side-effect, this means for normal paths we no longer need to
look up by name, but just have the opened zip file directly
accessible.  (This is probably good, but it does mean that we
no longer run the logic of seeing if the zip file's timestamp
has changed and re-opening it if it has.  We probably shouldn't
be relying on that for an active AssetManager anyway, and maybe
it is even good that we don't allow the zip file to change
under it?)

A follow-up change will finally remove the Pm.java implementation
and turn the pm "command" into a simple shell script that runs
cmd package.

Test: manual

Change-Id: Ie103e3bdaa5b706796cc329254f2638151a3924f
2017-10-31 10:54:31 -07:00
Chris Phoenix
10a4a64bcc SidekickService (base)
Test: builds; Sidekick watch face animates in Ambient
Change-Id: I5946dbf7194653ac4707b6c186b0a9197d125d5f
2017-10-31 16:02:41 +00:00
Tobias Thierer
e74399de6f Merge "OWNERS: Prefer Jeff Sharkey's @android.com account over @google.com" am: b519569eb3 am: 4f59edb63f
am: 60923f7860

Change-Id: I52d63eac03e32f6d020809cae2cecb7cad0154c0
2017-10-31 14:01:37 +00:00
Tobias Thierer
60923f7860 Merge "OWNERS: Prefer Jeff Sharkey's @android.com account over @google.com" am: b519569eb3
am: 4f59edb63f

Change-Id: If74e0f6783bb38c707a3575821255e8f1ec4d78f
2017-10-31 13:51:26 +00:00
Christine Franks
771cf3cc44 Merge "Respect legacy color mode settings" 2017-10-31 03:16:05 +00:00
Christine Franks
17947177b3 Respect legacy color mode settings
Bug: 68411440
Test: make -j100, verified starting with each of the three options.
Change-Id: I73e701a86733e0f8a5d017949052b16cdf58f398
2017-10-30 17:26:17 -07:00
TreeHugger Robot
15c45c854e Merge "Fix StateMachine init/quit race." 2017-10-30 22:57:47 +00:00
Igor Viarheichyk
025402c5e9 Simple numbering system selector for LocalePicker.
This change introduces minimal changes needed to support selection
of locales with BCP 47 numbering system specification. Two level
selection (Language/Region) schema remains, locales with numbering
systems appear in the region selection list and are displayed as
"region (numbering system)".

Bug: 18340949
Bug: 63754513
Test: manual, experimental UI for review.

Change-Id: I42691f3714c5e5c51fd8d96c034cc3a9f6be93dc
2017-10-30 14:35:06 -07:00
Lucas Dupin
e7476addec Turn default gradient into solid black
Test: visual
Bug: 66957450
Change-Id: I6a34a35912e4dd4594565f88636ce89689d26f2f
2017-10-30 11:09:25 -07:00
Tobias Thierer
66d1933ce0 OWNERS: Prefer Jeff Sharkey's @android.com account over @google.com
He prefers to use his @android.com account.

Test: Treehugger
Bug: 63673347
Exempt-From-Owner-Approval: Allow @android.com to approve this CL :)

Change-Id: Ie80cc7864de7b91ae44ad57f0bae9b859d034803
2017-10-30 17:53:11 +00:00
Winson Chung
941dcba6e3 Merge "1/ Refactor out logic to fetch assist data asynchronously" 2017-10-30 16:22:26 +00:00
Péter Visontay
23567494d0 Merge "Fix some paths (in comments) pointing to old locations of C++ Binder interfaces." 2017-10-30 11:27:32 +00:00
Winson Chung
da2818fe89 1/ Refactor out logic to fetch assist data asynchronously
- This logic will also be used when the recents component is started to
  fetch assist data associated with the current activity.

Bug: 67864419
Test: com.android.server.am.AssistDataRequesterTest
Test: CtsVoiceInteractionTestCases

Change-Id: I4cb3c2536a104d7071bc0a1fd6e31dfc2c0ce8d0
2017-10-27 13:49:26 -07:00
Peter Visontay
cee763269a Fix some paths (in comments) pointing to old locations of C++ Binder interfaces.
Test: None (comment changes).

Change-Id: I372e38bbb73c9d0a289089b239fa669f130252ba
2017-10-27 18:15:33 +01:00
Lucas Dupin
bd9798f617 Center align AoD2 notifications
Hides app name, and centralizes all notification data.

Bug: 64155983
Test: send aod notification, observe
Change-Id: Ifbf35570ad3177422c7dd5db053b7708016841b2
2017-10-26 15:37:25 -07:00
Christine Franks
8ad7149d1b Support native and srgb for night display
Bug: 68159303
Test: make -j100

Change-Id: Iea4b38bd8c9037f50b7ffa6e3c4f12b0e536a8ce
2017-10-26 15:36:19 -07:00
Calvin On
dce6e5dfd4 Fix StateMachine init/quit race.
The quitNow method places the SM_QUIT_CMD at the front
of the queue. This can cause StateMachine to throw exception
if it has not yet processed the SM_INIT_CMD from start().

Bug: 67370902
Test: make checkbuild
Test: StateMachineTest unittest
Test: build/install on device, toggle bluetooth and wifi
Change-Id: I7cec7bb91e0447e3c565d33cb7c34ccf59566639
2017-10-26 14:07:31 -07:00
Christine Franks
10e9bc5ba7 Merge "DO NOT MERGE - Support native and srgb for night display" into oc-mr1-dev
am: 2d110e6829

Change-Id: I0e805b480a3317548c219eb282fcf399b41b4ff1
2017-10-25 20:28:07 +00:00
Christine Franks
8c9f91eba6 DO NOT MERGE - Support native and srgb for night display
Bug: 68159303
Test: make -j100

Change-Id: Iea4b38bd8c9037f50b7ffa6e3c4f12b0e536a8ce
2017-10-25 12:43:10 -07:00
TreeHugger Robot
d62ff511dc Merge "incidentd: Adding proto dump for AlarmManager." 2017-10-25 18:43:39 +00:00
Michael Wachenschwanz
4b3a7f2987 Merge "Java side setup and access to Binder Proxy Tracking" 2017-10-25 18:20:56 +00:00
TreeHugger Robot
40e1dd673e Merge changes Ifee27c86,I9ffa4b00
* changes:
  Add more atoms to statsd
  Add wakelock atom to statsd
2017-10-25 17:05:44 +00:00
TreeHugger Robot
17e5e2e573 Merge "Add some atoms to statsd" 2017-10-25 17:04:54 +00:00
Andrei Stingaceanu
f3ee5e6e4a [Magnifier - 7] Minor cleanup
Remove uselsess annotations on primitives.

Bug: 63531115
Test: bit FrameworksCoreTests:android.widget.TextViewActivityTest
Test: bit CtsWidgetTestCases:android.widget.cts.TextViewTest
Test: manual test that shows the magnifier working
Change-Id: I1e15e18d57af23d25a347d644ea57372e32adb59
2017-10-25 10:56:16 +01:00
Bookatz
e588524f89 Add more atoms to statsd
The following events are added to statsd:
WifiLockStateChanged
WifiSignalStrengthChanged
WifiSignalStrengthChanged
PhoneSignalStrengthChanged

Test: manually confirmed these show up in the statslog.
Change-Id: Ifee27c86a28616d8cb9d43bdf11f9cabe2b367c6
2017-10-24 20:10:31 -07:00
Bookatz
d674624aff Add wakelock atom to statsd
The wakelock event is logged in statsd.

Test: manually confirmed that the event appears in statslog.
Change-Id: I9ffa4b0042264aabf3526843b4fb1832d183de61
2017-10-24 18:39:35 -07:00
Michael Wachenschwanz
55182464fb Java side setup and access to Binder Proxy Tracking
Expose Binder Proxy Tracking by Uid from the native side. Enable
 tracking for SYSTEM and killing of any bad behaving uids.

Change-Id: Ifd6d0f30a93fad406417dd83c1495c105bced974
Fixes: 63901963
Test: bit FrameworksCoreTests:android.os.BinderProxyCountingTest
2017-10-24 18:30:57 -07:00