Commit Graph

15116 Commits

Author SHA1 Message Date
TreeHugger Robot
5ee812a499 Merge "Update #registerAppUsageLimitObserver to accept time remaining." 2019-03-04 23:00:22 +00:00
Zak Cohen
28bfe37108 Merge "ContentSuggestions - mark request builder returns as NonNull." 2019-03-04 19:33:09 +00:00
Zak Cohen
5749c76b11 Merge "ContentSuggestions - make extras in request @NonNull." 2019-03-04 19:33:03 +00:00
TreeHugger Robot
b1b4a4fc14 Merge "Improve documentation of secure lock screen feature." 2019-03-04 19:08:56 +00:00
Varun Shah
9f58b7c007 Update #registerAppUsageLimitObserver to accept time remaining.
UsageStatsManager#registerAppUsageLimitObserver now accepts the time
remaining in addition to the total time limit.

The API now also uses java.time.Duration instead of long+TimeUnit for
the total time and remaining time.

Bug: 124272203
Test: atest FrameworksServicesTests:AppTimeLimitControllerTests
Test: atest android.app.usage.cts.UsageStatsTest#testObserveUsagePermissionForRegisterObserver
Test: atest android.app.usage.cts.UsageStatsTest#testObserveUsagePermissionForUnregisterObserver
Test: manual (mmma frameworks/base/tests/UsageStatsTest/)
Change-Id: I6f85ca9295cad46e10a30035b67e6210ae5c1886
2019-03-04 19:06:32 +00:00
Svetoslav Ganov
2a980300bc Merge "Slice and dice app ops - framework" 2019-03-04 17:22:20 +00:00
Andrei-Valentin Onea
52f7220a06 Merge "Add @UnsupportedAppUsage annotations" 2019-03-04 12:42:01 +00:00
Julia Reynolds
10b6c6d10e Merge "Add @Nullable and @NonNull to new Notification API" 2019-03-03 21:07:47 +00:00
Svet Ganov
af189e3371 Slice and dice app ops - framework
Appops can be peformed by an app on its behalf and also on
behalf of another app, i.e. an app can perform a proxy op
and blame the work on another app. The proxy mechanims is
for apps doing work on behalf of other apps where GCore is
one example since the app doing the work needs to check if
the caller has access to the functionality - specifically
the app op backing a runtime permission in case the calling
app does not support runtime permissions.

Apps being able to blame work on other apps is a problem now
that we would be using historical op data to show permission
usage in the UI as apps can start blaming each other to gain
a competitive advantage.

To address the issue we are adding APIs for querying portions
of the app op data - last and historical. One can now get
the ops for work the app did for itself, work the app blamed
on other apps if the app is trusted, work the app blamed on
other apps if the app is not trusted, work other trusted apps
blamed on the app, work other untrusted apps blamed on the app.
A trusted app is one holding the permisison to update app op
stats which is privileged.

The data slicing API allow us to show in the UI only the trusted
poriton of the data which is work the app did for itself, work
trusted apps balmed on the app, and work the app if untrusted
blamed on other apps.

Test: atest CtsAppOpsTestCases

bug:111061782

Change-Id: I9a2bcaea272cb06f38ba742cf601a6dc3b287d5e
2019-03-01 21:12:16 -08:00
Philip P. Moltmann
7821931e53 Make noteProxyOpNoThrow(String,String,int) public
This is needed for proxing while not inside of a IPC.

Test: m -j update-api
Fixes: 126434248
Change-Id: I8dde23824b91acfae57ed86ef6871d82c8617193
2019-03-01 17:04:19 -08:00
Zak Cohen
c0fe567e6e ContentSuggestions - make extras in request @NonNull.
Bug: 124506692
Test: build, annotation change
Change-Id: Ieae1c8a141bf3ab92f85a0fd3c58044da3ae18f0
2019-03-01 22:13:12 +00:00
Zak Cohen
d61093e381 ContentSuggestions - mark request builder returns as NonNull.
Test: Built, doc change only
Bug: 126701487
Bug: 126701195
Bug: 126699096
Change-Id: I0daea121e4442d3f2a8ef027e5bef27235ee7118
2019-03-01 22:09:35 +00:00
TreeHugger Robot
abc2a7d55c Merge "Mark role related APIs as test API." 2019-03-01 18:23:06 +00:00
Jeff Sharkey
9e8f83db6d All Parcelable CREATOR fields are @NonNull.
If they were null, then the Parcelable would fail to work.

Bug: 126726802
Test: manual
Change-Id: I7929ffa2f20e5de1c8e68e8263cca99496e9d014
Exempt-From-Owner-Approval: Trivial API annotations
2019-02-28 23:29:04 -07:00
Jeff Sharkey
416d46234c Intercept unlink(), remove(), and rename().
Handles cases where apps try deleting paths returned in "_data"
columns, and where they try renaming across bind mounts.

Bug: 124349250
Test: atest android.appsecurity.cts.ExternalStorageHostTest#testExternalStorageRename
Change-Id: I7f4461bcacada80398eb95d051a0d29456f63499
2019-03-01 06:25:24 +00:00
TreeHugger Robot
a88d34bfa7 Merge "Fixed PASSWORD_COMPLEXITY_HIGH javadoc to require complex PIN of length at least 8" 2019-03-01 02:55:04 +00:00
Andrii Kulian
2ea06cd77a Merge "Report top resumed state only after previous activity lost it" 2019-03-01 02:01:38 +00:00
Chavi Weingarten
59f3a3d882 Merge "Change Instrumentation to call injectInputAfterTransactionApplied" 2019-03-01 01:19:28 +00:00
Sudheer Shanka
279b81849d Merge "Mark COLUMN_MEDIASTORE_URI as @TestApi." 2019-03-01 01:04:11 +00:00
TreeHugger Robot
a0a47c4426 Merge "Add @RequiresPermission and fix API naming" 2019-03-01 01:00:43 +00:00
TreeHugger Robot
6966b8e739 Merge "Annotate Notification.Builder methods with @NonNull." 2019-02-28 23:59:24 +00:00
TreeHugger Robot
432c55a613 Merge "Change trace message to reflect the show/hide state" 2019-02-28 23:28:28 +00:00
Michael Wachenschwanz
17c7c791f5 Merge "Promote apps in the NEVER bucket on sync scheduled" 2019-02-28 22:52:02 +00:00
Evan Laird
ab196596fc Add @RequiresPermission and fix API naming
StatusBarManager#setDisabledForSetup() requires
android.Manifest.permission.STATUS_BAR, and is now documented that way.

Also rename areNoComponentsDisabled to areAllComponentsEnabled so it
reads better

Bug: 126376147
Test: atest GtsStatusBarHostTestCases
Change-Id: I59b113a2568463541dfbd46f505489aa94aac9d9
2019-02-28 17:32:30 -05:00
Sudheer Shanka
957954b67b Mark COLUMN_MEDIASTORE_URI as @TestApi.
Bug: 126395605
Test: atest cts/tests/app/src/android/app/cts/DownloadManagerTest.java
Change-Id: I727555d7b2a5812b2a802ea447c2d9b9d26c9572
2019-02-28 13:33:39 -08:00
TreeHugger Robot
8ecdef276f Merge "Add nullability to StatusBarManager#getDisableInfo" 2019-02-28 20:27:28 +00:00
Fabian Kozynski
867550ead5 Add @Nullable and @NonNull to new Notification API
Test: build
Fixes: 126699221
Fixes: 126700928
Fixes: 126701530
Change-Id: Ia06731cae10f5dbdf57d9557a797ccfe6aa460d7
2019-02-28 14:48:33 -05:00
Gustav Sennton
625bcab95f Annotate Notification.Builder methods with @NonNull.
To support Kotlin developers we here annotate all (non-deprecated)
public Notification.Builder methods with the @NonNull annotation.

Bug: 126699778
Test: N/A
Change-Id: I7ba56430bf2af8112d9be1bcbdd3601fb577543f
2019-02-28 19:19:23 +00:00
Evan Laird
2c4d0cfa93 Add nullability to StatusBarManager#getDisableInfo
Test: Builds
Fixes: 126701201
Change-Id: I9b6e92efbfd2fd8a191349d54d9b99a84e2ad675
2019-02-28 12:33:01 -05:00
Jeff Chang
ba7ad27960 Merge "Signal a rerouted callback if display was set to SingleTaskInstance" 2019-02-28 17:04:09 +00:00
Bernard Chau
e4bab18190 Fixed PASSWORD_COMPLEXITY_HIGH javadoc to require complex PIN of length at least 8
Bug: 111173457
Test: N/A. Just updating javadoc.

Change-Id: I4125d6ce511105a68db03fb3b51d68c914bcfdd6
2019-02-28 17:03:05 +00:00
Lenka Trochtova
cef704e172 Improve documentation of secure lock screen feature.
Add more a specific description of what methods do when the
secure lock screen feature is not supported by the device.

Bug: 123270501
Test: make

Change-Id: Ib6c16f421cf3dc60b0f0cb0c6335c6dc35ac7ece
2019-02-28 12:00:05 +01:00
TreeHugger Robot
79c8d6623b Merge "Add API Service.getForegroundServiceType()" 2019-02-28 01:48:02 +00:00
Ralston Da Silva
5bbfa09a94 Merge "Removing usage of unsupportedApi AutoCompleteTextView.ensureImeVisible from SearchDialog Bug: 124452405 Test: No CTS test because SearchDialog is not exposed externally." 2019-02-28 00:45:07 +00:00
Jeff Sharkey
4020f8c038 Merge "Translate SecurityException into EACCES." 2019-02-28 00:19:05 +00:00
chaviw
9f4bc55faf Change Instrumentation to call injectInputAfterTransactionApplied
Instrumentation.sendPointerSync currently calls direclty into
InputManager to inject input. Instead have it call
injectInputAfterTransactionApplied to ensure it waits for animations
to complete and input windows to get set.

Additionally, changed injectInputAfterTransactionApplied to call
InputManagerInternal instead of InputManager to prevent the calling pid
from changing. This ensures the permission check remains tied to the client
that injected the input.

Bug: 123616343
Bug: 120920331
Test: atest HoverTest
Change-Id: I8c893e47fea9bd38e92da0ffa668ebca066f1080
2019-02-27 15:54:24 -08:00
Jeff Sharkey
b50f51e604 Translate SecurityException into EACCES.
Gives more consistent experience for code expecting errno values.

Bug: 122092631
Test: atest cts/tests/tests/provider/src/android/provider/cts/MediaStore*
Change-Id: I74f27ae33adca69a563d9d8cfc4cf9bb186e1750
2019-02-27 13:55:42 -07:00
David Brazdil
33bd343596 Move ApplicationInfo to params in AppComponentFactory
Tweak AppComponentFactory.instantiateClassLoader() API to accept
ApplicationInfo as an argument instead of an independent getter.

Bug: 124800390
Bug: 111342996
Test: atest CtsClassLoaderFactoryPathClassLoaderTestCases
Test: atest CtsClassLoaderFactoryInMemoryDexClassLoaderTestCases
Change-Id: I4a4d5af842446a5060083c88a0ac5bec014c0c55
2019-02-27 20:15:18 +00:00
Jeff Chang
bf29986c54 Signal a rerouted callback if display was set to SingleTaskInstance
singleTaskInstance displays will only contain one task and any attempt
to launch new task will re-route to the default display. Signal a callback
for listeners to handle the case.

Bug: 123642392
Test: atest ActivityManagerMultiDisplayTests#testSingleTaskInstanceDisplay
Change-Id: I16b98d47a798f920a551942d761f07b1df1defc0
2019-02-27 17:33:45 +00:00
TreeHugger Robot
68463825b6 Merge "Inject long press documentation" 2019-02-27 15:46:43 +00:00
Andrei Onea
f650e3c286 Add @UnsupportedAppUsage annotations
For packages:
  android.app.admin
  android.app.backup
  android.app.job
  android.app.usage
  android.content
  android.content.om
  android.content.pm

This is an automatically generated CL. See go/UnsupportedAppUsage
for more details.

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

Bug: 110868826
Test: m
Change-Id: Id84ee490f3435a196fca10a89bda9f7217b750c6
2019-02-27 13:32:04 +00:00
TreeHugger Robot
26ab14c9f5 Merge "Remove the extra CONTENT_CAPTURE_STOP event from Activity.onStop()" 2019-02-27 05:34:23 +00:00
Feng Cao
aaea86b07c Remove the extra CONTENT_CAPTURE_STOP event from Activity.onStop()
(it was accidentally being called twice due to a bad git merge)

Fixes: 125628737
Test: atest CtsContentCaptureServiceTestCases

Change-Id: I260e33942855e7355fd531fb05baf699e9961a89
2019-02-27 03:37:32 +00:00
Rich Cannings
383223ab18 Merge "Refactor passwords/pins/patterns to byte[]" 2019-02-27 03:21:57 +00:00
Winson Chung
c1b8f8f669 Change trace message to reflect the show/hide state
Bug: 126336729
Test: Take systrace

Change-Id: Ia764c7fcc37c1c78d6d384a269b3bbfce02cf11e
2019-02-26 17:31:10 -08:00
Hai Zhang
2243586454 Mark role related APIs as test API.
So that we can test them.

Bug: 125404675
Test: build
Change-Id: Id42b9b6f29db77ed2dcfa5d64b292d909094ae42
2019-02-26 16:57:47 -08:00
Varun Shah
ea548cc3ab Merge "Updated Nullable annotation for #registerAppUsageLimitObserver." 2019-02-26 22:13:20 +00:00
Siarhei Vishniakou
ccf973fa9f Inject long press documentation
Clarify usage of Activity.onKeyLongPress(..). It is not obvious at
all that onKeyDown should be used in order for OnKeyLongPress to work.
Direct readers to the other api to make sure that this nuance is not
missed.

Bug: 21451760
Test: atest KeyEventInjectionTest
Change-Id: Ic73f6fe06b2108a3967ac590d22acfb283a700e1
2019-02-26 13:22:24 -08:00
Hui Yu
fb72b99051 Add API Service.getForegroundServiceType()
To return current foregroundServiceType if the service has become a
foreground service.

If service become foreground service by calling Service.startForeground(int,
Notification, int type), the returned type is the type specified.

If the no-type version Service.startForeground(int, Notification) is called.
the returned type is foregroundServiceType specified in manifest.

If no foregroundServiceType specified in manifest, the returned type is
zero.

If the service is not a foreground service, the returned type is zero.

Bug: 124517685
Test: atest cts/tests/app/src/android/app/cts/ActivityManagerProcessStateTest.java#testFgsLocation

Change-Id: Ibcc4431429a90aab92a5533e296fb104b4add9e6
2019-02-26 12:50:28 -08:00
TreeHugger Robot
8768f11463 Merge "Make assistant and telephony role names public API." 2019-02-26 18:14:30 +00:00