Commit Graph

4675 Commits

Author SHA1 Message Date
Jorim Jaggi
9a94afc6ca Merge "A brave new world for window insets (1/n)" 2018-11-29 17:14:15 +00:00
TreeHugger Robot
8ce7d1d992 Merge "Add onActionClicked in NotificationAssistantService" 2018-11-29 15:43:29 +00:00
Jorim Jaggi
f96c90ac6c A brave new world for window insets (1/n)
This CL starts a journey to discover a brave new inset world. The
path to get us there may be rocky, but it's going to be rocky.

One of the main pledges of the new API is that an app can retrieve
what is causing a certain inset easily. For that, we need to
dispatch metadata who is causing what inset, such that we can query
it from the client side.

Furthermore, the client will be able to manipulate insets directly,
but also listen to animation changes. We don't want to go through
window manager for that, thus, there needs to be a local codepath
from (global window state -> WindowInsets).

Because we have these two requirements, we dispatch the relevant
global window state for insets, represented by InsetsState, and
dispatch it to the client. On the client side we take the frame
and the InsetsState and generate WindowInsets out of it.

Bug: 118118435
Test: InsetsSourceTest, InsetsStateTest, InsetsSourceProviderTest,
InsetsStateControllerTest
Change-Id: I2bfe9dda376512916261823fc2ee35cbedeb6731
2018-11-29 13:37:43 +01:00
Tony Mak
7d4b3a5f19 Add onActionClicked in NotificationAssistantService
This is added to report clicks on actions buttons to NAS.

BUG: 119010281
Test: atest SystemUITests
Test: atest RemoteViewsTest
Test: atest NotificationManagerServiceTest
Test: Manual. Tapped on the action (both normal and contextual) and
      observed the log.

Change-Id: I381994737d8c3185d3fabf9b6c481fd01a89a634
2018-11-29 11:43:53 +00:00
TreeHugger Robot
99e225d425 Merge "Fixed a racecondition when creating notification headers" 2018-11-29 03:00:40 +00:00
Michal Karpinski
958462ffe5 Merge "Add a setting for background activity starts enabled state and basic rules for enforcement" 2018-11-29 01:56:07 +00:00
Yueming Wang
3a329573f1 Merge "Add a secure settings for cross profile calendar feature." 2018-11-29 01:55:20 +00:00
TreeHugger Robot
296f530755 Merge "Add a maxHeight LayoutParams for ResolverDrawerLayout." 2018-11-29 00:06:37 +00:00
Selim Cinek
10bbc0ea78 Fixed a racecondition when creating notification headers
Previously we were modifying the extras of a shared notification
during the notification creation, which breaks if multiple builders
are accessing the same notification. We're now passing these options
as parameters into the various functions.

Test: create low priority group / notification / observe normal behavior
Change-Id: I2aaa5632cff55a87937a2bb3f947f15555d2e897
Fixes: 117150727
2018-11-28 13:27:03 -08:00
Hongyi Zhang
7bde4e9abe Merge "add native_flags_health_check_enabled to Settings.Global" 2018-11-28 18:03:33 +00:00
yuemingw
4446ca6fa5 Add a secure settings for cross profile calendar feature.
A toggle will be added in Settings -> Work profile settings for user
to control this setting.

Bug: 118445542
Test: .manual
Change-Id: If8b882dd101688f35fb117d83a801b5c80aab367
2018-11-28 17:39:22 +00:00
TreeHugger Robot
2b2a6f4c99 Merge "Add test to detect Translate action for foreign text." 2018-11-28 17:22:29 +00:00
Michal Karpinski
8596dedf18 Add a setting for background activity starts enabled state
and basic rules for enforcement

The setting is on by default. It can be switched off with
a developer option (see accompanying commit) or
"adb shell settings put global background_activity_starts_enabled 0".

The setting is wired into ActivityStarter. When it's switched
off, all unsupported background activity starts are aborted and
it's currently manifested with a toast for quick feedback.

Only basic policy rules are added for now:
0) is it one of the most important UIDs?
1) does the calling app have any foreground activity?
2) is the calling process important enough to always be able
   to start an activity?
3) does the calling uid have any visible window?

The policy rules will be extended to allow for more use cases
in forthcoming CLs.

Most notable use cases not currently covered:
1) Notifications
2) Widgets
3) Shortcuts
4) Some of the most important system apps (e.g. com.android.vending)
5) Accessibility services and similar (IMEs covered thanks to
   visible window exemption)
6) Recents button double tap to open the previous app
See bluedoc for some more.

Bug: 110956953
Test: atest WmTests:ActivityStarterTests
Manual test:
  (on)  observe all activities are started as they used to be
  (off) starts not satisfying one of the above rules are aborted,
        a toast specifying callingPackage is shown instead
Change-Id:  I1a3e14828c96f005d975ef6998f3bda678ccab29
2018-11-28 15:08:28 +00:00
Olivier Gaillard
7c94c8417d Merge "Tests for binder work source propagation" 2018-11-28 08:59:12 +00:00
Chiachang Wang
d94e7d893b Merge "Data stall detection using DNS event" am: 33fe80f927 am: 69b60f5a31
am: f720f0dbf8

Change-Id: I5c443b959a45b3a70902d5c9738a1687e16cc766
2018-11-27 20:33:20 -08:00
Chiachang Wang
f720f0dbf8 Merge "Data stall detection using DNS event" am: 33fe80f927
am: 69b60f5a31

Change-Id: I35e7e81fa0d6db6527ea6dd606d00046df3b9818
2018-11-27 20:18:54 -08:00
Chiachang Wang
33fe80f927 Merge "Data stall detection using DNS event" 2018-11-28 03:53:30 +00:00
Hongyi Zhang
a02118df54 add native_flags_health_check_enabled to Settings.Global
add native_flags_health_check_enabled to Settings.Global. It is used
to receive the corresponding experiment flag from P/H.

Bug: 119627143
Test: manual on device
Change-Id: I980f73925818a5cb6f756d78bad324bafefc3784
2018-11-27 16:52:38 -08:00
TreeHugger Robot
dbbcf07ec5 Merge "Removes ASEC-related logic from the framework" 2018-11-27 22:32:35 +00:00
TreeHugger Robot
e3a6d9450a Merge "Add "dictionary" entity type" 2018-11-27 21:51:45 +00:00
Patrick Baumann
fc2851e4d5 Removes ASEC-related logic from the framework
This change removes remaining ASEC-related logic from the framework in
preparation for install refactoring.

Bug: 109941548
Test: install still works
Change-Id: Ic7322038e45c026bcc59800a5a9fafdbb461021f
2018-11-27 12:56:14 -08:00
Abodunrinwa Toki
229f40a6d1 Add test to detect Translate action for foreign text.
Bug: 34780395
Bug: 116020587
Test: atest android.view.textclassifier.TextClassifierTest
Change-Id: I0965d1b797fed432b552e4d9396fc140ac087c46
2018-11-27 20:22:42 +00:00
Abodunrinwa Toki
f14f2b63dc Merge "Do not linkify text with RLO/LRO characters." 2018-11-27 20:19:35 +00:00
TreeHugger Robot
fa2b85579e Merge "New Kernel Per-UID CPU Time Readers" 2018-11-27 19:28:24 +00:00
Tony Mak
e1f3ac064c Add "dictionary" entity type
We will classify the word as "dictionary" if we think user may want to look
it up. A "Dictionary" option will be shown in the floating toolbar
if users select words of this entity type.

A new Intent action is introduced to bring up the dictionary app.

The model that supports this entity type is not checked-in yet.
So no behavior change can be seen for now.

Test: Check-in the WIP model and try to select a "dictionary word".
Test: atest frameworks/base/core/tests/coretests/src/android/view/textclassifier/IntentFactoryTest.java

BUG: 68238822

Change-Id: Ib318d5b2abf79d61e55b33e397065a0714573121
2018-11-27 18:20:10 +00:00
Abodunrinwa Toki
adc194032b Do not linkify text with RLO/LRO characters.
Also don't show smart actions for selections in text with unsupported
characters.

Bug: 116321860
Test: atest android.view.textclassifier.TextClassifierTest \
            android.text.util.cts.LinkifyTest \
	    android.text.util.LinkifyTest \
	    android.widget.TextViewActivityTest

Change-Id: Id271cab8aef6b9b13ef17f1a8654c7616f75cf13
2018-11-27 15:11:41 +00:00
Olivier Gaillard
1d72458192 Tests for binder work source propagation
Test: atest binderLibTest BinderWorkSourceTest
Change-Id: I7265388c96076f8fcd44e02df493d3eec8e96b14
2018-11-27 14:36:46 +00:00
TreeHugger Robot
18ff896138 Merge "Introduce Message.USER_LOCAL and added logic to map person to user id" 2018-11-27 13:44:39 +00:00
Abodunrinwa Toki
95e76cb487 Merge "Introduce FakeContextBuilder" 2018-11-27 12:07:26 +00:00
Abodunrinwa Toki
6a211991f5 Introduce FakeContextBuilder
This helps us build a fake context where we can configure things like
what activity can handle an intent or whether no activity can handle
an intent.
The hope is that we can fake several aspects of the context used for
testing here. If our configuration requirements become too complex
in the future, we should probably consider creating more focused
fake context builders.

The immediate use case for this builder is for configuring what actions
are returned by the text classifier as activities that can handle a
specified text classifier query.

Test: atest android.view.textclassifier.TextClassificationManagerTest
Bug: 34780395
Change-Id: Ifd3d6cff928cc2f11b69206660b6d7c4791f1c0f
2018-11-27 12:06:06 +00:00
Chiachang Wang
7a70a7e0ed Data stall detection using DNS event
If dns resolver on a network get consecutively timeout then it
is a strong signal that the network is no longer usable.
Reevaluate the network once it's data stall suspected

Test: 1. runtest frameworks-net
      2. SettingsBackupTest passes
      2. Run on wifi w/o internet capability
Bug: 112653893, 113916551

Change-Id: I74287b174d933f97a91fa1529b1809856ac3b38d
2018-11-27 18:00:05 +08:00
Felipe Leme
fc8b2460c3 Merge "Initial implementation of Augmented Autofill." 2018-11-27 06:46:20 +00:00
Felipe Leme
284ad1c3e2 Initial implementation of Augmented Autofill.
Augmented Autofill is a mechanism that will let a system-provided service
provide autofill suggestions when the stardand autofill can't.

Because the Augmented Autofill service is a system app, it has less restrictions
than the standard service; in particular, this service will be responsible for
drawing the autofill UI, although the framework will provide a mechanism to host
the window. Right now, it's creating a TYPE_APPLICATION_OVERLAY window in the
service process roughly below the focused view, but in the long-term it will
use the IME suggestion window to display it.

This CL provides the initial APIs and end-to-end workflow for the simplest
scenario, but it's still full of TODO's.

Test: atest CtsAutoFillServiceTestCases # to make sure it doesn't break it
Test: atest FrameworksCoreTests:SettingsBackupTest
Test: mmm -j150 packages/experimental/FillService &&\
  adb install -r ${OUT}/data/app/FillService/FillService.apk &&\
  adb shell settings put secure intel_service foo.bar.fill/.AiaiService &&\
  adb shell settings put global autofill_smart_suggestion_emulation_flags 2 &&\
  adb shell pm grant foo.bar.fill android.permission.SYSTEM_ALERT_WINDOW

Bug: 119638877

Change-Id: I8d59b4eab3e530cd89b81456681a72fdab532756
2018-11-27 05:09:06 +00:00
Soonil Nagarkar
94749f7ad1 Deprecate location provider status callbacks
Deprecate and remove logic around location provider status.

Bug: 118885128
Test: Tested manually on device
Change-Id: I68289cb5ed22e66532847758c36155a4ce607bbc
2018-11-26 23:19:00 +00:00
Tony Mak
f99ee17fc0 Introduce Message.USER_LOCAL and added logic to map person to user id
1. Introduce Message.USER_LOCAL to allow caller to specify which
   message is from the local user.

2. TextClassifierImpl will now encode the Person object to a user
   id.

3. Fixed a bug in Person.equals check

BUG: 111437455
BUG: 111406942

Test: atest frameworks/base/core/tests/coretests/src/android/view/textclassifier/ActionsSuggestionsHelperTest.java

Change-Id: I6629f42244a402fa210f87afa88a629c2ca4a510
2018-11-26 18:33:16 +00:00
Misha Wagner
474e7bece0 Filter threads that have low total CPU usage for CpuTimePerThreadFreq
Test: KernelCpuThreadReader::testReader_filtersLowTotalCpuUsage
Bug: 120016054
Change-Id: If09c8c01e6efffd0d7315613dc7425138528d39c
2018-11-26 16:25:59 +00:00
Marcin Oczeretko
8e90ada67e Merge "LooperStats - add debug entries to output for data validation" 2018-11-23 14:11:40 +00:00
Abodunrinwa Toki
d531f70d30 Merge "ConversationActions Config installer." 2018-11-22 16:02:54 +00:00
TreeHugger Robot
c61363e7a2 Merge "Add detectLanguage and suggestConversationActions to TCS" 2018-11-22 11:16:30 +00:00
Abodunrinwa Toki
f438e14dfd ConversationActions Config installer.
This installs model updates for smart reply/actions
aka conversation actions.

Test: none
Bug: 111437455
Bug: 111406942
Change-Id: I9cb04e7b20b565ac5d128475a90bd065c805e95e
2018-11-21 17:33:53 +00:00
Tony Mak
0be540b227 Add detectLanguage and suggestConversationActions to TCS
BUG: 111406942
BUG: 111437455

Test: atest frameworks/base/core/tests/coretests/src/android/view/textclassifier/TextClassifierTest.java

Change-Id: Iee9c970ebbec6590906907d67be3dd4021c1b4b2
2018-11-21 15:36:11 +00:00
Marcin Oczeretko
d32a513541 LooperStats - add debug entries to output for data validation
Test: UT and manually verified that debug entries are included in
adb shell dumpsys looper_stats

Change-Id: Ie2166974cffd18a719aaa06f6e3525eb0337d2a1
2018-11-21 11:51:16 +00:00
Misha Wagner
b96bd1a7d7 Add Pixel 3 time_in_state format parsing to KernelTimeInStateReader
Bug: 119090941
Test: Unit tests in ProcTimeInStateReaderTest

Change-Id: I598672809ccd44e6035ff7baf9f372a6d6cf211a
2018-11-21 10:37:37 +00:00
Misha Wagner
dc797543b8 Add retrieval of thread CPU data for processes owned by specified UIDs
By default, the UIDs collected are all system users, i.e. UIDs in the range
[1000, 2000).

Bug: 119089294
Test: KernelCpuThreadReaderTest#testReader_byUids

Change-Id: I162916f2238aad975b657c9299cb9035718768bb
2018-11-21 10:37:37 +00:00
Ben Lin
058ab3eb1e Add a maxHeight LayoutParams for ResolverDrawerLayout.
This way when laying out the child views, each view can specify that
they don't want to grow past a certain height.

Bug: 73819520
Test: atest com.android.internal.app.ResolverActivityTest#setMaxHeight

Change-Id: Ibff3609746b4b6ec7b4debd8433487c7fc9ce0fa
2018-11-20 10:03:32 -08:00
Misha Wagner
4f8bb6665c Merge "Add frequency bucketing to per-thread CPU usage reading" 2018-11-19 14:45:18 +00:00
Olivier Gaillard
e7ce49d152 Merge "Rename WorkSource methods on Binder and IPCThreadState." 2018-11-19 11:01:23 +00:00
Misha Wagner
0c5edc3647 Add frequency bucketing to per-thread CPU usage reading
This means that instead of returning all frequencies, we return
KernelCpuReader#NUM_BUCKETS frequencies.

Test: Unit tests for bucket creation and usage in KernelCpuThreadReaderTest

Change-Id: Iea0996f642deecae8ce66e5122045a0694fac03b
2018-11-19 10:24:38 +00:00
Oscar Shu
3b40ab2bba Merge "Pno list recency optimization: Settings.global flag" 2018-11-15 22:28:14 +00:00
Adam Bookatz
0dee99a7c7 Merge "Statsd atom: Power Use" 2018-11-15 20:20:08 +00:00