Commit Graph

1428 Commits

Author SHA1 Message Date
Yi-Ling Chuang
afc4d88a96 Add a feature flag for Settings conditionals removal.
Bug: 142927361
Test: rebuild and manual
Change-Id: I4cfce774f717ae15af1ea321dbb645561d77c4aa
2019-12-13 12:06:53 +08:00
Jeffrey Huang
cd5c5990d2 Merge "Rename IStatsManager to IStatsd" 2019-12-12 21:47:47 +00:00
Automerger Merge Worker
876469ea3a Merge "Expose CloseGuard as a public API" am: 4314616565 am: 37f8e04de9 am: 58745b4dcc
Change-Id: I40a7e24b9e77c27a954ab4394b47ac75a4681760
2019-12-12 19:12:27 +00:00
Automerger Merge Worker
58745b4dcc Merge "Expose CloseGuard as a public API" am: 4314616565 am: 37f8e04de9
Change-Id: I42faa5840cb92a7c5c549e41f5cb03660165d9f4
2019-12-12 18:45:43 +00:00
David Su
4314616565 Merge "Expose CloseGuard as a public API" 2019-12-12 18:19:12 +00:00
TreeHugger Robot
25c621b432 Merge "Remove deadcode in VerityBuilder" 2019-12-12 05:32:30 +00:00
Jeffrey Huang
161c075d99 Rename IStatsManager to IStatsd
Bug: 146075178
Test: CTS/GTS tests
Change-Id: I235944758b8cc24a0df85b54d7441e7e8d0a8bbc
2019-12-11 15:49:03 -08:00
Ruchir Rastogi
25e2b42a6b Remove StatsEvent.h/cpp and StatsEvent.aidl
As of ag/9820253, Binder communication between pull atom clients and
statsd uses the structured StatsEventParcel. The custom parcelable
StatsEvent class is not needed anymore.

Test: m
Change-Id: I33aa975a2cd1b02ba232aadc11e2ac58814de4c3
2019-12-11 15:10:58 -08:00
Victor Hsieh
5f01de427b Remove deadcode in VerityBuilder
generateFsVerityTree is never used now, thus and code path for
skipSigningBlock == false is dead.

Test: build
Bug: N/A
Change-Id: I32a3a0ad50aae6fb47ae4af2f70a5114d832b907
2019-12-11 22:02:29 +00:00
TreeHugger Robot
5e68b5c709 Merge "Fix StatsEvent memory usage for pulled events" 2019-12-10 23:18:07 +00:00
David Su
0c472adb0d Expose CloseGuard as a public API
Wrap dalvik.system.CloseGuard and expose it as a
public API from android.util.

Bug: 145831809
Test: atest CloseGuardTest
Change-Id: Ia44c84a69a5fb693fb8bb1a075c18a60253cedfc
2019-12-10 13:46:24 -08:00
Muhammad Qureshi
9e829804e1 Fix StatsEvent memory usage for pulled events
Add usePooledBuffer flag to the Builder which determines whether to reuse
the Buffer's byte array in StatsEvent or use a copy.
The build() function also calls release() on the Buffer
if a copy of the Buffer's byte array is passed to StatsEvent.

Also, for pushed events, release the StatsEvent object and consequently,
the Buffer in StatsLog.write(StatsEvent)

Fixes: 145026572
Fixes: 144126444
Test: bit FrameworksCoreTests:android.util.StatsEventTest
Change-Id: I1cdaf0027b69281cb7cb6f3c8ca923d03829b4dd
2019-12-10 13:27:38 -08:00
Neil Fuller
7daba13fc0 Merge "Extend LocalLog to enable UTC timestamps" am: 9436134056 am: c74594a2e3
am: 746d69afa5

Change-Id: I167f79a33218c5b6593c165f9185663f965dcdcd
2019-12-10 01:54:49 -08:00
Neil Fuller
746d69afa5 Merge "Extend LocalLog to enable UTC timestamps" am: 9436134056
am: c74594a2e3

Change-Id: I417bf9581e3fbce9921e7893c1e63e6dd9a7b30b
2019-12-10 01:50:39 -08:00
Neil Fuller
a7453c69b2 Extend LocalLog to enable UTC timestamps
Extend LocalLog to enable UTC timestamps with elapsed realtime clock
info too.

Switch time-related usages over to using UTC timestamps. This will make
debugging a lot easier when the code doing the logging is responsible
for changing the system clock and default time zone.

Test: treehugger only
Bug: 140712361
Change-Id: Ic6b12f9032c0c3ebc48f12a970a7b4dd398e7fec
2019-12-09 17:02:44 +00:00
Gavin Corkery
dd1dabaef7 Log watchdog-initiated rollback reason
To help with monitoring Mainline releases, log the reason
for a watchdog-initiated rollback. This may be due to
native crashes, app crashes, ANRs or explicit health check
failures.

Add a mapping from PackageWatchdog failure reason to the
new metrics.

Bug: 138782888
Test: atest PackageWatchdogTest
Test: atest StatsdHostTestCases
Change-Id: Ia3e73d955508297004591eac762555665c557b8a
2019-12-09 10:40:01 +00:00
Ruchir Rastogi
cd9dd94fb1 StatsEventParcel impl.; move AIDL files
This implementation continue to uses libbinder, as opposed to
libbinder_ndk.

We also move many (but not all) statsd aidl files from
frameworks/base/core into the apex.

Test: m -j128 && bit statsd_test:*
Change-Id: I95f06e937e50c1e2a638163b13587682402956a7
2019-12-06 14:08:27 -08:00
Muhammad Qureshi
d265088259 Fix error handling in StatsEvent
Bug: 143286399
Test: bit FrameworksCoreTests:android.util.StatsEventTest
Change-Id: I2159bf138a307e45c44102a8feb7a69d0c793843
2019-12-05 18:07:12 -08:00
Muhammad Qureshi
f11130cfa0 Add JNI call for writing StatsEvent to statsd.
Bug: 143978873
Test: m -j
Test: flashes successfully
Test: DocumentsUI(a Mainline module) is able to successfully log to statsd
Change-Id: I9cdc6151d8feb29a712532e50f143af9d52c8d94
2019-12-02 23:25:47 -08:00
Abhijeet Kaur
3e4c9c4661 Merge "Add a new persistent FUSE flag in Settings" 2019-12-02 15:48:27 +00:00
Abhijeet Kaur
b984771e99 Add a new persistent FUSE flag in Settings
New system property settings_fuse enables user to switch persist.sys.fuse
flag on/off from Settings UI. New system property is added as the
Settings UI sets system property with a fixed prefix
(persist.sys.fflag.override.) for persistent properties and for
consistency we do not want to rename persist.sys.fuse.

The user needs to restart the device after toggling the flag from
Settings UI. When the device restarts for the first time,
persist.sys.fuse is set from settings_fuse when the
StorageManagerService starts. If the value of persist.sys.fuse is
modified, then the device reboots for it to take effect.

The 2 reboots take almost the same time as 1 reboot and the difference is
not noticeable to the user as the lock screen does not show up in
between the 2 reboots.

This change would also mean that the newly added flag
(persist.sys.fflag.override.settings_fuse) will always override
persist.sys.fuse (as it is always checked on reboot), which implies that
`adb shell setprop persist.sys.fuse [true/false] && adb reboot` will
have no effect.

Bug:144419848
Test: * Enable developer options in Settings.
      * Go to Settings->System->Advanced->Developer Options->Feature Flags.
      * Turn on (off by default) settings_fuse toggle button and
        restart.
      * After reboot run `adb shell getprop persist.sys.fuse` shows
        true.
      * Turn off settings_fuse from Settings UI and reboot
      * After reboot run `adb shell getprop persist.sys.fuse` shows
        false.
Test: Using adb command to change the fuse system property.
      * `adb shell setprop persist.sys.fflag.override.settings_fuse
         true && adb reboot`
      * After reboot run `adb shell getprop persist.sys.fuse` shows true
      * Similarly for false case.
Change-Id: I0093d2b020a9d8ffeec7fca31a44ef2e65b4dfb4
2019-11-29 15:20:11 +00:00
Sudheer Shanka
069e57e0aa Merge "Fix NetworkPolicyManager unit tests." am: da3518bc6b
am: 1381de466a

Change-Id: I474180a603338a1f980b327f183dac8131577330
2019-11-26 19:10:50 -08:00
Sudheer Shanka
2d1ab90aa2 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
Merged-In: I38a935c71bfb1f78739d508b400e43dc1b52bef5
(cherry picked from commit 6ec3caf218)
2019-11-27 02:50:03 +00:00
TreeHugger Robot
fa1d8bc360 Merge "Address API feedback." 2019-11-25 19:46:04 +00:00
Kweku Adams
ed1cfed835 Address API feedback.
Add @param and @return to new SparseArray.contains() method.

Bug: N/A
Test: N/A
Change-Id: I81460524f29628a4ce1e47b1510c2887fa51717d
2019-11-25 09:53:51 -08:00
Charles Munger
6562afcd52 Merge "Deprecate TimingLogger" am: aec0ab99d4 am: 416618a591
am: d1c3f26e59

Change-Id: I28aeac2c4ebad13a23b20e22ff31674f61ba17c7
2019-11-25 07:28:40 -08:00
Charles Munger
d1c3f26e59 Merge "Deprecate TimingLogger" am: aec0ab99d4
am: 416618a591

Change-Id: Id637c04d15e48a928b7ff05a3133dbb5cf103656
2019-11-22 12:57:53 -08:00
Muhammad Qureshi
3e301e8c1b Change visibility of members in StatsEvent
- Rename writeAttributionNode to writeAttributionChain
- Make Type Id, size limit constants public and @hide for testing
- Change visibility of StatsEvent package protected functions to public

Bug: 141696033
Test: m -j
Change-Id: Ia4818f621672d469390bf7654bdd317f0cd11692
2019-11-21 17:44:22 -08:00
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
Charles Munger
81c262b6d9 Deprecate TimingLogger
Bug: 144042891
Test: No behavior changes
Change-Id: I78af3549a2bf56eb709c52483c97acc5ddb15e87
2019-11-18 10:51:17 -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