Commit Graph

12206 Commits

Author SHA1 Message Date
Yueming Wang
edb9535922 Merge "Implement DevicePolicyManager.setSystemSettings." 2017-12-04 21:57:28 +00:00
yuemingw
0de748d833 Implement DevicePolicyManager.setSystemSettings.
b/67627818
Bug: 67627818
Test: runtest -x services/tests/servicestests/src/
com/android/server/devicepolicy/DevicePolicyManagerTest.java

design doc: https://docs.google.com/document/d/
1rvEg5jE3lMhjH-OA0iTLBUY2opM96fg7BrP81MoPnmg/edit#

Change-Id: If5f5c280957085480872f2d59ed59309cf288145
2017-12-04 21:56:46 +00:00
Chavi Weingarten
29fdbc67fc Merge changes from topic "hw_bitmap"
* changes:
  Update screenshot requests to render proper crop and rotation.
  Revert "Revert "Updated screenshot code to reflect native changes.""
2017-12-04 17:10:30 +00:00
TreeHugger Robot
70de9728d2 Merge changes from topic "priv_vendor_app"
* changes:
  BIND_IMS_SERVICE is exposed to vendors
  Support privileged vendor apps
2017-12-04 03:20:34 +00:00
TreeHugger Robot
f156c04912 Merge "Expose App Standby APIs for apps and system" 2017-12-03 15:09:33 +00:00
Andreas Gampe
01a70b2e22 Merge "Frameworks: Move SharedPreferencesImpl to Future" am: aa3e9d351e am: bd4b1bad48
am: 06bc6945df

Change-Id: I6f646b3e6b9fb9d47b44e3d35321202bbb3c502d
2017-12-03 00:05:04 +00:00
Andreas Gampe
06bc6945df Merge "Frameworks: Move SharedPreferencesImpl to Future" am: aa3e9d351e
am: bd4b1bad48

Change-Id: I43c8231293f5e4349eaab6f4a8242892b3b2c726
2017-12-02 23:54:49 +00:00
Andreas Gampe
bd4b1bad48 Merge "Frameworks: Move SharedPreferencesImpl to Future"
am: aa3e9d351e

Change-Id: I2a47400d1e584aef1a16e05840ab964ca5735110
2017-12-02 23:45:54 +00:00
Amith Yamasani
afbccb7d37 Expose App Standby APIs for apps and system
Allow apps to query their own standby bucket.
Allow privileged apps with PACKAGE_USAGE_STATS permission to
query apps.
Allow privileged apps with CHANGE_APP_IDLE_STATE to set the
standby state for apps, but not for themselves.
Removed AppStandby class and moved constants into UsageStatsManager.

Bug: 63527785
Test: cts-tradefed run cts-dev -m CtsAppUsageHostTestCases
Change-Id: I3c1c20f6ecb6d54e248233696039286b243d663c
2017-12-01 14:00:37 -08:00
Bernardo Rufino
d6ba912bb9 Merge "Binding on-demand #3: updateTransportAttributes() API" 2017-12-01 12:06:23 +00:00
Felipe Leme
3f3fa1b558 Make sure apps cannot forge package name on AssistStructure used for Autofill.
Test: atest CtsAutoFillServiceTestCases:VirtualContainerActivityTest#testAppCannotFakePackageName
Test: atest CtsAutoFillServiceTestCases
Fixes: 69981710

Change-Id: Id6036cddb51dd8dd0c9128b7212d573f630d693f
2017-11-30 17:43:13 -08:00
chaviw
a69e0a7d7c Update screenshot requests to render proper crop and rotation.
The previous screenshot requests in SystemUI would generate a bitmap
and then adjust crop and rotation afterwards. Bitmaps from screenshots
are now hw Bitmaps so they can't be updated in software. Instead request
the proper crop and rotation from the native code to generate a Bitmap
with the correct configurations.

Change-Id: I4591c468b055c784460e5ddf2f9163ffa943c2ee
Fixes: 69898957
Test: Manual screenshots work and bugreport screenshots work in landscape.
2017-11-30 13:02:14 -08:00
TreeHugger Robot
3dd076b065 Merge "Allow secondary user POs on affiliated devices more DPM APIs" 2017-11-30 20:26:49 +00:00
Kweku Adams
598e9a277d incidentd: dumping native process mem info to proto.
Bug: 65750823
Test: flash device and check proto dump output.
Change-Id: Ic584f78153fbbb507cdd41e699a541e3351467bb
2017-11-30 11:48:38 -08:00
Benjamin Franz
dabae88659 Allow secondary user POs on affiliated devices more DPM APIs
- DevicePolicyManager.setKeyguardDisabled
- DevicePolicyManager.setStatusBarDisabled
- DevicePolicyManager.setDeviceOwnerLockScreenInfo
- PackageInstaller install and uninstall apps

Bug: 64383519
Test: Can set keyguard disabled, status bar disabled and lock screen message in
      affliated PO
Test: Can install and uninstall apps in affiliated PO
Test: CTS tracked in b/68925683

Change-Id: I71be25098436ba0b42050478c049850c2b21f6f4
2017-11-30 16:38:19 +00:00
Bernardo Rufino
ab953332bc Binding on-demand #3: updateTransportAttributes() API
This CL introduces the updateTransportAttributes() API to be used by the
transport hosts. It doesn't actually use the description attributes yet,
this will go in another CL. This is because I want to test that CL
together with transport usage. Tests are lacking for TransportManager
and BMS, I'll still add them, but I'm trying to migrate Robolectric
first.

Ref: http://go/br-binding-on-demand
Bug: 17140907
Test: make RunFrameworksServicesRoboTests
Test: runtest -p com.android.server.backup frameworks-services
Test: gts-tradefed run commandAndExit gts-dev -m GtsBackupTestCases
Test: gts-tradefed run commandAndExit gts-dev -m GtsBackupHostTestCases
Test: cts-tradefed run commandAndExit cts-dev -m CtsBackupTestCases
Change-Id: I56f7b5a5026d21d8f11afb371d5560d4913c5f2a
2017-11-30 14:26:13 +00:00
Jiyong Park
002fdbdb95 Support privileged vendor apps
Privileged apps can now be located in the vendor partition. This is
mainly to move SoC-dependent apks to the vendor partition so that the
system partition becomes more generic.

Like existing privileged apps in the system partition, the list of
privileged apps in the vendor partition and the permissions they are
using must be white-listed. The whitelist can be specified via
<privapp-permissions> tags in one of /vendor/etc/permissions/*.xml
files. Note: vendors can only white-list the apps in vendor partition,
but not the apps in system partition.

This change also introduces a new flag 'vendor-privileged' to the
permission protection level. It is used to expose platform-defined
permissions to the privileged vendor apps. If a platform permission does
not have this flag, it is not granted to vendor apps even when the app
is privileged and white-listed.

Bug: 35301609
Test: `mm` under frameworks/base/tests/privapp-permissions
adb sync && adb reboot
adb shell cmd package \
com.android.framework.permission.privapp.tests.vendor
shows that the app is installed.
android.permission.BIND_IMS_SERVICE is in the installed permissions list
android.permission.MANAGE_USE is not in the installed permissions list,
but is in the requested permissions list.

Change-Id: I196375aaaa9ea3a2ba15686ef08cf3f70ade7046
2017-11-30 14:41:55 +09:00
TreeHugger Robot
aae9f84ce8 Merge "Fix crash in slices" 2017-11-29 21:25:59 +00:00
Andreas Gampe
11b7b645ed Merge "Frameworks: Clean up SharedPreferencesImpl" am: 572f46a3ef am: 70da38960c
am: 9a612c734e

Change-Id: Iaa9ac8d03ac0f235bbff7bf4b17ef7de6b90c24a
2017-11-29 19:50:54 +00:00
Andreas Gampe
9a612c734e Merge "Frameworks: Clean up SharedPreferencesImpl" am: 572f46a3ef
am: 70da38960c

Change-Id: Ia4c24c8cd6fbeb58a90d56319558fc3c78474c2b
2017-11-29 19:38:11 +00:00
Andreas Gampe
70da38960c Merge "Frameworks: Clean up SharedPreferencesImpl"
am: 572f46a3ef

Change-Id: I7b922f795283cefabf661e999e5a9897889fa287
2017-11-29 19:25:13 +00:00
TreeHugger Robot
f86d375437 Merge "Fix user color overlay is not applied" 2017-11-29 11:13:15 +00:00
Andrii Kulian
4d26c21a82 Merge changes from topic "lifecycle_transaction_base"
* changes:
  Add transaction unit tests
  Add basic lifecycle transaction containers
2017-11-28 20:47:34 +00:00
Makoto Onuki
3c1d0caedb Merge "Extreme battery saver: Tweak to file saver" 2017-11-28 20:02:54 +00:00
Jason Monk
c10e0e2d19 Fix crash in slices
Test: example app
Change-Id: I0486a1663ceee4dce51a317795919ff9ae045a6f
2017-11-28 14:53:04 -05:00
Makoto Onuki
e098b7595a Extreme battery saver: Tweak to file saver
- Restore the default values after a runtime restart.
- debug.batterysaver.no_write_files sysprop to avoid writing max_freq

Bug 63527520
Test: manual
Test: atest $ANDROID_BUILD_TOP/frameworks/base/services/tests/servicestests/src/com/android/server/power/batterysaver/FileUpdaterTest.java

Change-Id: Ic4783f181252b063cfe7ea6fee47b9241f1688cc
2017-11-28 09:46:58 -08:00
Jeff Sharkey
14e1b283e8 Merge "Skip FDE-specific operations, mkdir() throwing." 2017-11-28 16:57:19 +00:00
Naomi Musgrave
d2c83c08bf Merge "Add id to NetworkEvent." 2017-11-28 13:30:19 +00:00
Tony Mak
213955e562 Fix user color overlay is not applied
Resource overlay is now done in runtime with non-system resources object.
Amend getDefaultUserIcon to take resources object as parameter.

BUG: 69355037
Test: Factory reset, verify that overlayed color is used in multiple
places, including keyguard, the bar under quick settings and Settings app.

Change-Id: I20b0527bdcb2eb38e8bea6a05f53eea1edcba932
2017-11-28 07:47:19 +00:00
Andrii Kulian
6b9d3a1400 Add transaction unit tests
Bug: 64797980
Test: android.app.servertransaction.ClientTransactionTests
Test: android.app.servertransaction.TransactionParcelTests
Change-Id: I108bacc819e9d43d0a2f5a30338ae88674a53239
2017-11-27 18:15:49 -08:00
TreeHugger Robot
edbd1d3dde Merge "Fix issue #68002319: Allow current VoiceInteractionService to avoid..." 2017-11-28 00:42:46 +00:00
Jeff Sharkey
ae26646824 Skip FDE-specific operations, mkdir() throwing.
vold already complains about calls that are FDE specific, which
results in a lot of wtf() noise, so skip those operations outright.

Throw from failed mkdir() back to caller instead of wtf().

Test: builds, boots
Bug: 68736572, 68736551
Change-Id: I4dc06bdedacd2b66a1e7ae8e1434b194a875a756
2017-11-27 13:32:28 -07:00
Bryce Lee
bc8c25a407 Merge "Store bounds in WindowConfiguration." 2017-11-27 19:15:06 +00:00
TreeHugger Robot
3971cdee9f Merge "Add meta-data constant for activity->slice" 2017-11-27 17:25:44 +00:00
Bryce Lee
f3c6a47bdd Store bounds in WindowConfiguration.
This changelist consolidates the usage of frame bounds in containers
into the WindowConfiguration. As a result, the bounds are now shared
across AM and WM. Any changes to the bounds on one side are
propagated to the other via override configuration changes. Previous
instrumentation to synchronize the two sides is no longer necessary.

This changelist does not attempt to consolidate common logic shared
between WM or AM components for setting bounds.

Bug: 68719294
Test: go/wm-smoke
Change-Id: Ia8978dba8525b83201640e159caefe16e626b7c1
2017-11-27 08:59:19 -08:00
Naomi Musgrave
3b501194ab Add id to NetworkEvent.
Test: runtest --path frameworks/base/services/tests/servicestests/src/com/android/server/devicepolicy/NetworkEventTest.java

Bug: 63910201
Change-Id: Iaac35fe27529937d2de7e3f096f6e94889cf8b85
2017-11-24 16:38:05 +00:00
Adrian Roos
e99bc0501a WM: Move WindowManagerPolicy, DisplayFrames and WindowManagerInternal into services
Splits WindowManagerPolicy into a framework and a services part, preventing concepts that are
internal to the window manager from leaking out into the framework.

Test: make droid
Change-Id: I7b6a54f55f76f6fbb5f27090981b8f1d4d8be88b
2017-11-23 17:23:26 +01:00
Christopher Tate
a732f014c5 The job scheduler now backs off jobs based on standby bucketing
The default parameters here translate to roughly this rate limiting:

  ACTIVE:   run jobs whenever
  WORKING:  ~ hourly
  FREQUENT: ~ every 6 hours
  RARE:     ~ daily

Bug: 63527785
Test: cts & manual (WIP)
      atest CtsJobSchedulerTestCases
Change-Id: I58f8e53e5bdf40601823e5a10a9f2383a6f67ae5
2017-11-22 22:07:06 +00:00
Dianne Hackborn
08bd3ea8ca Fix issue #68002319: Allow current VoiceInteractionService to avoid...
...activity launch delays.

Activity manager now has a new private mechanism for other services
to report which apps are allowed to bypass the launch delay restriction,
which voice interaction service uses.

Test: manual

Bug: 68002319
Change-Id: I44e9b67411b5106b81e8363dc22d4e54caeb83c1
2017-11-22 13:59:17 -08:00
Eran Messeri
3daba14f25 Merge "DevicePolicyManager: Make installed keys user-selectable by default." 2017-11-22 17:12:29 +00:00
TreeHugger Robot
7430d8d896 Merge "Notify apps when channels/groups are blocked/unblocked" 2017-11-22 15:55:53 +00:00
Jason Monk
da34022d12 Add meta-data constant for activity->slice
Test: its a constant
Change-Id: I331358bd9619beb413dfa98525b0f2589eaea8ae
2017-11-22 10:15:25 -05:00
Andrii Kulian
446e824e22 Add basic lifecycle transaction containers
This adds basic containers for holding some messages to a client,
that are related to activity lifecycle. Each transaction can hold
a list of callbacks and a final lifecycle state.

Some requests from ActivityManager to client that target activities
are now switched to use transactions. Scheduling, preparing and
executing a request is moved outside of ActivityThread class to
corresponding transaction items.

Bug: 64797980
Test: Existing AM CTS tests pass
Change-Id: I96df20787b3d792f655c9500e8a71032264d02cd
2017-11-21 18:13:52 -08:00
Suprabh Shukla
2ffa7f0d12 Merge "Delaying jobs while coming out of doze" 2017-11-22 01:38:26 +00:00
Andreas Gampe
70b600d456 Frameworks: Move SharedPreferencesImpl to Future
The asynchronous loading code is not safe wrt/ exceptions. Instead
of adding a tri-state for loading, move the code to use a Future
for the map. This encapsulates the required wait & synchronization,
as well as propagating any exceptions.

Bug: 67986472
Test: m
Test: Device boots
Test: m cts && cts-tradefed run commandAndExit cts-dev --module CtsContentTestCases -c android.content.cts.SharedPreferencesTest
Change-Id: I6616e8a05e64eb1cfe024cc3239a05847dfe1fab
2017-11-21 15:59:02 -08:00
Suprabh Shukla
106203bc53 Delaying jobs while coming out of doze
Foreground uids can run their jobs immediately given other constraints
are met. Other jobs will be delayed by 3 seconds when coming out of
doze to ensure imminent user tasks like screen-on can use resources.
Also added an API to allow apps to indicate their job is important to
the user enough that it is allowed to run when the app is in the
foreground or on the temp whitelist regardless of the dozing state of
the device.

Test: cts-tradefed run singleCommand cts-dev -m JobScheduler -t \
android.jobscheduler.cts.DeviceIdleJobsTest

Bug: 64291952
Bug: 64071030

Change-Id: Id52cb4386e683d4f8297e873b3a68c573e5be743
2017-11-21 15:38:20 -08:00
Andreas Gampe
f78a51759b Frameworks: Clean up SharedPreferencesImpl
Clean up in preparation for an implementation change. Add missing
annotations. Rename inner lock to be uniquely named. Use the local
map instead of mMap in the commit logic.

Test: m
Test: m cts && cts-tradefed run commandAndExit cts-dev --module CtsContentTestCases -c android.content.cts.SharedPreferencesTest
Change-Id: Id3a798732c83a4aa6487225e2375ade4985852e2
2017-11-21 15:34:05 -08:00
TreeHugger Robot
911fbd2313 Merge "Special handling of processes with recent tasks." 2017-11-21 20:36:28 +00:00
Eran Messeri
19d19048e4 DevicePolicyManager: Make installed keys user-selectable by default.
After Change-Id: Ibaba2ddd4f94fced1a2a7bfcfb91189302ec7f3a was merged,
KeyChain, by default, made keys installed in it not user-selectable,
which means users could not choose those keys in the Certificate
Selection prompt.
This is the correct behaviour (secure by default), but means the
DevicePolicyManager has to explicitly set keys as user-selectable
to be compatible with the previous behaviour.

This CL does the following:
* Adding an installKeyPair variant to the DevicePolicyManager to
  allow specifying user-selectability of the key.
* Make old installKeyPair variants delegate to the new variant,
  with the default of setting installed keys user-selectable.
* Modify the DevicePolicyManager service definition and service to
  take the extra user-selectability parameter and set the value
  in KeyChain.

Note that the reason the CTS test started failing is not related to
this change but a CTS Verifier test should catch the problem this
CL is solving.

Part of the fix for b/69337278

Bug: 69337278
Test: cts-tradefed run commandAndExit cts-dev -a armeabi-v7a -m CtsDevicePolicyManagerTestCases -t com.android.cts.devicepolicy.DeviceOwnerTest#testKeyManagement
Change-Id: Ifc240ed4a20a9d00bc6140dfb45bd1140e1f8260
2017-11-21 17:01:39 +00:00
Julia Reynolds
3eb3ffd9c3 Notify apps when channels/groups are blocked/unblocked
So that apps can disable/enable receivers/jobs/etc. that
would only need to run to post notifications to the blocked
channel(s).

Additionally let apps retrieve an individual group so they
can inspect blocked state.

Change-Id: I733b70c62cd0482d0cf9692ea9b00cf313ad7b81
Fixes: 36530302
Test: runtest systemui-notification, cts
2017-11-21 11:28:07 -05:00