Commit Graph

20087 Commits

Author SHA1 Message Date
Hongming Jin
83e162615f Enforce permission check before returning application info
Test: atest CtsAppSecurityHostTestCases:ApplicationVisibilityTest
Bug: 77821568

Change-Id: I7554805c36c0c2552163dad7b07cfc5f552b624e
2018-05-31 17:20:14 -07:00
Todd Kennedy
ef9acb6ed9 Ensure permission held for MATCH_KNOWN_PACKAGES
There's an escape clause that passes the cross user permissions
if the caller UID is identical to the target user ID [eg. we're not
operating across users]. However, the method getInstalledPackagesList()
uses android.permission.INTERACT_ACROSS_USERS to filter the results and
a calling UID check is not sufficient. Ensuure the permission is
actually held, regardless of the calling UID or target user.

Change-Id: Iebf88668766d387a15246d6eea6420610665105a
Fixes: 80435086
Test: atest CtsAppSecurityHostTestCases:ApplicationVisibilityTest
2018-05-30 13:56:17 -07:00
Wale Ogunwale
30eab1f430 Added TestApi to ActivityInfo.isTranslucentOrFloating
This would be use to determine the right activity state during CTS
test for products that have windowSwipeToDismiss set.

Also, dump ActivityRecord.fullscreen to proto for the same reason.

Bug: 76207986
Bug: 79167358
Test: atest CtsActivityManagerDeviceTestCases:ActivityLifecycleTests
Test: atest CtsActivityManagerDeviceTestCases:ActivityManagerAssistantStackTests
Change-Id: Iadc088e9129be088b8a083ebbafd8d20fe26b673
2018-05-25 10:24:14 -07:00
David Chen
f94b4936b4 Marks deprecated StatsManager APIs.
Marking some API's as deprecated, so users avoid getting confused.

Test: Test that build works.
Bug: 80099023
Change-Id: I4b3d4e4fa1ee3d706e49b8180aa4d0ad0e7d6eeb
2018-05-21 17:40:56 -07:00
Svet Ganov
6b03aa76e9 Make RemoteCallback test API
Test: manual

bug:79782915

Change-Id: I61343573428333c0d4a9ee2523c444753280186c
2018-05-21 15:55:28 +00:00
Jeff Sharkey
8e6445a1a5 Merge "Let tests enumerate all transports/capabilities." into pi-dev 2018-05-15 15:17:30 +00:00
Jeff Sharkey
a5ee62f356 Let tests enumerate all transports/capabilities.
This gives them a way to collect all included values without
resorting to manual probing of each newly added value.

Bug: 16207332
Test: atest com.android.cts.net.HostsideVpnTests
Change-Id: I35ca412512dc8515b44d5518e1ca4caa5bdc678f
2018-05-14 17:17:33 -06:00
Hall Liu
c1d95aad1a Add CallAudioState ctor as TestApi
Needed for CTS testing

Bug: 79528185
Test: CTS
Change-Id: Iad154257a93cc776d5800527e46e777fd6c88220
2018-05-11 17:14:58 -07:00
TreeHugger Robot
689866352b Merge "add install action for carrier id to system API" into pi-dev 2018-05-09 22:47:40 +00:00
fionaxu
2776ed56b8 add install action for carrier id to system API
Bug: 79426800
Test: Manual
Change-Id: Icd3e9ae527dc17ab5762aa57df596f058de08d5b
2018-05-08 15:25:40 -07:00
Dianne Hackborn
330dd0b244 Merge "Make android:cantSaveState an optional feature." into pi-dev 2018-05-08 17:59:32 +00:00
Tyler Gunn
872a039ab3 Merge "Make TelecomManager#endCall a public API." into pi-dev 2018-05-08 04:01:35 +00:00
Dianne Hackborn
c8e4fad862 Make android:cantSaveState an optional feature.
This doesn't make sense on things like watches and appliances,
so make this an optional feature that the device must enable.
If the feature is not set, then the system will ignore
the app's request.

Bug: 76213401
Test: atest CtsAppTestCases:ActivityManagerProcessStateTest
Change-Id: I91abf9d86ec14fa632e3bcc83c4a3febade5d2e4
2018-05-07 15:01:57 -07:00
Tyler Gunn
e1aa26c744 Make TelecomManager#endCall a public API.
A broad category of apps such as wearable companion apps and call blocking
apps rely on the ability to reject a ringing call.
Previously this was achieved using a broken TelephonyManager API which
lacked permission checks.
To support these applications, removing the @hide attribute on the existing
TelecomManager#endCall API so that apps with the existing
ANSWER_PHONE_CALLS permission can reject ringing calls and end ongoing
calls.  Logically if an app has permission to answer a call, it should be
able to end it.

Test: Created test app to verify API permission checks.
Test: Added new CTS tests to cover this API.
Bug: 78290258
Change-Id: Ic6527969793ebe05eb9c5fa8205558ae788ea572
2018-05-02 13:23:48 -07:00
Dianne Hackborn
ed23b9b12c Fix issue #78230210: Strobe: Need separate runtime permission group for READ_CALL_LOG and WRITE_CALL_LOG
Bug: 78230210
Test: manual
Change-Id: Ie5a0ab3dffd40dc44f7aa5deb81b42fbc2dbd406
2018-05-01 14:00:34 -07:00
goneil
f6c6e8efa7 Added test API to refresh the UICC Profile
Bug: 74016670
Test: GTS tests - vendor/xts/gts-tests/hostsidetests/simappdialog
Change-Id: I8f8ffdad8666d523172b035d24b96278d4d1a1ee
2018-04-25 18:19:42 -07:00
Lorenzo Colitti
a09c06a6c1 Merge "Actually @hide unwanted capability methods." into pi-dev 2018-04-24 21:20:25 +00:00
Lorenzo Colitti
19c0ccaa8c Actually @hide unwanted capability methods.
Bug: 77601789
Test: builds, boots
Test: make doc-comment-check-docs
Change-Id: I7a913b83ab5110047d187564b3a1b0bbe1631942
2018-04-24 13:12:56 +09:00
Jeff Sharkey
c3c8d16380 Give CTS a way to force-poll network stats.
Collecting network statistics is pretty heavy, which is why we're
throttling callers.  However, to keep CTS running fast, we provide a
way for tests to force a poll event, instead of making them wait for
the throttle timeout.

Bug: 77908520
Test: atest cts/tests/tests/app.usage/src/android/app/usage/cts/NetworkUsageStatsTest.java
Change-Id: Ia792f0cd495023366ff8c4839df54e7da2ae8331
2018-04-20 12:18:23 -06:00
Dan Gittik
26b030d829 Fixed power manager CTS test.
Added an annotation necessary to allow the power manager CTS test to
access the non-public method nap.

Test: adb install -r \
      out/host/linux-x86/cts/android-cts/testcases/CtsOsTestCases.apk
      adb shell am instrument -e class android.os.cts.PowerManagerTest \
      -w android.os.cts/android.support.test.runner.AndroidJUnitRunner

Change-Id: Ida939f074654bef351e2b8fd563c8463431ce9c6
Fixes: 77907164
2018-04-16 18:50:10 +01:00
Wale Ogunwale
3da5f3b2dd Finalizing P SDK
Bug: 77588754
Test: builds
Change-Id: Ic06cad790a3dc53d012a7c43dfac911fc6dc61e7
2018-04-12 15:26:31 -07:00
Jeff Sharkey
1df7ee5757 Remove poorly defined notification APIs.
They were rushed in at the last second, and feedback from stakeholders
reveals they're not ready for prime time.

Bug: 77851691
Test: builds, boots
Exempt-From-Owner-Approval: SDK finalization
Change-Id: I96f6c80610627878a29543b345419924774a60e0
2018-04-12 18:27:08 +00:00
Wale Ogunwale
fb10508cfa Merge "Clean up APIs before declaring API 28." into pi-dev 2018-04-12 12:19:56 +00:00
Phil Weaver
99a238adf1 Merge "Move accessibilityHeader from TextView to View" into pi-dev 2018-04-12 03:07:57 +00:00
TreeHugger Robot
ba6f173cb1 Merge "Add API to compute charge time remaining." into pi-dev 2018-04-12 00:27:53 +00:00
TreeHugger Robot
f0b9fbebc0 Merge "APIs to disable data usage notifications." into pi-dev 2018-04-11 23:05:03 +00:00
Michael Wright
928167e044 Add API to compute charge time remaining.
This is so unbundled applications (e.g. dreams) can present a charge
time indicator that is in sync with the rest of the system.

Bug: 77919650
Test: manual
Change-Id: I7d62dea4fd49eb173b4f052a0fc36f4e7ce5b6bb
2018-04-11 23:47:31 +01:00
Jeff Sharkey
0a5570d49d APIs to disable data usage notifications.
Certain carriers have requested the ability to disable the warning,
limit, and rapid data usage notifications shown by the OS, so give
them that ability on a per-subId basis.  (The notifications are still
enabled by default.)

Unhide NOT_CONGESTED to match setSubscriptionOverrideCongested().

Fix bug in getPrimarySubscriptionPlanLocked() to find the first
currently active plan; the first non-recurring plan may be no longer
active.  Fix bug in SubscriptionPlan which allowed invalid negative
or zero-length Period objects.

Bug: 77851691, 77506882, 77662747
Test: atest com.android.server.NetworkPolicyManagerServiceTest
Test: atest android.telephony.cts.SubscriptionManagerTest
Exempt-From-Owner-Approval: SDK deadline, responding to API feedback
Change-Id: Ib6e6dbadd5022937c3f0661ab4b66aa617f0b5af
2018-04-11 22:07:40 +00:00
Hall Liu
d41e669fca Merge "Make setServiceId a TestApi" into pi-dev 2018-04-11 20:21:48 +00:00
Jeff Sharkey
3990ee1c9f Clean up APIs before declaring API 28.
As part of finalizing an SDK, we need to ensure that no new APIs are
marked @Deprecated, since they're typically cleanup that someone
forgot to finish.

Someone forgot to replace Slice.getTimestamp() with Slice.getLong().

Bug: 77588754
Test: builds, boots
Exempt-From-Owner-Approval: SDK finalization
Change-Id: Ic0ec91a43d161a69c1e840c42046ad500b7aeca0
2018-04-11 13:49:21 -06:00
Daniel Cashman
960a0c6c57 Merge "Add SigningInfo class to expose package signing details." into pi-dev 2018-04-11 19:21:07 +00:00
TreeHugger Robot
10fb6582eb Merge "DO NOT MERGE - Hide IWLAN system API" into pi-dev 2018-04-11 18:36:31 +00:00
TreeHugger Robot
98831af78b Merge "Mark CTS-tested APIs as @TestApi" into pi-dev 2018-04-11 18:03:44 +00:00
TreeHugger Robot
fb052cc3c0 Merge "BufferingParams: add annotation @TestApi" into pi-dev 2018-04-11 18:01:24 +00:00
Nathan Harold
68e5f0f242 Merge "[DO NOT MERGE] - Hide Tunnel Mode IpSec API" into pi-dev 2018-04-11 17:09:07 +00:00
TreeHugger Robot
6b317915e8 Merge "StatsManager throws exceptions" into pi-dev 2018-04-11 17:02:06 +00:00
Bo Zhu
4d1b57dad3 Merge "Add an API to check whether the recoverable keystore is enabled" into pi-dev 2018-04-11 15:58:27 +00:00
Florian Mayer
f1657a827f Merge "Address API comments on NetworkStats#getDefaultNetwork." into pi-dev 2018-04-11 13:55:51 +00:00
Lenka Trochtova
27fd8217c1 Hide mandatory backup's API.
Bug: 77801801
Bug: 73750212
Bug: 64012357

Test: make RunFrameworksServicesRoboTests
Test: cts-tradefed run cts -m CtsDevicePolicyManagerTestCases --test
com.android.cts.devicepolicy.DeviceOwnerTes
cts-tradefed run cts -m CtsBackupHostTestCase

Change-Id: I7699755309b3fbff7c3fec2a06a0f409fd4087de
2018-04-11 12:33:28 +02:00
Lorenzo Colitti
6dba3936a2 Address API comments on NetworkStats#getDefaultNetwork.
Bug: 76449091
Test: android.app.usage.cts.NetworkUsageStatsTest passes
Change-Id: I7f21e0bd7bc4b726058fc2e25542ff2c3173fabe
2018-04-11 10:11:12 +00:00
TreeHugger Robot
2188383b8a Merge "Review of suspend/unsuspend APIs" into pi-dev 2018-04-11 07:36:38 +00:00
TreeHugger Robot
555767b616 Merge "API Review: Rename getStandbyBucket to getAppStandbyBucket" into pi-dev 2018-04-11 02:38:26 +00:00
Nathan Harold
0486b927b3 [DO NOT MERGE] - Hide Tunnel Mode IpSec API
Hide the tunnel mode of the IpSec API because
there is a disincentive to launch it without
a supported customer use case. That use case,
IWLAN is having its APIs hidden, so we should
hide these as well to avoid constraining future
implementation.

Also, due to issues with the lifetime of the NATT
management object, this API needs to be hidden
until such time as the lifetime of the Keepalive
can be handled independently of the lifetime of
a Transform.

Bug: 72523623
Test: compilation (api removal)
Change-Id: I076030bdbab1cd7d69f6a034577d529970b050dc
2018-04-10 19:24:07 -07:00
Bookatz
4f71629002 StatsManager throws exceptions
When StatsManager fails to connect to statsd, it now throws an exception
for the caller to catch. It also throws an exception of the config being
added is of an unreadable format.

Due to backwards compatibility issues, the old APIs could not be
changed, so new ones were made to replace the old ones. The old ones are
now temporary and will be removed when the compatibility issue is
resolved.

Bug: 77648233
Test: gts-tradefed run gts-dev --module GtsStatsdHostTestCases
Change-Id: Ibea05883a29b9b3ef9927d2f8fe295eb99832ab7
2018-04-10 19:07:32 -07:00
Phil Weaver
11fa71845b Move accessibilityHeader from TextView to View
I put it on TextView to try to scope it as narrowly
as possible, but an ImageView could be a heading, as
could a LinearLayout that holds a TextView (like a
preference).

Bug: 77726494
Test: atest CtsAccessibilityServiceTestCases
Change-Id: I9313ce6de25b5893db450f23499b151a4f08afda
2018-04-10 17:59:03 -07:00
Suprabh Shukla
96212bca06 Review of suspend/unsuspend APIs
Clarified the package extras bundle returned from
getSuspendedPackageAppExtras.
Moved the bundle arg to the last in LauncherApps.onPackagesSuspended and
clarified the contents of the Bundle.
isPackageSuspended(String) now throws a NameNotFoundException if the
package is not found.
Also, removed a permission check from isPackageSuspendedForUser.

Test: builds, boots, existing tests:
atest com.android.server.pm.SuspendPackagesTest

Bug: 77518983, 77517955, 77507744, 77801528
Change-Id: I06b5f69f8f8a079c206863cb6122e90be58366cd
2018-04-10 17:34:12 -07:00
Jason Monk
2d3932eb4d List<SliceSpec> -> Set<SliceSpec>
Test: update-api
Bug: 73123786
Change-Id: I5668023eda0efcadf40a20259a92624e6680659f
2018-04-10 20:25:51 -04:00
Jack Yu
a7025bae0a DO NOT MERGE - Hide IWLAN system API
Hide IWLAN system API for P. Will expose those APIs when IWLAN
full mode support is in place.

Test: Telephony sanity tests
Bug: 64132030
Change-Id: Ic56a04538fc532a7326c8a9234182899d52f15c1
2018-04-10 17:15:31 -07:00
Shawn Willden
13e230f5d6 Mark CTS-tested APIs as @TestApi
Bug: 77596526
Test: Keystore CTS
Change-Id: Ic4280db3d9ff093138f0a361ac6a52ca69187cca
2018-04-10 18:15:22 -06:00
Jason Monk
9107b53c6d Merge "Revert "List<SliceSpec> -> Set<SliceSpec>"" into pi-dev 2018-04-11 00:00:26 +00:00