935 Commits

Author SHA1 Message Date
Michal Karpinski
08be96ec87 Disable DO single user features when clearDeviceOwner() is called
regardless of the amount of users

Bug: 32901196
Bug: 29748723
Change-Id: Ie419b5e496e23656cbe5436942d9aba402bfe68e
2016-11-23 11:42:31 +00:00
TreeHugger Robot
29993074b0 Merge "Keep track of admin actions for DO disclosures" 2016-11-17 21:40:46 +00:00
Bartosz Fabianowski
b21b241f0f Keep track of admin actions for DO disclosures
This CL adds bookkeeping to DPMS which will allow us to tell the user
in the Settings UI whether/when the admin requested a bug report or
retrieved logs from the device.

Bug: 32692748
Test: Full DevicePolicyManagerTest unit test coverage; end-to-end tests
        will follow as Settings CTS verifier tests

Change-Id: I89728fce4b7e0ff061b354c73caf3742e95a3a3e
2016-11-17 20:52:03 +01:00
Nicolas Prévot
554140fc89 Merge "Check user restriction DISALLOW_REMOVE_USER in isProvisioningAllowed." 2016-11-17 11:35:42 +00:00
Nicolas Prevot
56400a445f Check user restriction DISALLOW_REMOVE_USER in isProvisioningAllowed.
If DISALLOW_REMOVE_USER is set and there is already a managed profile:
isProvisioningAllowed() should return false

BUG:32629873
Test: adb shell am instrument -e class com.android.server.devicepolicy.DevicePolicyManagerTest -w
com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
Change-Id: I093bed0a4a54f83decf11716ebfd50dd4f17c089
2016-11-16 12:12:41 +00:00
Michal Karpinski
75ec5465f0 Merge "Fix disabling DO single user features when clearDeviceOwner() is called" 2016-11-16 11:46:18 +00:00
Michal Karpinski
c44e679611 Fix disabling DO single user features when clearDeviceOwner() is called
We should disable those features before the DO is actually cleared.

Bug: 32901196
Bug: 29748723
Change-Id: I3cf24636feb1715af10fb874d4fecd7a4e32495d
2016-11-15 17:23:11 +00:00
Sudheer Shanka
dc589ac82b Update usage of ActivityManagerNative.
- Remove references to ActivityManagerProxy.
- Add isSystemReady to ActivityManager.

Bug: 30977067
Test: cts/hostsidetests/services/activityandwindowmanager/util/run-test android.server.cts
      adb shell am instrument -e class com.android.server.am.ActivityManagerTest,com.android.server.am.TaskStackChangedListenerTest \
          -w com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
Change-Id: I07390b6124fb1515821f5c0b37baf6ae74adc8fa
2016-11-14 11:27:12 -08:00
TreeHugger Robot
2c2fb6189c Merge "Allow cross profile call between DO and PO" 2016-11-14 16:27:56 +00:00
Tony Mak
46aabe5ef4 Allow cross profile call between DO and PO
Allow DO to bind service of PO in managed profile and vice versa.
DO and PO must be the same package.

Bug: 31895999

Change-Id: I3ce2943aebd1249401d5814757a0ce25b9f85279
Test: cts-tradefed run cts --module DevicePolicyManager --test com.android.cts.devicepolicy.CorpOwnedManagedProfileTest
2016-11-14 14:20:11 +00:00
Michal Karpinski
aabe96db87 [DPM] Minor code fixes in NetworkLoggingHandler
Added a comment and renamed field to follow mConvention.

Test: will be CTS tested once APIs unhidden
Bug: 29748723
Change-Id: I351be4680eed9c4ab51365e1b983b452ca210858
2016-11-14 12:10:39 +00:00
Michal Karpinski
a9ff206af2 [DPM] DO uses batch token to retrieve network logs, and can retrieve
the same batch many times

This allows DO to:
a) know that some logs were dropped (by trying with token and not
getting anything)
b) know how many logs were there in each batch (useful especially
for the dropped ones)
c) retry batch retrieval if it failed

Test: will be CTS tested once APIs unhidden
Bug: 29748723
Change-Id: I788359242e3b2a4cb638edb25e5db8b25646c29f
2016-11-14 10:26:55 +00:00
Tamas Berghammer
383db5ebcc Update package names to work with the proto3 compiler
Bug: b/28974522
Change-Id: I5f3adf4946ee4ba1e09e4f40afe83c151405972a
2016-11-08 14:06:09 +00:00
Greg Plesur
d1ceaff82c resolve merge conflicts of c874e60 to master
Change-Id: I39381c516e4a1267d06e3f7b682d1cf73eeb6f9b
2016-11-04 12:34:30 -04:00
Greg Plesur
34fb70ab88 If the current device is a watch, fix DeviceOwner/ProfileOwner logic.
In this case, don't require the device to have gone through the
Setup Wizard before disqualifying DO/PO if there's an incompatible
account on the device.

BUG: 32438704,32438210

Change-Id: I6858db13c8df6e95d01d18a903f4343f70370e8b
2016-11-03 17:35:42 -04:00
Michal Karpinski
a27884236f Stop non-DO devices from disabling network logging
Bug: 32623860
Change-Id: Ia53ce842fffb2a15c16c9535fbe07421ae7f2578
2016-11-03 10:36:48 +00:00
Michal Karpinski
f77ee4f1b7 [DPM] Management and retrieval of network logs
This CL follows up on ag/1530343 and adds:
1) Various network events.
2) Retrieval method in DPM and APIs in DeviceAdminReceiver.
3) Extension of NetworkLogger and it's NetworkLoggingHandler.

Test: runtest --path frameworks/base/services/tests/servicestests/src/com/android/server/devicepolicy/NetworkEventTest.java
Bug: 29748723
Change-Id: I42a1a477e7c75c109a3982f809c22732b814e8b2
2016-11-02 09:00:21 +00:00
Michal Karpinski
dd9bb4fdd9 [DPM] DO can start network logging and listen for events
This CL adds:
1) Setter and getter in DPM to manipulate logging switch (retrieval
method to come in a subsequent CL(s)).
2) A way for DPM to register to listen for events.
3) Skeleton of NetworkLogger class (more to come in subsequent CL(s)).

Bug: 29748723
Change-Id: I5c04662ccc6febd2ba294b0eaca1ed1da9c16e47
2016-11-02 08:52:53 +00:00
Makoto Onuki
4b3c306268 Merge "Add @NonNull / @Nullable to DPM return types" 2016-10-31 20:15:10 +00:00
Makoto Onuki
408e8e4491 Add @NonNull / @Nullable to DPM return types
Fix: 31331663
Fix: 32466757

Test: Signature change only; checkbuild.
Change-Id: I361cdd43b9fccf309ff3efefa3783d5399e65748
2016-10-31 11:29:28 -07:00
Nicolas Prevot
df1b87db5d Allow DO to remove user even if DISALLOW_REMOVE_USER is set.
BUG:32300784
Test: create user in TestDPC, set DISALLOW_REMOVE_USER restriction,
and remove this user.
Change-Id: I96ab02d594cd1a8ab14420e12357f2083da1ce63
2016-10-28 19:25:31 +01:00
Andrew Scull
5f9e6f37b2 Refactor password metric computation.
This unifies previously duplicated code.

Bug: 30558331
Test: runtest -x frameworks/base/core/tests/coretests/src/android/app/admin/PasswordMetricsTest.java
Change-Id: I37678b83a03d4f05b9894d4b00e9a741d1a8df27
2016-10-20 19:04:41 +01:00
Mahaver Chopra
4e6ded256f Analytics for provisioning entry point: ADB
To get the better understanding of provisioning flows, we are logging
all the entry points to Managed provisioning. This change implements it
for ADB.

Test: cts-tradefed run cts --module DevicePolicyManager

Bug: 31424428
Change-Id: Id8b6638fcec1642c54efaffdfaaee81040f4de8a
2016-10-19 11:56:13 +01:00
Michal Karpinski
bc755da55c Don't expose default strong auth timeout as constant
am: 6dbf67fc48

Change-Id: Iacbe9a2de7024e29e9c2c98594ebca828b855a43
2016-10-13 22:52:38 +00:00
TreeHugger Robot
a6b3caf58e Merge "Don't expose default strong auth timeout as constant" into nyc-mr1-dev 2016-10-13 22:47:30 +00:00
Greg Plesur
f38aac7fc0 DPM.isProvisioningAllowed(ACTION_PROVISION_MANAGED_DEVICE) should return 'false' for Wear devices after pairing/upgrade. am: 3514404984
am: 43ed3a5b6a

Change-Id: I20248c835034935c25ee6fa25f8eeeb9125f121e
2016-10-13 21:19:17 +00:00
Greg Plesur
43ed3a5b6a DPM.isProvisioningAllowed(ACTION_PROVISION_MANAGED_DEVICE) should return 'false' for Wear devices after pairing/upgrade.
am: 3514404984

Change-Id: I8d24007831ba030af0d84f717802c79172db970f
2016-10-13 21:12:51 +00:00
Greg Plesur
216ee1f0e7 Merge "DPM.isProvisioningAllowed(ACTION_PROVISION_MANAGED_DEVICE) should return 'false' for Wear devices after pairing/upgrade." into cw-f-dev 2016-10-13 21:02:01 +00:00
Greg Plesur
3514404984 DPM.isProvisioningAllowed(ACTION_PROVISION_MANAGED_DEVICE) should
return 'false' for Wear devices after pairing/upgrade.

BUG: 32019375
Change-Id: I2563efe58c98c5dd8440891e478c89e093d8d9ac
2016-10-13 15:08:14 -04:00
Vladislav Kuzkokov
543befb7c2 resolve merge conflicts of 792e051 to master
Change-Id: I75e604639959df77ddf11bbb9805392e4141da23
2016-10-13 13:49:13 +02:00
Vladislav Kuzkokov
98a145b5af Revert "Fix backup for users hit by erroneous backup disabling"
am: 9f61d17e6a

Change-Id: I460fbb670fbc7a724c981c4fceae0048ff4c9ded
2016-10-13 08:41:52 +00:00
Vladislav Kuzkokov
b24489e20a Merge "Revert "Fix backup for users hit by erroneous backup disabling"" into nyc-mr1-dev 2016-10-13 08:34:20 +00:00
Michal Karpinski
6dbf67fc48 Don't expose default strong auth timeout as constant
The admin can instead use the value of 0 to reset to default.

Test: runtest --path frameworks/base/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerTest.java

Bug: 31430135
Change-Id: I0d6b29ca4eca65d7ca72a8975a0c28c9050a946c
(cherry picked from commit 943aabd11cce3ab453762d3912395363720e1f5d)
2016-10-12 09:34:12 +00:00
TreeHugger Robot
d227a66aad Merge "Don't expose default strong auth timeout as constant" 2016-10-11 18:34:08 +00:00
Tony Mak
6dc428f677 Allow device owner to inflate managed profile
1. Modify DPM.isProvisioningAllowed to allow it to happen
2. Introduce hidden API createProfileForUserEvenWhenDisallowed for
   ManagedProvisioning app to create profile under DO.
   Apps with MANAGE_USERS permission can clear the
   DISALLOW_ADD_USER restriction anyway, so they do not gain extra power.

Test: runtest -x frameworks/base/services/tests/servicestests/src/com/android/server/pm/UserManagerTest.java
Test: cts-tradefed run cts --module DevicePolicyManager --test com.android.cts.devicepolicy.CustomDeviceOwnerTest#testIsProvisioningAllowed

Bug: 31895999

Change-Id: I10dc3043653130ae717a1d3d8256c9e73231bb21
2016-10-11 12:46:32 +00:00
Michal Karpinski
943aabd11c Don't expose default strong auth timeout as constant
The admin can instead use the value of 0 to reset to default.

Test: runtest --path frameworks/base/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerTest.java

Bug: 31430135
Change-Id: I0d6b29ca4eca65d7ca72a8975a0c28c9050a946c
2016-10-11 10:12:30 +01:00
Vladislav Kuzkokov
9f61d17e6a Revert "Fix backup for users hit by erroneous backup disabling"
BUG=31754835
This reverts commit 1975021d88da6623a570a6ddab8b2397b1c0e59f.

Change-Id: I5cf7862126755a34cf3b4d70436529401fddc87f
2016-10-06 11:13:40 +00:00
Nicolas Prevot
700e1e7ee8 Don't allow the shell to change admin-locked app permissions.
BUG:27432532
Change-Id: I67f8794ea923edb5024033bb2a4474a1fb6d5fd9
2016-10-03 16:17:04 +01:00
Vladislav Kuzkokov
84ba6b0f27 Fix logic in disabling BackupTransport in DO mode. am: bbaadc0166 am: cfaef4287d
am: da82fa0a3f

Change-Id: Ib2215eda1c95b6e04429ca30011bb84789bb9b6e
2016-09-29 02:03:35 +00:00
Vladislav Kuzkokov
2555a1211d resolve merge conflicts of 852c394 to master
Change-Id: I75562584559c1b11111e316edded61587892ee8b
2016-09-29 01:42:42 +02:00
Vladislav Kuzkokov
cfaef4287d Fix logic in disabling BackupTransport in DO mode.
am: bbaadc0166

Change-Id: I89c0a7fb44bc50efedf2e8dc5eabaa4711b2687b
2016-09-28 21:26:00 +00:00
Vladislav Kuzkokov
56d7022d48 Fix backup for users hit by erroneous backup disabling
am: 1975021d88

Change-Id: I4421e9642c2e89bf17535ef3212617d268c1c9d2
2016-09-28 21:24:44 +00:00
Vladislav Kuzkokov
cd339f211a Merge "Fix logic in disabling BackupTransport in DO mode." into nyc-mr1-dev 2016-09-28 21:15:09 +00:00
Vladislav Kuzkokov
1975021d88 Fix backup for users hit by erroneous backup disabling
BUG=31754835

Change-Id: I89dd08b7958dd8fe20d70bc50f2c89996ae46cc5
2016-09-28 21:31:16 +02:00
Vladislav Kuzkokov
bbaadc0166 Fix logic in disabling BackupTransport in DO mode.
We were disabling backup in consumer mode as well.

BUG=31754835
TEST=android.content.pm.cts.shortcuthost.ShortcutManagerBackupTest

Change-Id: I42e5cfa512fda1b471eb62c7eb8bc346383da2fa
2016-09-28 20:24:42 +02:00
Makoto Onuki
357ca56f8b Fix DPM unit tests, also fix a log message. am: 6ad5f92512 am: 2f78ab5387
am: 4001a2b4c4

Change-Id: Ifc1735798074af6758da5cc3a40d9adada1376cb
2016-09-25 21:26:31 +00:00
Makoto Onuki
2f78ab5387 Fix DPM unit tests, also fix a log message.
am: 6ad5f92512

Change-Id: Ieab914cf8538e3086fb32cc351e45e6a5c2017c5
2016-09-23 15:43:04 +00:00
Makoto Onuki
18fb24c5d3 Merge "Fix DPM unit tests, also fix a log message." into nyc-mr1-dev 2016-09-23 15:34:40 +00:00
Michal Karpinski
369672b8bb Fingerprint Strong auth timeout
am: 0b72a722ed

Change-Id: I70a4c0288aa2d98c02706a055a5dda710ace2ae2
2016-09-23 07:09:59 +00:00
Michal Karpinski
69659cb96d Merge "Fingerprint Strong auth timeout" into nyc-mr1-dev 2016-09-23 07:01:51 +00:00