Commit Graph

766 Commits

Author SHA1 Message Date
Varun Shah
913a014f5f Merge "Add OBSERVE_APP_USAGE permission to shell for CTS test." 2019-02-05 15:21:25 +00:00
Bill Yi
abd6d274f1 Import translations. DO NOT MERGE
Change-Id: I7fda2af86593c821eac93bada8680b3dd42290be
Auto-generated-cl: translation import
2019-02-02 12:17:08 -08:00
Varun Shah
0586192423 Add OBSERVE_APP_USAGE permission to shell for CTS test.
Bug: 123314449
Test: atest android.content.pm.cts.LauncherAppsTest
Change-Id: I5e58aefa9920dd4a974d24388f8ecd8dea7936b3
2019-02-01 17:29:48 +00:00
Julia Reynolds
876219430d Tests for matchesCallFilter
Test: cts
Bug: 123406095
Change-Id: Ibece70d3e5d77d447ece4f3d3118b315a8d6e5cb
2019-01-30 10:39:08 -05:00
Bill Yi
2c9336b7ba Import translations. DO NOT MERGE
Change-Id: Ide81fb5798a13fbbb7ce8b3fbf4088a271738674
Auto-generated-cl: translation import
2019-01-29 13:34:09 -08:00
Nandana Dutt
9de4d6a3f5 Merge "Improvements to Bugreporting API." am: 212353c896 am: 42df2e1602
am: 73226aa0f8

Change-Id: I947ffa533288c91b169863a045d71e735486773e
2019-01-23 09:47:56 -08:00
Nandana Dutt
73226aa0f8 Merge "Improvements to Bugreporting API." am: 212353c896
am: 42df2e1602

Change-Id: I7ea14750afc2c8b6f2b387ad23a054acf1ec6384
2019-01-23 09:36:20 -08:00
Nandana Dutt
b2da22a0de Improvements to Bugreporting API.
* Add cancelBugreport method.
* Remove unused arguments to onFinished listener call.
* Publish the system service now that sepolicy for it
  is submitted.
* Use the new bugreportd service.

Test: boots
BUG:111441001
Change-Id: I12d72e0e1f4ca72d285fd02a3fc1a44f5c179885
2019-01-23 10:21:45 +00:00
William Hester
a96d3d3ff4 Implement test harness mode
Test Harness Mode is a feature for device farms that want to wipe
their devices after each test run. It stores the ADB keys in the
persistent partition (used for Factory Reset Protection) then performs
a factory reset by broadcasting the MASTER_CLEAR intent.

Upon rebooting, the Setup Wizard is skipped, and a few settings are set:
  * Package Verifier is disabled
  * Stay Awake While Charging is enabled
  * OTA Updates are disabled
  * Auto-Sync for accounts is disabled

Other apps may configure themselves differently in Test Harness Mode by
checking ActivityManager.isRunningInUserTestHarness()

Bug: 80137798
Test: make && fastboot flashall -w
Test: adb shell cmd testharness enable
Change-Id: I91285c056666e36ad0caf778bffc140a0656fcfa
2019-01-22 13:32:20 -08:00
Stanislav Zholnin
f5235d22be Merge "Add READ_DEVICE_CONFIG and WRITE_DEVICE_CONFIG permissions to the Shell." 2019-01-17 10:16:25 +00:00
Nandana Dutt
2a7be974fc Merge "BugreportAPI : Connect listener to binder callbacks" am: 4fefbddead am: 7b5f8817ce
am: 3a26a0bd5d

Change-Id: Iad0274d6ae8bf76475f1852a1d202a9df83c661d
2019-01-16 08:59:55 -08:00
Nandana Dutt
3a26a0bd5d Merge "BugreportAPI : Connect listener to binder callbacks" am: 4fefbddead
am: 7b5f8817ce

Change-Id: I5e296f6780569fe838e388962e1d0e2affd50aad
2019-01-16 08:44:27 -08:00
Stanislav Zholnin
bec8835093 Add READ_DEVICE_CONFIG and WRITE_DEVICE_CONFIG permissions to the
Shell.

Bug:117663715
Test: Manually tested that device_config API work from the
shell.

Change-Id: I5bde4192a6223112daa090a02f13abd7c13585e2
2019-01-16 14:45:43 +00:00
Nandana Dutt
331f2e988e Merge "Add the new dumpstate listener methods to implementations" am: 55c2344bc5 am: 4524abd318
am: 0296c0cf26

Change-Id: I87243f66fb70de378d962ba5c180ca0a4c5e541b
2019-01-15 06:49:57 -08:00
Nandana Dutt
0296c0cf26 Merge "Add the new dumpstate listener methods to implementations" am: 55c2344bc5
am: 4524abd318

Change-Id: Icbfe6a1f810d61ae4ba92a8c2894b5e8a0d6a992
2019-01-15 06:36:21 -08:00
Nandana Dutt
c8c77bc043 BugreportAPI : Connect listener to binder callbacks
BUG: 111441001
Test: builds
Test: interactive bugreport still works
Change-Id: Ie3f2328f558bb2de1dec2908c6ab13f5a17df115
2019-01-15 12:51:42 +00:00
Michal Karpinski
7b97a0267b Add a new START_ACTIVITIES_FROM_BACKGROUND
signature|privileged|vendorPrivileged|oem
permission

And grant it to SystemUI and Shell (adb shell am start).

Bug: 110956953
Test: atest WmTests:ActivityStarterTests
Change-Id: I4885a9a62ee8d47a3aef85f0e34b746c3f51ca2b
2019-01-14 18:13:47 +00:00
Nandana Dutt
432f8c7b86 Add the new dumpstate listener methods to implementations
Add dummy implementations for status, error and finished callbacks.
Next step: wire these up end-to-end; change Shell's listener to be
BugreportManager.BugreportListener, and make it communicate with the
native service explicitly through the new system api.

BUG: 111441001
Test: Verified progress in interactive bugreport still works
Change-Id: Iad0bb7b23b04f6bc7e3b31e5071df42409c78684
2019-01-14 17:55:27 +00:00
Winson Chung
fb922e9bac Merge changes from topic "prediction_suggestion_services"
* changes:
  Initial commit of Content Suggestions (overview long press) Manager.
  Adding initial implementation of Prediction client/service API
2019-01-11 20:21:19 +00:00
Svet Ganov
8455ba2341 Historical app ops.
This change is the main check in for the historical app op feature.
The idea is to store a historical data about past app op rejections,
accesses, and durations per op for any UID state indefinitely.

Keeping all operations on record is not practical as app ops are
very frequently performed. To address this we are storing aggregated
data as snapshots where we store for every UID and its packages
how many times each op was accessed, rejected, lasted as an aggregate.

To allow history scaling indefinitely we are taking a logarithmic
approach with only the most recent state stored in memory and all
preceding state stored on disk. State on disk is stored in separate
files where each preceding file, i.e. for an older period, would
cover X times longer period with X number of snapshots covering
X times longer period. Initially X is ten but can be tweaked. For
example, the first file could contain data for ten days with daily
snapshots, while the file for older period would have data
for a hundred days with snapshots every ten days, etc.

The implementation is optimized for fast history update and no impact
on system runtime performance and minimizing memory footprint. We
are lazily persisting state to disk on a dedicated thread as this is
slow. We are also reading the relevant historical files on a query
as this is very rare as opposed to state updates.

The base snapshot interval, i.e. snapshot time span, in the initial
iteration and the logarithmic step are configurable. These can be
changed dynamically and the history would be rewriten to take this
into account.

Test: atest CtsAppOpsTestCases

bug:111061782

Change-Id: I55c32c79911ba12b2ace58d2a782b8df1e6bff60
2019-01-10 19:31:31 -08:00
Winson Chung
3fb0f258d3 Initial commit of Content Suggestions (overview long press) Manager.
Test: compile
Bug: 120865921
Change-Id: I9f8310112bedc883406f0f50a99041f542036fd9
2019-01-10 16:35:13 -08:00
Sunny Goyal
54e91344e2 Adding initial implementation of Prediction client/service API
Test: Build sample app, ensure that app prediction service gets client
      requests
Bug: 111701043
Change-Id: I33aceb2de31552b2d740dc333559d68728753e40
Signed-off-by: Winson Chung <winsonc@google.com>
2019-01-10 15:53:25 -08:00
Richard Uhler
c739c8c3f9 Make RollbackManager @SystemApi.
Require callers hold a new MANAGE_ROLLBACKS permission to interact with
the RollbackManager.

Bug: 112431924
Test: atest RollbackTest, with new test for permissions added,
      and with selinux in permissive mode.
Test: atest CtsPermission2TestCases:PermissionPolicyTest
Change-Id: I73f4f3457d85be580670cd69c89066d2cc348186
2019-01-02 09:19:45 +00:00
Bill Yi
d73e58b1b8 Import translations. DO NOT MERGE
Change-Id: I05172296123f8f0b77034a05d936428e3ba4a921
Auto-generated-cl: translation import
2018-12-25 05:10:42 -08:00
Chen Xu
8229f4c5f8 Merge "new SystemAPI for preciseCallState and DisconnectCause" am: 6eacd30e8f
am: f034647231

Change-Id: I2320bd6f4b85ef55a2fe3b7c865ffde67d71d415
2018-12-20 20:19:15 -08:00
chen xu
970d77913b new SystemAPI for preciseCallState and DisconnectCause
1. decouple disconnectCause and preciseDisconnectCuase from
 preciseCallState.
 2. expose preciseCallState to SystemAPI and expose
onPreciseCallStateChanged to System API
3. remove/hide ImsReasonInfo from PreciseDisconnectCuase
4. expose DiconnectCuase and PreciseDisconnectCause to System API
5. new onDisconnectCauseChanged API on PhoneStateListener for CS call
 and use ImsCallSessionListener for IMS call(imsreasonInfo)
6. add read_precise_phone_state to shell apk to enable GTS test

Bug: 119890559
Test: atest GtsGmscoreHostTestCases:TelephonyHostTest#testPhoneStateListener
Change-Id: If9256feff16b6bcaef1dfe194c2b0df2a48436b0
(cherry picked from commit 6a942d488a)
Merged-in: If9256feff16b6bcaef1dfe194c2b0df2a48436b0
2018-12-20 18:41:11 +00:00
chen xu
6a942d488a new SystemAPI for preciseCallState and DisconnectCause
1. decouple disconnectCause and preciseDisconnectCuase from
 preciseCallState.
 2. expose preciseCallState to SystemAPI and expose
onPreciseCallStateChanged to System API
3. remove/hide ImsReasonInfo from PreciseDisconnectCuase
4. expose DiconnectCuase and PreciseDisconnectCause to System API
5. new onDisconnectCauseChanged API on PhoneStateListener for CS call
 and use ImsCallSessionListener for IMS call(imsreasonInfo)
6. add read_precise_phone_state to shell apk to enable GTS test

Bug: 119890559
Test: atest GtsGmscoreHostTestCases:TelephonyHostTest#testPhoneStateListener
Change-Id: If9256feff16b6bcaef1dfe194c2b0df2a48436b0
2018-12-18 11:29:53 -08:00
Bill Yi
6cee406e54 Import translations. DO NOT MERGE
Change-Id: I3236c99587054f68ab1e86d16f3db82fae7ecbfb
Auto-generated-cl: translation import
2018-12-11 01:31:29 -08:00
Jeff Sharkey
4ba6923975 Offer API to detect ContentProvider ANRs.
If a system component calls to a remote provider, and that provider
hangs, we end up burning that Binder thread until the remote process
is killed for some unrelated reason.

This change adds an API to detect these hangs, and kill the remote
process after a specific timeout, but only when the caller holds a
permission that lets them kill other apps.

Bug: 117635768
Test: atest android.content.cts.ContentResolverTest
Change-Id: I81b0d993d9d585cdeb5e2559c68052ba6cbbced9
2018-12-08 14:56:48 -07:00
Felipe Leme
749b889889 Yet another (major) refactoring on Content Capture and Augmented Autofill.
Bunch of changes:

- Split public SmartSuggestionsService info ContentCaptureService and
  AugmentedAutofillService
- Renamed 'intelligence' packages to either 'contentcapture' or
  'autofil.augmented'
- Renamed internal packages and classes.
- Changed permissions, resource names, etc...
- Moved Augmented Autofill logic from IntelligeceManagerService (R.I.P.) to
  Autofill.
- Optimized IPCs by passing a String instead of the InteractionSessionId
  (that also solves the view -> service dependency).

Test: atest CtsContentCaptureServiceTestCases \
            CtsAutoFillServiceTestCases \
            FrameworksCoreTests:SettingsBackupTest
Test: manual verification with Augmented Autofill Service

Bug: 119638877
Bug: 117944706

Change-Id: I787fc2a0dbd9ad53e4d5edb0d2a9242346e4652d
2018-12-06 16:56:39 -08:00
Felipe Leme
5933efbd26 Initial implementation of Intelligence Service Shell commands.
Bug: 111276913

Test: adb shell cmd intelligence
Test: cts-tradefed run commandAndExit cts-instant-dev -m CtsContentCaptureServiceTestCases
Test: atest CtsContentCaptureServiceTestCases CtsAutoFillServiceTestCases

Change-Id: Icc677d03db803fb66d7ee14a0375a765b8941bc2
2018-12-04 10:29:49 -08:00
Felipe Leme
4a9c854b87 Merge "Added OWNERS to Shell and hook to make sure it's developed on AOSP." am: 4384c5c241 am: 2ffd64805c
am: 80ae48bff3

Change-Id: Id6b08acf70187e3b23ce5323e9ad88f97ff0bb68
2018-11-21 14:47:59 -08:00
Felipe Leme
80ae48bff3 Merge "Added OWNERS to Shell and hook to make sure it's developed on AOSP." am: 4384c5c241
am: 2ffd64805c

Change-Id: Ida97bc760fb5d26ace3ac1092f05b3b8fa7ede7f
2018-11-21 14:37:39 -08:00
Felipe Leme
4c192e9690 Added OWNERS to Shell and hook to make sure it's developed on AOSP.
Bug: none
Test: none

Change-Id: I1f6f554cf98c78d1ab8a1e820d485a37238230f5
2018-11-21 13:00:06 -08:00
Hai Zhang
7e3fb2a4ce Merge "Add MANAGE_ROLE_HOLDERS permission to shell." am: a2ccaf6e68 am: 5837aa482b
am: 816e35e405

Change-Id: I93034c3105c9f3857be8309a905e432a3c9b2005
2018-11-20 07:40:36 -08:00
Hai Zhang
816e35e405 Merge "Add MANAGE_ROLE_HOLDERS permission to shell." am: a2ccaf6e68
am: 5837aa482b

Change-Id: I4ddb49575f423237be4f354bbf37c5bce56fa958
2018-11-20 00:09:55 -08:00
Hai Zhang
bc0df49ed9 Add MANAGE_ROLE_HOLDERS permission to shell.
This change adds the MANAGE_ROLE_HOLDERS permission to shell, which
allows shell or code with Shell permission identity to use privileged
RoleManager APIs.

Bug: 110557011
Test: build
Change-Id: I6b8be9eec2a1dfb169536cfcda9d21cb802df327
2018-11-19 17:27:47 -08:00
Salvador Martinez
812ea7554b Create APIs to interact with DynamicPowerSaver
This creates the PowerManager APIs that allow apps with the
appropriate permissions to interact with Dynamic Power Saver.

Bug: 111450127
Test: WIP
Change-Id: I5b9483fa0fba81a4ade622b1f3dbaec580b68a67
2018-11-13 09:33:50 -08:00
Svet Ganov
d03d02f585 Merge "Add owners to the Shell app" am: bc12083aa7 am: 924f4e352d
am: 8947d38c39

Change-Id: I7723a2b64d4811bcabbc48c8cbfbe9513a10bd07
2018-11-12 13:02:54 -08:00
Svet Ganov
8947d38c39 Merge "Add owners to the Shell app" am: bc12083aa7
am: 924f4e352d

Change-Id: I4ccfecaa7f8b8a2102a5d285ee9848e4fb105a13
2018-11-12 12:52:39 -08:00
Svet Ganov
2ffbacda3d Add owners to the Shell app
The Shell app has elevated privileges as it is used for development
and testing behind the USB debugging developer option. This change
adds owners file to control the changes to the Shell app and more
specifically to its manifest file to ensure only sensible singature
protection permissions are granted to the shell.

Test: manual

bug:80415658

Change-Id: Ic7a442320f052d3c698ed923f1a953e4bee646eb
2018-11-05 17:31:55 -08:00
Bill Yi
ef44016343 Import translations. DO NOT MERGE
Change-Id: I595c63f1fe103b3e3fbdaafe7148bd9e99d4638c
Auto-generated-cl: translation import
2018-10-31 09:42:39 -07:00
Phil Weaver
783f1d6e50 Merge "Grant shell permission to manage accessibility" am: cf092a87c2 am: a28031b7da
am: 2ca26297c0

Change-Id: I7f641be89ae60d1afe54ffb86611a421ffa3a8d5
2018-10-15 14:56:42 -07:00
Phil Weaver
2ca26297c0 Merge "Grant shell permission to manage accessibility" am: cf092a87c2
am: a28031b7da

Change-Id: I690233f012873d333f4ed4931f29e9c27223ab8f
2018-10-15 14:33:55 -07:00
Phil Weaver
1df928ff2b Grant shell permission to manage accessibility
Bug: 116118615
Test: make
Change-Id: I6caa663a09a9119cd62561ed746cd139025edf44
2018-10-12 15:48:34 -07:00
Michael Groover
2c2592052d Merge "Add READ_PRIVILEGED_PHONE_STATE to used permissions" am: 403813782f am: 25131f86fa
am: 1112ebf8ac

Change-Id: Ib377536490b186d57c59fe70a8e4f1c8403d587c
2018-10-10 19:30:36 -07:00
Michael Groover
25131f86fa Merge "Add READ_PRIVILEGED_PHONE_STATE to used permissions"
am: 403813782f

Change-Id: Id778252cc548c20ed05dc59c4a3da85b40cc0b7c
2018-10-09 16:37:23 -07:00
Michael Groover
1248e435a0 Add READ_PRIVILEGED_PHONE_STATE to used permissions
Bug: 110099294
Test: cts-tradefed run cts -m CtsTelephonyTestCases -t android.telephony.cts.TelephonyManagerTest
Change-Id: I13fec3d397c200ce92883883c96c07007e823efe
2018-10-08 11:29:03 -07:00
TreeHugger Robot
10efed0b49 Merge "Remove SMS access for apps other than current SMS handler" 2018-10-06 20:14:06 +00:00
Eugene Susla
9351985f7a Remove SMS access for apps other than current SMS handler
Bug: 110098858
Test: atest android.telephony.cts.SmsManagerTest#testContentProviderAccessRestrictions
Change-Id: I9da992565b04ca5fa2656801fd2cfe4b196ef9b4
2018-10-05 16:51:13 -07:00