Commit Graph

16112 Commits

Author SHA1 Message Date
Hai Zhang
aedc3ab3cf Add RoleControllerManager.isApplicationVisibleForRole().
Settings doesn't actually need to know whether an application
qualifies for a role, but only whether the default app setting should
be visible for an application. Qualification and visibility differs in
cases such as FallbackHome inside Settings which is a qualifying home
activity but should never be shown in default apps UI.

Fixes: 138636320
Test: manual
Change-Id: I216195c64a7b106e2769b11c1a998741a77fdce2
2019-08-26 15:05:06 -07:00
Eran Messeri
756326e708 Merge "DPM key grant: Address API review" 2019-08-16 04:48:31 +00:00
Alex Light
74e8d3be48 Merge "Add agent startup-attach" 2019-08-15 16:00:53 +00:00
TreeHugger Robot
426b942eb1 Merge "Fixed SystemServiceRegistry to return a null AppPredictionManager when the service is not defined." 2019-08-15 07:36:07 +00:00
Eran Messeri
aad7ad4669 DPM key grant: Address API review
Split the single method for granting/revoking key access into two
methods.

Bug: 139091816
Test: cts-tradefed run commandAndExit cts-dev -m CtsDevicePolicyManagerTestCases -t com.android.cts.devicepolicy.MixedDeviceOwnerTest#testSetKeyGrant

Change-Id: I495f35419a5dd1c12e18703f11dd4216a310430d
2019-08-15 04:10:50 +01:00
Felipe Leme
6378bd40dd Fixed SystemServiceRegistry to return a null AppPredictionManager when the service is not defined.
Test: manual verification
Test: atest CtsAssistTestCases

Fixes: 139416391

Change-Id: Ieb2ae3f39bd42dc077ed3db1c6acdf429a39d519
2019-08-14 18:15:50 -07:00
Alex Light
330e8be604 Add agent startup-attach
Add ability to give 'startup-agents' that are automatically loaded
when a (debuggable) app starts. These agents are any files in the
'code_cache/startup_agents' directory. The agents are started with the
apps data_directory as an argument.

Test: Install debuggable apk (here com.antonioleiva.bandhookkotlin)
  walleye:/ $ run-as com.antonioleiva.bandhookkotlin sh
  walleye:/data/data/com.antonioleiva.bandhookkotlin $ mkdir code_cache/startup_agents
  walleye:/data/data/com.antonioleiva.bandhookkotlin $ cp /data/local/tmp/libtifasts32.so code_cache
  walleye:/data/data/com.antonioleiva.bandhookkotlin $ cp /data/local/tmp/libtifasts64.so code_cache
  walleye:/data/data/com.antonioleiva.bandhookkotlin $ cp /data/local/tmp/libchainagentss32.so code_cache/startup_agents/
  walleye:/data/data/com.antonioleiva.bandhookkotlin $ cp /data/local/tmp/libchainagentss64.so code_cache/startup_agents/
  walleye:/data/data/com.antonioleiva.bandhookkotlin $ echo $PWD/code_cache/libtifasts32.so=log,ClassLoad > chain_agents.txt
  walleye:/data/data/com.antonioleiva.bandhookkotlin $ echo $PWD/code_cache/libtifasts64.so=log,ClassLoad >> chain_agents.txt
  Start bandhookkotlin
  Examine logcat

Bug: 135627501

Change-Id: Ib82b27df90c7964a995288d8b2b3d348a11cdd80
(cherry picked from commit c0fce111c8b7c68ddb397ac7c65ac5c35a40da01)
2019-08-14 15:32:12 -07:00
Roshan Pius
07820f85ac Merge changes from topic "wifi_mainline_apk_separation"
* changes:
  Sysui/WifiTracker: Changes to support late starting wifi service
  WifiManager: Retrieve IWifiManager service lazily
  WifiStackClient: Register wifi API services from system_server
  Mainline wifi stack module
  NetworkStackClient: Refactor network stack process interaction
2019-08-14 19:33:10 +00:00
Prabir Pradhan
e83475885e Merge "apply empty transaction in startActivitySync" into qt-dev am: f928b661d9 am: 5cd874d792 am: fa6f50e13d
am: a47f176420

Change-Id: I0fdeaac8c1892faa833e79807f77417b55a906fe
2019-08-14 02:14:15 -07:00
Prabir Pradhan
a47f176420 Merge "apply empty transaction in startActivitySync" into qt-dev am: f928b661d9 am: 5cd874d792
am: fa6f50e13d

Change-Id: I30338c95c5ea27b191b20decdcf78cbe240b62c0
2019-08-14 02:00:18 -07:00
Prabir Pradhan
fa6f50e13d Merge "apply empty transaction in startActivitySync" into qt-dev am: f928b661d9
am: 5cd874d792

Change-Id: I9c9ac83d6466c1d9c5ac666cfcfe0920b276ffdc
2019-08-14 01:53:13 -07:00
Prabir Pradhan
5cd874d792 Merge "apply empty transaction in startActivitySync" into qt-dev
am: f928b661d9

Change-Id: Ic4b27be6729a3a7627a8fc499cd99fdec42cad35
2019-08-14 01:40:41 -07:00
Pinyao Ting
07c8797b2b Merge "fixes a security vulnerability in slice provider" into qt-qpr1-dev am: 69018b0325
am: ba45d8a844

Change-Id: Ib49c2db719de41ff1e27a676964d0ca9a070f689
2019-08-13 11:33:52 -07:00
Pinyao Ting
ba45d8a844 Merge "fixes a security vulnerability in slice provider" into qt-qpr1-dev
am: 69018b0325

Change-Id: Ibd5810c49a728b297751891006da35f09c6975b1
2019-08-13 11:20:04 -07:00
Minche Li
5f69c2ed0d Merge "Support A11y button on multi-display" 2019-08-13 01:14:31 +00:00
Pinyao Ting
2b415a4c44 fixes a security vulnerability in slice provider
Bug: 138441555
Test: Manual
Change-Id: Ib1b4fba54ebd3599fe11021d21dc9b09d34e8965
2019-08-13 00:25:33 +00:00
Makoto Onuki
3fedfcb409 Merge "Introduce framework-minus-apex and create jobscheduler-framework.jar" 2019-08-12 18:49:51 +00:00
Makoto Onuki
62242c48e0 Introduce framework-minus-apex and create jobscheduler-framework.jar
Bug: 137763703
Test: Clean local build + "flash -w" and boot
Test: Presubmit
Test: atest CtsJobSchedulerTestCases
Test: ./cts/tests/signature/runSignatureTests.sh
Change-Id: Ie2a5a7a17f903ac18de0bcdde5be25311a62fa01
2019-08-12 18:11:57 +00:00
Roshan Pius
2161b39d38 WifiManager: Retrieve IWifiManager service lazily
Wifi services will be initialized a little later in the bootup sequence
because it is now a separate APK. So, retrieve wifi services lazily
(on the first method call on the object).
This will alleviate the need to modify all the clients which instantiate
WifiManager very early in the bootup sequence (Sysui, some vendor apps,
etc).

Bug: 137374831
Test: Device boots up & connects to wifi networks.
Change-Id: I8e1f0eb3a5a8fdb79b088447fbb9f97413f64483
Merged-In: I8e1f0eb3a5a8fdb79b088447fbb9f97413f64483
2019-08-12 09:04:11 -07:00
Jing Ji
a736da8213 Add RSS to dumpsys meminfo
Include the RSS info into the meminfo output of dumpsys and
incident_report.

Bug: 117880513
Test: adb shell dumpsys meminfo
Test: cts-tradefed run cts-dev --module \
      CtsIncidentHostTestCases --test \
      com.android.server.cts.MemInfoIncidentTest
Change-Id: Id1058e279b7ca6925b59a6a523e0f0d14d830761
2019-08-09 22:57:50 +00:00
Makoto Onuki
7c730311ea Merge "Remove build time dependency from BatteryStats to JobParameters" 2019-08-09 20:38:34 +00:00
lumark
290d6f3546 DO NOT MERGE: Fix ActivityView surface can't visible for ActivityViewTest
am: dc9b319039

Change-Id: Iedaebd2888f402e382a4eaf0d7385df2c17d0bdd
2019-08-09 07:48:32 -07:00
lumark
dc9b319039 DO NOT MERGE: Fix ActivityView surface can't visible for ActivityViewTest
CL [1] introduced ActivityView's surface view set alpha as zero by default.
but SurfaceView ignores alpha value by default.

So to archieve SurfaceView can support alpha value and then introduced CL[2].
with that CL, it will affect ActivityView that can't see the surface because
of this zero alpha value.

Since CLs[1] & [2] are mainly considered for BubbleController to implement
content visiblity with setting surface view's alpha value without
flickering, and in BubbleExpandedView#onFinishInflate has already
called setContentVisibility(false) to set ActivityView's alpha value as
zero before add this view.

So removing ActivityView's default zero alpha value would be fine, since
it may not always the case that need to set zero alpha but need to show
the black rectangle surface for user. (i.e. ActivityViewTest or Android Auto)

Also, refined ActivityView#setAlpha for some stuff to make it clear.

[1]: Ie5aed373996419b059935889b564ca91c2e3cf23
[2]: I86847de59109b2adf12a2c7c50c988c2cbcf0450

Bug: 137937105
Test: manual as below steps
      1) make & install ActivityViewTest
      2) launch "AV Main" shortcut
      3) press "Test ActivityView" -> "Launch test activity"
      4) see if launched Acitvity is visible as expected.
Test: atest ActivityViewTest, observe if ActivityView is visible during testing.

Change-Id: Iaf480912f06a6851001a42bf90e4d962c8a88a37
2019-08-09 14:26:12 +00:00
Issei Suzuki
94e8d116ab DO NOT MERGE: Support alpha value in SurfaceView.
For backward compatibility, SurfaceView ignores alpha value by
default. In order to reflect alpha value set on the SurfaceView
to its underlying surface, setUseAlpha() needs to be called.

Translucent alpha only works when the surface is placed z-above.
Otherwise only fully opaque and transparent status are supported.

Bug: 137937105
(Orignal bug from b/130442248)
Test: Manual, use BubblesTest app and checks if alpha is set.
Change-Id: I86847de59109b2adf12a2c7c50c988c2cbcf0450
2019-08-09 14:08:03 +00:00
Makoto Onuki
9111d1dcec Remove build time dependency from BatteryStats to JobParameters
In preparation of moving the jobscheduler framework code to its
own jar.

Bug: 138793378
Test: dumpsys batterystats  -c | grep jbc and make sure the line looks correct

Change-Id: I9938c99e37bd44e522e5f8d8e95772e69d5be492
2019-08-08 15:33:37 -07:00
TreeHugger Robot
893735c812 Merge "Fixes usage of WallpaperManager to make it optional." 2019-08-08 20:34:01 +00:00
Charles Chen
635fcc218b Add max target sdk for LocalActivityManager
Test: build and presubmit
Bug: 137825207
Change-Id: I30ca8a966e26bd8394e4f9bb0374b360d064673c
2019-08-08 18:16:59 +08:00
TreeHugger Robot
e1025e8228 Merge "Add max target sdk for ActivityGroup related APIs" 2019-08-08 10:03:37 +00:00
Felipe Leme
34a861add1 Fixes usage of WallpaperManager to make it optional.
As the main javadoc states:
"An app can check whether wallpapers are supported for the current user,
by calling {@link #isWallpaperSupported()}, and whether setting of
wallpapers is allowed, by calling {@link #isSetWallpaperAllowed()}."

Test: manual verification on automotive
Test: atest CtsAppTestCases:android.app.cts.WallpaperManagerTest # on automotive

Bug: 138939803

Change-Id: I88946f92ff54e556d289c41c28e22da3a4b8c8b8
2019-08-07 21:08:52 +00:00
Prabir Pradhan
03dde38efc apply empty transaction in startActivitySync
Force SurfaceFlinger to update synchronously by applying an empty
transaction. Without this, SurfaceFlinger will only update after the
next vsync, which may only happen after the instrumentation already
starts.

Since InputFlinger will only have the proper InputWindowInfo after
SurfaceFlinger updates, waiting for the vsync caused some
instruemntation tests to be flaky.

Bug: 138263890
Test: atest android.view.cts.HoverTest
Change-Id: I5457ab67ac574530dc1aa84549ca11e7e3f0d714
2019-08-07 12:59:01 -07:00
Vinit Nayak
e185ac2b8b Merge "Create general callback for changes to RecentTaskList" 2019-08-06 22:05:26 +00:00
TreeHugger Robot
da6b1ff949 Merge "Fix ActivityView surface can't visible for ActivityViewTest" 2019-08-06 21:22:22 +00:00
Kevin Hufnagle
ac971c2c1c Merge "docs: Clarified when onRestoreInstanceState() executes" into qt-dev am: c80fe63001 am: ad1de8fbe4 am: 0f27f04f9b
am: 7130f7ed6b

Change-Id: Icd331ef8ed5fa1a2925b621d6670140aa03d7c09
2019-08-06 09:45:11 -07:00
Kevin Hufnagle
7130f7ed6b Merge "docs: Clarified when onRestoreInstanceState() executes" into qt-dev am: c80fe63001 am: ad1de8fbe4
am: 0f27f04f9b

Change-Id: Ibafe22878438e3f1ce176647a3ba07544d753dbf
2019-08-06 09:38:01 -07:00
Kevin Hufnagle
0f27f04f9b Merge "docs: Clarified when onRestoreInstanceState() executes" into qt-dev am: c80fe63001
am: ad1de8fbe4

Change-Id: I22a8b72e89aef3063c3f2b40e6d1f58c7155a7e8
2019-08-06 09:23:03 -07:00
Kevin Hufnagle
05ad21feaf Merge "docs: Clarified when onRestoreInstanceState() executes" into qt-dev am: c80fe63001
am: ad1de8fbe4

Change-Id: I0f33586ecb3b8f7e6cfa91dac274f9b384428495
2019-08-06 09:22:59 -07:00
Kevin Hufnagle
ad1de8fbe4 Merge "docs: Clarified when onRestoreInstanceState() executes" into qt-dev
am: c80fe63001

Change-Id: I332332fc88e565a3842297b04769778ee1c344ca
2019-08-06 09:09:56 -07:00
lumark
3f51e3cfd4 Fix ActivityView surface can't visible for ActivityViewTest
CL [1] introduced ActivityView's surface view set alpha as zero by default.
but SurfaceView ignores alpha value by default.

So to archieve SurfaceView can support alpha value and then introduced CL[2].
with that CL, it will affect ActivityView that can't see the surface because
of this zero alpha value.

Since CLs[1] & [2] are mainly considered for BubbleController to implement
content visiblity with setting surface view's alpha value without
flickering, and in BubbleExpandedView#onFinishInflate has already
called setContentVisibility(false) to set ActivityView's alpha value as
zero before add this view.

So removing ActivityView's default zero alpha value would be fine, since
it may not always the case that need to set zero alpha but need to show
the black rectangle surface for user. (i.e. ActivityViewTest or Android Auto)

Also, refined ActivityView#setAlpha for some stuff to make it clear.

[1]: Ie5aed373996419b059935889b564ca91c2e3cf23
[2]: I86847de59109b2adf12a2c7c50c988c2cbcf0450

Bug: 137937105
Test: manual as below steps
      1) make & install ActivityViewTest
      2) launch "AV Main" shortcut
      3) press "Test ActivityView" -> "Launch test activity"
      4) see if launched Acitvity is visible as expected.
Test: atest ActivityViewTest, observe if ActivityView is visible during testing.

Change-Id: Iaf480912f06a6851001a42bf90e4d962c8a88a37
2019-08-06 23:22:56 +08:00
Jorim Jaggi
5534e159c1 Merge "Fix overlapping remote and recents animations" into qt-r1-dev am: b248a0343f am: dd40a0c75a
am: c7b3ff1c52

Change-Id: Iaba42814773ab7333aae3fbc90d3bbd2ea8bac87
2019-08-05 12:01:12 -07:00
Jorim Jaggi
c7b3ff1c52 Merge "Fix overlapping remote and recents animations" into qt-r1-dev am: b248a0343f
am: dd40a0c75a

Change-Id: Ia9361be8e0040303ab397e718e055193409624cf
2019-08-05 11:50:14 -07:00
Jorim Jaggi
dd40a0c75a Merge "Fix overlapping remote and recents animations" into qt-r1-dev
am: b248a0343f

Change-Id: I103ff225bbf69e6945cb90430130ae233dd6cb9f
2019-08-05 11:39:05 -07:00
Jorim Jaggi
f76a0f8376 Merge "Fix overlapping remote and recents animations" into qt-r1-dev
am: b248a0343f

Change-Id: I65a0859aa03247262767107f3525b2b7490b5eb8
2019-08-05 11:39:03 -07:00
TreeHugger Robot
7682e5d196 Merge "DPM: Add API for granting apps access to keys" 2019-08-05 17:48:43 +00:00
Jorim Jaggi
589c5ba0fa Fix overlapping remote and recents animations
Test: Open app and immediately swipe up while opening. Verify
Thread prioties in systrace

Test: WindowProcessControllerTests
Fixes: 137881181
Change-Id: Ic1d7403d2a648e6f1d1b6a3d55b56bf37bc57a2c
2019-08-05 17:10:18 +02:00
Jeff Sharkey
3a5492c398 Merge "Enable stricter SQLiteQueryBuilder options." 2019-08-04 14:23:36 +00:00
Kevin Hufnagle
4fbcec13a0 docs: Clarified when onRestoreInstanceState() executes
This method executes only after onDestroy() is called.

Change-Id: I4880cc98ea08945f30b16baa7ae400a5bbe3e439
Test: make ds-docs
Bug: 136241777
2019-08-02 15:43:33 +00:00
Eran Messeri
49ed3232cf DPM: Add API for granting apps access to keys
Add a DevicePolicyManager method for granting (or revoking) access to a
key for a specific package.

This prevents apps from having to call KeyChain.choosePrivateKeyAlias to
get a grant for the alias.
The motivation for this change is that apps that run as a background
service do not have an Activity to pass into
KeyChain.choosePrivateKeyAlias any more as they are not allowed to
interact with users.
That creates a situation where even though the Device Policy Client
would silently grant the requesting app access to a KeyChain key, the
app still has to provide an Activity.

With this change, the DPC can pre-grant the app access to a key such
that the app does not need to call KeyChain.choosePrivateKeyAlias and
can instead just call KeyChain.getPrivateKey

BUG: 137921026
Test: atest CtsDevicePolicyManagerTestCases:com.android.cts.devicepolicy.MixedDeviceOwnerTest#testSetKeyGrant
Change-Id: I37a75e1f802e223740eb41f055224baba9aa3b3a
2019-08-02 10:52:41 +01:00
Artur Satayev
70507ed5a1 Add @UnsupportedAppUsage annotations for max-p.
See go/UnsupportedAppUsage for more details.

These have already been greylisted, however due to bugs/omissions in the tooling have been kept in go/greylist-txt instead of being annotated in the code.

Exempted-From-Owner-Approval: Mechanical changes to the codebase
which have been approved by Android API council and announced on
android-eng@

Bug: 137350495
Test: m
Change-Id: I5aa29a49b193db47aaee4d3a756c17f48cc9f0b1
2019-08-01 19:46:29 +01:00
Charles Chen
5c0943dbb0 Add max target sdk for ActivityGroup related APIs
Test: build and presubmit
Bug: 137825207
Change-Id: Ie3125743b46e785bf3f5655518e5634da2f578b0
2019-08-01 10:51:22 +08:00
TreeHugger Robot
cf141432db Merge "Add logs for debugging IME onConfigurationChanged" 2019-07-31 13:42:14 +00:00