Commit Graph

1399 Commits

Author SHA1 Message Date
Raff Tsai
5ee178af9f Enable settings_work_profile feature
Bug: 141601408
Test: rebuild
Change-Id: Ie99b25fdbd365b3823577374cedae20e48b8af2e
2019-11-20 12:13:23 +08:00
TreeHugger Robot
6b8f486bd5 Merge "Extract SparseArrayMap from QuotaController." 2019-11-19 18:31:06 +00:00
Artur Satayev
785d3a03b9 Merge "Add @UnsupportedAppUsage annotations for greylist." 2019-11-19 15:05:51 +00:00
Artur Satayev
751e55114c Add @UnsupportedAppUsage annotations for greylist.
go/cleanup-greylist-txt

These have already been greylisted, however due to bugs/omissions in the tooling have been kept in go/greylist-txt instead of being annotated in the code.

This is partial merge of aosp/Id6c1f5e403a0e66edb1102ee45f3bf19f244fb09. Telephony greylist cleanup has been done separately. Note that annotations outside of frameworks/base/ have been merged from AOSP.

Bug: 137350495
Test: m
Exempt-From-Owner-Approval: merge
Change-Id: I015c466e8b69cc0fed5e9d394ba865aad11d8ba6
2019-11-19 15:05:35 +00:00
Kweku Adams
a26ae90b4d Extract SparseArrayMap from QuotaController.
This structure can be useful in other parts of the system, so extracting
it and making it more generic makes sense.

Bug: 135764360
Bug: 141645789
Test: atest QuotaControllerTest
Test: atest SparseArrayMapTest
Change-Id: I2aeb3ea53e3dc2ec00667a0a2ccdb112cf562377
2019-11-18 17:58:00 -08:00
Adam Bookatz
b9a57da94c Merge "Introduce user types" 2019-11-15 19:15:37 +00:00
Bookatz
029832a951 Introduce user types
Introduces the notion of 'user types' to UserManager.
Previously, users only had properties, set by UserInfo flags. We now
solidify some of these as formal user types. Each user must be of
precisely one user type. The configuration of each type is defined
in a UserTypeDetails object.

Prior 'types' - namely Guest, Restricted, ManagedProfiles, Demo, and
'normal' - that were set via UserInfo flags are now controlled via
UserType. Previous UserInfo flag methods for categorizing these are
still supported as long as no user of of more than one type.

If a user was (e.g.) previously both Guest and Demo, it is now
invalid and will be prevented from upgrading. This should not be a
problem in AOSP, where these 'types' were assumed mutually exclusive.

UserTypeDetails is sufficiently general to support future non-managed
profiles. To this end, the logic for specifying badges and their
colors/labels is contained by UserTypeDetails, and therefore
UserManager is responsible for delivering the corresponding badge
information.

Bug: 142151520

Test: added new test class UserManagerServiceUserTypeTest
Test: added additional tests in UserManagerServiceUserInfoTest
Test: added additional tests in UserManagerTest
Test: added additional tests in UserManagerServiceCreateProfileTest
Test: created UserTests to run the various pm.User*Test's

Test: atest \
  com.android.server.pm.UserTests \
  UserLifecycleTests \
  ManagedUserContentResolverTest \
  CtsDevicePolicyManagerTestCases \
  CtsMultiUserHostTestCases \
  com.android.server.devicepolicy.DevicePolicyManagerTest \
  com.android.server.am.UserControllerTest \
  CreateManagedProfileTaskTest

Test: atest com.android.server.pm.UserManagerServiceCreateProfileTest
   using adb shell getprop persist.sys.max_profiles # for 5 and -1

Change-Id: Id1183a76055e9a7610965cf40b256d1392afe6f8
2019-11-14 10:00:50 -08:00
Tej Singh
5918429fa2 Java API for pulled atoms
This creates a java API for registering pullers. Will implement the
statsd side in a follow up CL.

Test: builds, boots
Change-Id: Ib6735984297ce3148839a6370a3c15b2a585baf5
2019-11-13 13:22:27 -08:00
Joshua Baxter
c7f58bea61 Merge "docs: fix code example" into qt-dev am: 330701c156 am: e53e500eac am: ce02f1c4ac
am: f23b8cedd7

Change-Id: I0291d6504e64e29aff8a20ec5b9a09df8c092ad0
2019-11-12 18:30:22 -08:00
Joshua Baxter
f23b8cedd7 Merge "docs: fix code example" into qt-dev am: 330701c156 am: e53e500eac
am: ce02f1c4ac

Change-Id: If0426ae0547b15b106dc3e7fdfff94e94904f9e8
2019-11-12 18:21:10 -08:00
Joshua Baxter
e53e500eac Merge "docs: fix code example" into qt-dev
am: 330701c156

Change-Id: I4f2ea4c128b2019d48b129f20bf8a800fc6b6fce
2019-11-12 18:04:50 -08:00
TreeHugger Robot
330701c156 Merge "docs: fix code example" into qt-dev 2019-11-13 01:26:15 +00:00
Sunny Shao
b2e89157ae Add a feature flag for controller loading enhancement
Bug: 137558156
Test: manual test
Change-Id: I533f56a95fdbb5db54042768b4d337a79236fdfb
2019-11-13 08:48:56 +08:00
TreeHugger Robot
8a505cde0a Merge "Make StatsEvent.newBuilder() static" 2019-11-12 22:19:34 +00:00
Muhammad Qureshi
c018087c59 Make StatsEvent.newBuilder() static
Bug: 141696033
Test: m -j
Change-Id: I660a4384f037327ba475e3badd7cba7fea7f77a5
2019-11-12 12:55:14 -08:00
Joshua Baxter
0f442f729b Merge "docs: fix typo" into qt-dev am: aee0f9c343 am: bdaa73c0f9 am: 8c5d022296
am: 145de3be7e

Change-Id: I2866e06b5012d092a966978fcf9bfd03d423f715
2019-11-11 17:40:30 -08:00
Joshua Baxter
145de3be7e Merge "docs: fix typo" into qt-dev am: aee0f9c343 am: bdaa73c0f9
am: 8c5d022296

Change-Id: Ibfb5b9a2add0e5cc5ceb6d1ec91afee432a726b5
2019-11-11 17:31:39 -08:00
Joshua Baxter
bdaa73c0f9 Merge "docs: fix typo" into qt-dev
am: aee0f9c343

Change-Id: Iba7623797bfd340fce0b24f6bbf669898feb8e26
2019-11-11 17:22:35 -08:00
Joshua Baxter
6b5e85dcb3 docs: fix code example
bug: 135556269

Change-Id: I9ba7a0f7de0322ba5e82413c0a95dffbef5a6236
test: make ds-docs
2019-11-11 21:55:05 +00:00
Joshua Baxter
9c69b40e2e docs: fix typo
bug: 119479852

Change-Id: I5c2c31432446ef6fccf3ac80e44a1660654375c0
Test: make ds-docs
2019-11-08 22:57:39 +00:00
Artur Satayev
fc46be7dbd Add @UnsupportedAppUsage annotations for greylist.
go/cleanup-greylist-txt

These have already been greylisted, however due to bugs/omissions in the tooling have been kept in go/greylist-txt instead of being annotated in the code.

Bug: 137350495
Test: m

Change-Id: Id6c1f5e403a0e66edb1102ee45f3bf19f244fb09
Merged-In: Id6c1f5e403a0e66edb1102ee45f3bf19f244fb09
2019-11-08 16:17:13 +00:00
Muhammad Qureshi
541ed6fd90 Merge "Add KeyValuePairs support to StatsEvent." 2019-11-06 17:16:30 +00:00
Muhammad Qureshi
87239b4c69 Add KeyValuePairs support to StatsEvent.
- Expose atom id in StatsEvent.
- Sync constants with native stats_event.

Bug: 143079343
Bug: 143286399
Test: m -j
Change-Id: Icaa2d90b40d5da7571444182ead03b54b7b25867
2019-11-05 13:24:01 -08:00
Raff Tsai
934201ad40 Remove deprecated feature flag
Bug: 142920912
Test: rebuild
Change-Id: Ib4d733c24ef557360040c400708ed22276c1e072
2019-11-05 08:26:44 +00:00
Muhammad Qureshi
2ae836d45e Merge "Add StatsEvent.Builder" 2019-10-31 16:56:04 +00:00
Philip P. Moltmann
badc09c7a5 Correctly parcel LongSparseArray<String>
Before we just cast Object[] to String[]. This crashes. Now we are
casting the individual objects->strings.

Test: Parceled LongSparseArray
Change-Id: I24883a1dad49c0682977da1aea2370eddb001173
2019-10-24 12:19:31 -07:00
Muhammad Qureshi
d09bc74d01 Add StatsEvent.Builder
Use a builder to construct StatsEvent objects.
Make StatsEvent immutable.
Wrap socket byte array in a Buffer class with write methods for
primitives.
Implement socket schema at go/statsd-socket-doc
StatsEvent.java design doc at go/statsevent-java-doc

Bug: 141696033
Test: m -j
Change-Id: Ief4890882de66d5dcca71b3827ffa1f43ea628a8
2019-10-21 16:33:03 -07:00
TreeHugger Robot
08fddb89b5 Merge "Migration to bugreport API complete and stable" 2019-10-21 17:01:44 +00:00
Abhijeet Kaur
b1319ed6fe Migration to bugreport API complete and stable
Remove bugreport API feature flag as it is no longer used.

Test: Full/Interactive bugreport work as expected
Test: `adb bugreport` works as expected
Bug: 139415553
Bug: 133494536
Change-Id: I4d6c66a6b101d14336dca459a3aba8e02dbca675
2019-10-18 09:58:48 +01:00
Philip P. Moltmann
59076d8957 Add feature context
Currently only used by app-ops, but can be used by other modules too.

AppOps will collect app-ops based on feature. Only the most basic
parts of app-ops are supporting features yet. The rest will be added
later.

Test: atest CtsAppOpsTestCases
      atest RunSettingsLibRoboTests
      atest com.android.server.wm.ActivityStarterTests
      m -j doc-comment-check-docs
Bug: 136595429
Change-Id: Ia664f4ff1c1c2ceea721d76dc491ec50c237e9ce
2019-10-17 14:15:07 -07:00
Neil Fuller
2505d7580c Merge "Make TimestampedValue Parcelable" am: 81a705690b am: 209c74f8b6 am: 4055cdd965
am: bfe51f8b64

Change-Id: Ied15954c16a1661db7b0d379e1ca71fa7e2c5694
2019-10-14 12:03:18 -07:00
Neil Fuller
209c74f8b6 Merge "Make TimestampedValue Parcelable"
am: 81a705690b

Change-Id: I68edcf15ec9bef69a26267d9bf0c036e38ce93d4
2019-10-14 11:43:18 -07:00
Sudheer Shanka
c04092f108 Merge "Fix NetworkPolicyManager unit tests." 2019-10-14 18:41:25 +00:00
Treehugger Robot
81a705690b Merge "Make TimestampedValue Parcelable" 2019-10-14 18:33:43 +00:00
Sudheer Shanka
c0f85c1001 Fix NetworkPolicyManager unit tests.
Bug: 137859686
Test: atest core/tests/coretests/src/android/net/NetworkPolicyManagerTest.java
Test: atest services/tests/servicestests/src/com/android/server/net/NetworkPolicyManagerServiceTest.java
Change-Id: I38a935c71bfb1f78739d508b400e43dc1b52bef5
2019-10-12 15:06:05 -07:00
Neil Fuller
def77b5cd5 Make TimestampedValue Parcelable
Make TimestampedValue Parcelable for simplicity.

TimetampedValue objects are not generally parcelable, depending on the
type of the value held. Previously, TimestampedValue did not implement
Parcelable to avoid committing to a general contract. Developers
parceling TimestampedValue objects were expected to call
TimestampedValue.writeToParcel() / TimestampedValue.readFromParcel()
explicitly when they knew it was safe to do so. This also meant that
TimestampedValues couldn't be used directly via AIDL.

This change makes TimestampedValue parcelable because it's more
familiar / convenient. Attempts to marshall a TimestampedValue that
contains a non-parcelable value will still throw a RuntimeException.

Bug: 140712361
Test: atest android.util.TimestampedValueTest
Change-Id: I8ca9c72f0433b380ce720cd813f650e743b3ddae
2019-10-10 10:16:41 +01:00
TreeHugger Robot
7e30a95e66 Merge "Add feature to enable separate personal/work profile settings" 2019-10-09 09:49:07 +00:00
Valentin Iftime
67d9805fed resolve merge conflicts of 484e166df3 to master
Test: I solemnly swear I tested this conflict resolution.
Bug: None
Change-Id: Ia9db1400207d9196012362c480ede059e94184af
2019-10-08 22:21:44 +02:00
Muhammad Qureshi
0d24da19a9 Merge "First draft of StatsEvent.java" 2019-10-08 17:29:13 +00:00
Iavor-Valentin Iftime
99d866acff Merge "API to detect which network interfaces support wake-on-lan"
am: 311fc569f3

Change-Id: I6239ae68559290e31f8c9384e0f973cfea30a1c7
2019-10-08 08:23:23 -07:00
Valentin Iftime
c86ebbaebc API to detect which network interfaces support wake-on-lan
Add a new method in LinkProperties, isWakeOnLanEnabled() which returns
true if network interface is defined in config_wakeonlan_enabled_interfaces
string-array (config.xml)

Bug: 132705025
Test: atest LinkPropertiesTest & atest ConnectivityServiceTest
Change-Id: I3f7803aafd2f8eaf8aa18419b21339e15d4b7a0b
2019-10-08 13:03:30 +02:00
Muhammad Qureshi
dc6747c6d7 First draft of StatsEvent.java
The actual APIs are subject to change once socket encoding is finalized
and StatsEvent needs to be marked as @SystemApi. This will be addressed
in a future CL.

Test: builds successfully
Bug: 141696033
Change-Id: I508fa3d2f84850438562d01c78155590819badca
2019-10-07 16:02:00 -07:00
Raff Tsai
f217b16925 Change owner
Test: build
Change-Id: I322944206da110da18765f593e6658a4383afdb7
2019-10-07 17:54:51 +08:00
Raff Tsai
7dfe9deccc Add feature to enable separate personal/work profile settings
Bug: 141601408
Test: build pass
Change-Id: I823d2c5067694c5bd49fac680529b597185d5b64
2019-10-07 10:01:05 +08:00
TreeHugger Robot
ad324a3d7e Merge "Merge qt-r1-dev-plus-aosp-without-vendor (5817612) into stage-aosp-master" into stage-aosp-master 2019-09-11 20:31:32 +00:00
Neil Fuller
d046fb26f4 Merge "Track changes to CountryTimeZones API" am: 28b12c347c am: c30eabfadb am: f19b9eecde
am: b82115befc

Change-Id: I337c1c16966087cc89b9717e2cd4904d18c5e2bc
2019-09-11 04:47:53 -07:00
Neil Fuller
f19b9eecde Merge "Track changes to CountryTimeZones API" am: 28b12c347c
am: c30eabfadb

Change-Id: I185a81a7fe58337f6f6cc94f0d2a7d2fd56c0fa3
2019-09-11 04:25:49 -07:00
Xin Li
d57e959e71 Merge qt-r1-dev-plus-aosp-without-vendor (5817612) into stage-aosp-master
Bug: 135460123
Change-Id: I65906d82b14125c0893d5cde0cfebb73bf9e38ab
Merged-In: I1f2564837c33cd4c6c3db6aac3cbaf8c09707da9
2019-09-10 11:16:29 -07:00
Neil Fuller
e5c466d3f5 Merge "Simplify APIs exposed for time zone lookups" am: 07dcc4bc0f
am: a7d5a3220a

Change-Id: I058dbe387bbebe61eb03507e64285fa27f0b7108
2019-09-10 04:17:20 -07:00
Neil Fuller
1fb1a378d1 Track changes to CountryTimeZones API
Track changes to CountryTimeZones.lookupByOffsetWithBias()
API: the method now takes an extra argument: dstOffsetMillis,
which is unused in this case.

This commit also improves the parameter names to be more descriptive.

Bug: 139091367
Test: treehugger
Change-Id: I2090965640bb389ea41bde460f380f9ea8a6b176
2019-09-10 11:57:48 +01:00