Commit Graph

4616 Commits

Author SHA1 Message Date
Sudheer Shanka
c2c3d18c11 Merge "Update shared sandbox prefix to "shared-"." 2018-11-14 18:02:11 +00:00
Adrian Roos
b849386493 WindowInsets: Fix unintentional un-nulling in legacy constructor
Fixes issues arising from mistakenly turning consumed insets to zero insets
in the legacy Rect constructor.

Change-Id: Ie531fca0fba28eba25843004acfb5444ca6669cd
Fixes: 119310980
Test: atest android.view.WindowInsetsTest
2018-11-14 07:36:25 -08:00
Sudheer Shanka
d68bd60ccd Update shared sandbox prefix to "shared-".
":" is not allowed in filenames by vfat.

Bug: 119525489
Test: sm set-virtual-disk true
Test: atest core/tests/packagemanagertests/src/android/content/pm/KernelPackageMappingTests.java
Test: atest services/tests/servicestests/src/com/android/server/StorageManagerServiceTest.java

Change-Id: I95ef58486abe8f2a9760e0229192448e0bd9ef42
2018-11-13 18:16:36 -08:00
Salvador Martinez
5980543478 Merge changes from topic "dynamic_power_saver"
* changes:
  Create APIs to interact with DynamicPowerSaver
  Create new battery saver mode
2018-11-13 20:23:03 +00:00
Hui Yu
81f977753a Merge "Add UsageStats events for foreground service start/stop." 2018-11-13 18:16:19 +00:00
Salvador Martinez
04b98338f7 Create new battery saver mode
Creates the concept of a "dynamic" battery saver mode controlled by
an external input in the framework. This mode behaves similarly to the
current automatic percentage based battery saver minus the fact that
the trigger is not static and that we might want to disable it at
a different level than when it was triggered.

Test: atest BatterySaverStateMachineTest
Bug: 111450127
Change-Id: Iac0de4f8f0336ed8870d2397574bd8885b7aa6a2
2018-11-13 09:29:36 -08:00
David Brazdil
0215bc8af3 Merge "Simplify HIDDEN_API_ENFORCEMENT_ flags" 2018-11-13 15:50:41 +00:00
TreeHugger Robot
1b34837e69 Merge "Add get/setExtras to TextLinks and TextSelection" 2018-11-13 12:09:42 +00:00
Tony Mak
916bb9e37e Add get/setExtras to TextLinks and TextSelection
Test: atest frameworks/base/core/tests/coretests/src/android/view/textclassifier/TextSelectionTest.java
Test: atest frameworks/base/core/tests/coretests/src/android/view/textclassifier/TextLinksTest.java
Test: atest cts/tests/tests/view/src/android/view/textclassifier/cts/TextClassifierValueObjectsTest.java

BUG: 118690735

Change-Id: I5786db40b24b38020514f96b1d642835c9a9db51
2018-11-13 12:09:22 +00:00
TreeHugger Robot
9005dafb74 Merge "Implements TextClassifierImpl.suggestConversationActions" 2018-11-13 11:14:08 +00:00
Tony Mak
adbebcc634 Implements TextClassifierImpl.suggestConversationActions
TODO: Construct RemoteAction for contextual actions.
TODO: Map Person object to user id.
TODO: Consider to use LangID to infer the locale. And get a new model when locale is changed.

BUG: 111437455
BUG: 111406942

Test: atest ./core/tests/coretests/src/android/view/textclassifier/TextClassificationManagerTest.java

Change-Id: Id35066455918b3321fcd30df0ff215e30586a4b3
2018-11-13 11:12:40 +00:00
Hui Yu
e361a23bba Add UsageStats events for foreground service start/stop.
1. Send FOREGROUND_SERVICE_START event when foreground service starts.
Send FOREGROUND_SERVICE_STOP event when foreground service stops.
2. One app can multiple foreground services and multiple services can be
started. Because this, in UsageStats, change mLastForegroundEvent to
className to event map, do this for both activity and foreground
service. Change UsageStatsProto and UsageStatsXmlV1 to support this
change.
3. Add more test cases in UsageStatsTest.java.

Test: start music player which is foreground service, observce these
two events when start play and pause play.

Change-Id: I3dc14f5b73cc114a53b8c51f90d3011d9ace35ac
Bug: 112002260
Test: atest UsageStatsTest#testForegroundService
atest frameworks/base/services/tests/servicestests/src/com/android/server/usage/UsageStatsDatabaseTest.java
atest frameworks/base/core/tests/coretests/src/android/app/usage/UsageStatsTest.java
2018-11-12 17:41:03 -08:00
Mike Ma
64fdbf5ff7 Merge "An efficient proc file reader" 2018-11-12 22:51:38 +00:00
Winson Chung
d27f6b3fc6 Merge "Expose task id and activity component in task snapshot and assist structure" 2018-11-12 17:56:22 +00:00
Alison Cichowlas
69f39989c2 Merge changes from topic "sharesheet-refactor"
* changes:
  Add URI shared by screenshot into extras.
  Re-patching in Sharesheet security model changes.
2018-11-12 15:19:11 +00:00
Peiyong Lin
2d5a2bb0ad Add global property to store opt-in application package name.
We provide a way in developer option to opt-in an application to use updated
graphics driver. To make sure we set up the graphics environment correctly, we
need to access the package name of the selected application. This patch
introduces a global property to store the package name.

BUG: 119221883
Test: Build, flash and boot, verify with prototype
Change-Id: I49dfcccf387169c072fb9345f7a50c00fcdb0737
2018-11-09 11:53:00 -08:00
Andrii Kulian
03faa1467a Merge "Add dev option to force desktop mode" 2018-11-09 19:25:19 +00:00
Mike Ma
fa2534351f An efficient proc file reader
A less resource hogging reader for reading proc files in string
format. It is singleton and thread-safe, so all downstream clients
share the same instance to avoid duplicate allocation. It reads
the entire proc file all at once (to mimimize the impact to the
kernel) into a reusable char[] buffer (to prevent frequent GC). A
read lock is automatically held for the client when a valid file
iterator is returned. Client MUST call close() to unlock it or take
advantage of try-with-resources.

The reader keeps an error counter. It rejects further requests if it
has accumulated 5 errors, to prevent log spam. The reader also has
a 500ms cache, which can be bypassed with a parameter.

Bug: 111216804
Test: atest FrameworksCoreTests:com.android.internal.os.KernelCpuProcStringReaderTest
Change-Id: Ifa5213a5c7baf95d62f74486815030d9aa54ca28
2018-11-09 11:21:23 -08:00
Winson Chung
48b25653f4 Expose task id and activity component in task snapshot and assist structure
- This would allow the AiAi service to cross-reference assist data with
  streaming text data and snapshots
- Pre-fill the task id/activity when receiving the assist data from the
  activity and remove unnecessary autofill santization down the line

Bug: 117268952
Test: adb shell dumpsys window all
Test: atest CtsAutoFillServiceTestCases
Test: atest CtsAssistTestCases

Change-Id: I0d0d2c85426777cc77397716db34b520593db100
2018-11-09 09:08:11 -08:00
Alison Cichowlas
3e34050a42 Re-patching in Sharesheet security model changes.
Previously reverted due to b/72554856, fix for that in topic.

Original commit message:

Security model for moving sharesheet to systemui

ResolverActivity (still in frameworks) now requests a "permission token"
that it hands to a stubbed system ui activity ChooserActivity.

This permission token allows an app (SysUI) with the signed permission
"START_ACTIVITY_AS_CALLER" to call
ActivityManagerService#startActivityAsCaller. Permission tokens are a
one-time use, limited-time offer.

Test: runtest systemui && manual testing
Bug: 69850752
Change-Id: Ia50e21e2f8c6b6d0ed7207625e3b5aef214396bb
2018-11-09 11:01:54 -05:00
Jimmy Chen
53f58bc1c7 Merge "p2p: support factory reset for P2P group" 2018-11-09 02:47:08 +00:00
Andrii Kulian
15cfb42801 Add dev option to force desktop mode
When turned on, this will:
- Enable system decorations on external screens
- Enable freeform windowing mode on external displays
- TODO: Show mouse pointer on external display

Bug: 112451761
Test: DisplaySettingsTests
Test: DesktopModePreferenceControllerTest
Test: FreeformWindowsPreferenceControllerTest
Change-Id: If46399b9d6b8faa2a11fbdf8a4bbfef1284147c8
2018-11-07 15:21:04 -08:00
Michael Groover
6a8af2abef Merge "Enable device identifier check for 3P apps" 2018-11-07 19:32:34 +00:00
Michal Karpinski
d9412bf201 Merge "Add feature flag for "show hidden launcher icon apps" and "install app notification"" 2018-11-07 18:42:31 +00:00
Jorim Jaggi
05ac00c630 Merge changes from topic "windowinsets-api"
* changes:
  WindowInsets: Annotate nullability
  WindowInsets: Add Builder
  WindowInsets: reimplement WindowInsets on top of Insets
  WindowInsets: make WindowInsets.inset() public
2018-11-07 16:35:06 +00:00
Ricky Wai
13b0abe1bc Add feature flag for "show hidden launcher icon apps"
and "install app notification"

Bug: 111214100
Test: CTS test will be submitted with flag enabling commit
Change-Id: I604d75dc48e09039619f571d418a700106cbdd5d
2018-11-07 11:28:49 +00:00
Jimmy Chen
c4240a7ce8 p2p: support factory reset for P2P group
provide system API for Settings

Bug: 109866998
Test: Manual tests
      * manual trigger network reset in below conditions:
        * trigger network reset with P2P on
        * trigger network reset with WiFi on, P2P off
        * trigger network reset with WiFi off
        * trigger network reset with WiFi off then do reboot
      * check groups shown in WiFi Direct page
      * use wpa_cli -i p2p0 list_network
Test: CtsVerifier - WiFi Direct category
Test: Unit tests - atest frameworks/opt/net/wifi/tests/wifitests
Test: Permission check
      * call factoryReset as Guest
      * call factoryReset from 3rd-party application

Change-Id: Id487ebf4564b78b613b550c0f0266effb0ae793e
2018-11-07 09:57:23 +08:00
Michael Groover
3f0267151c Enable device identifier check for 3P apps
Bug: 117781266
Test: cts-tradefed run cts -m CtsTelephony3TestCases
Test: cts-tradefed run cts -m CtsPermissionTestCases -t android.permission.cts.TelephonyManagerPermissionTest
Test: cts-tradefed run cts -m CtsTelephonyTestCases -t android.telephony.cts.TelephonyManagerTest
Test: cts-tradefed run cts -m CtsDevicePolicyManagerTestCases -t \
      com.android.cts.devicepolicy.DeviceOwnerTest#testDeviceOwnerCanGetDeviceIdentifiers
Test: cts-tradefed run cts -m CtsDevicePolicyManagerTestCases -t \
      com.android.cts.devicepolicy.ManagedProfileTest#testProfileOwnerCanGetDeviceIdentifiers
Test: cts-tradefed run cts -m CtsDevicePolicyManagerTestCases -t \
      com.android.cts.devicepolicy.ManagedProfileTest#testProfileOwnerCannotGetDeviceIdentifiersWithoutPermission
Test: cts-tradefed run cts -m CtsDevicePolicyManagerTestCases -t \
      com.android.cts.devicepolicy.DeviceOwnerTest#testDeviceOwnerCannotGetDeviceIdentifiersWithoutPermission

Change-Id: Ia511d6d566ab1ceacfedcd45f45500a846fcb983
2018-11-06 15:01:46 -08:00
David Brazdil
06ae4b8dc3 Simplify HIDDEN_API_ENFORCEMENT_ flags
Remove the distinction between pre-P and P apps and simplify the flags
to ENABLED, DISABLED and JUST_WARN.

Test: m
Change-Id: I87ef00a15ac9a3abfaeb011bbd8804b216f26c90
2018-11-06 11:34:26 +00:00
Oscar Shu
28de999efe Merge changes from topic "PnoPipeline"
* changes:
  Pno frequency culling: Settings.Global flag
  Pno frequency culling: add frequencies field
2018-11-06 01:45:19 +00:00
Cody Northrop
e4ae7ea03e Merge "Add GLES specific setting for layers" 2018-11-04 17:00:46 +00:00
TreeHugger Robot
1b2a677360 Merge "Refactor model listing / selection code to support other types of model" 2018-11-02 16:08:41 +00:00
Tony Mak
ba22842144 Refactor model listing / selection code to support other types of model
Currently, listModelFiles and findBestModelFile methods only support annotator model.
But we want to extend them to support other models as well, like langID and actions.

Thus, introducing ModelFileManager, which provides listModelFiles and
findBestModelFile. ModelFileManager takes a Supplier<List<ModelFile>> to list model files.
For different types of model, we just need to provide a different supplier to the ModelFileManager.

There should be no behavior change.

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

Change-Id: I4fc3fd1c9246383ee5d906792bb14b96dbf0a79f
2018-11-02 11:19:44 +00:00
Cody Northrop
0fa1d220dc Add GLES specific setting for layers
This allows loading layers for GLES and Vulkan at the
same time by adding a GLES specific setting:

  GPU_DEBUG_LAYERS_GLES

which mirrors the existing setting:

  GPU_DEBUG_LAYERS

The Vulkan and GLES loaders now scan distinct layer
lists, correcting an issue that would prevent Vulkan
from loading when it failed to find GLES layers.

Bug: 110883880
Test: Load a GLES layer when running ANGLE with Vulkan backend
Test: cts-tradefed run singleCommand cts -m CtsGpuToolsHostTestCases
Change-Id: I370be4ce6fdde9e95989eb1f274add8b5790263e
2018-11-01 14:15:44 -06:00
xshu
d4b607ce76 Pno frequency culling: Settings.Global flag
Add a flag to enable/disable this feature.

Bug: 64312268
Test: compile
Test: First use "adb shell settings put global wifi_pno_frequency_culling_enabled 1" to test turning on the feature.
Test: Then test "adb shell settings put global
wifi_pno_frequency_culling_enabled garbage" does not turn the feature
off.
Change-Id: Ia6cd0d3c9888d7b2e0513b51fc4ad92c3eb171de
2018-11-01 11:03:41 -07:00
Sunny Goyal
2daf457f4b Merge "Adding shared element transitions support in AppWidgets" 2018-11-01 16:19:12 +00:00
TreeHugger Robot
1b11fcc9c9 Merge "Extract IMM internal flags into StartInputFlags" 2018-11-01 09:09:15 +00:00
Yohei Yukawa
35fa6d581e Extract IMM internal flags into StartInputFlags
This is a mechanical refactoring like we did to split
InputMethodClient for Bug 118040692.

So-called "controlFlags" in InputMethodManager (IMM) was originally
introduced for IMM#startInput()/windowGainedFocus() [1] to carry
additional client information then reused when we unify startInput()
and windowGainedFocus() into startInputOrWindowGainedFocus() [2].

This CL mechanically moves the location where those flags are defined,
from InputMethodManager.java to a newly created file
StartInputFlags.java.

This is still just a mechanical refacotring / renaming.  There should
be no user-visible behavior change.

 [1]: Icb58bef75ef4bf9979f3e2ba88cea20db2e2c3fb
      7663d80f6b
 [2]: I56934f18e30d90fcdf77bcbb0c35a92a5feb1b82
      05c25f8a3a

Test: atest CtsInputMethodTestCases CtsInputMethodServiceHostTestCases
Test: atest FrameworksCoreTests:com.android.internal.inputmethod.InputMethodDebugTest
Change-Id: If5a4810dece852edcff0d1119463711249bb7ef2
2018-10-31 22:56:41 -07:00
TreeHugger Robot
dd7ea7069d Merge "Use StringJoiner in InputMethodDebug" 2018-11-01 05:48:05 +00:00
Yohei Yukawa
5e46a66c6d Use StringJoiner in InputMethodDebug
This is a follow up CL to my previous CL [1], which added
InputMethodDebug#softInputModeToString().

It turns out that there is already a nice utility class
java.util.StringJoiner that can deal with delimiter when joining
multiple string tokens.

This CL also adds some simple unit tests for InputMethodDebug.

 [1]: I83f4795e95bc2e8ae325ad6e28d3a42317414e8d
      a468d70e5f

Bug: 118040692
Test: atest FrameworksCoreTests:com.android.internal.inputmethod.InputMethodDebugTest
Change-Id: I55fcdecee108b3e56bf7fd480d6f71de580dcbf6
2018-10-31 14:45:52 -07:00
Misha Wagner
7b1bb62f25 Merge "Add unit tests for ProcStatsUtil and ProcTimeInStateReader" 2018-10-31 16:20:23 +00:00
TreeHugger Robot
316902da9b Merge "Add get/setExtras to TextClassification" 2018-10-31 12:24:30 +00:00
Tony Mak
d6f3fb46c6 Add get/setExtras to TextClassification
Test: TextClassificationTest / TextClassifierValueObjectsTest

BUG: 118690735

Change-Id: I19dba3a3f6c1b14a871b33b9ffb94e0f4de58ac2
2018-10-30 18:38:50 +00:00
Adrian Roos
60f59298c7 WindowInsets: reimplement WindowInsets on top of Insets
Bug: 111829774
Test: atest WindowInsetsTest
Change-Id: Ic01c6cd46981af2e457c740c35b17c8cc9c8d25a
2018-10-30 19:09:03 +01:00
Misha Wagner
f268f1bda3 Add unit tests for ProcStatsUtil and ProcTimeInStateReader
Test: This is a test

Change-Id: I5d3b7150414572c7ffcdc891a13234ed2cf3e0e7
2018-10-30 15:34:07 +00:00
Misha Wagner
0c6b2afbf1 Merge "Add class to read per-thread CPU usage from proc filesystem" 2018-10-30 15:25:09 +00:00
Victor Chang
cd6edbde1c Fix FormatterTest#testFormatShortElapsedTime due to CLDR 34 change am: 8ac807e010 am: 857933bd2d
am: 2ef788b6cf

Change-Id: Ie7a66e3ccdb50e1092d8c3c7c724de9ed4956f36
2018-10-30 06:14:24 -07:00
Victor Chang
2ef788b6cf Fix FormatterTest#testFormatShortElapsedTime due to CLDR 34 change am: 8ac807e010
am: 857933bd2d

Change-Id: I39219b9c358bbc6a4aa80cfb68a2415c81bf31a6
2018-10-30 05:47:11 -07:00
Victor Chang
857933bd2d Fix FormatterTest#testFormatShortElapsedTime due to CLDR 34 change
am: 8ac807e010

Change-Id: Id817a7c14047a1a4c6069791caab94c6e64f880e
2018-10-30 05:19:15 -07:00
Misha Wagner
566903ab47 Add class to read per-thread CPU usage from proc filesystem
Reads all thread CPU usage for the current process. This traverses
"/proc/self/task/*/time_in_state" to gather the thread ID and CPU usage
of each child thread. Process name, thread name, and UID are also read from
"/proc" for interpretable data.

Bug: 111534779
Test: Unit test in CpuThreadProcReaderTest

Change-Id: I6c71dde1dfcc9bbb87d95baf0886f9da7a782299
2018-10-30 10:48:27 +00:00