Commit Graph

578 Commits

Author SHA1 Message Date
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
Adrian Roos
5f8b52cb3e Add WindowConfiguration's bounds to proto
Test: make droid
Change-Id: I8334c51a3ffa6c33340869d24240ede1c9259c51
2019-01-10 14:25:02 +00:00
Yiwei Zhang
0c9ccbe456 Merge "GUP: Update global property for the new dev opt" 2019-01-10 00:33:39 +00:00
Shawn Lin
4505ce946d Merge "Add phase 2 atoms for documentsui" 2019-01-09 06:17:26 +00:00
shawnlin
a75e82d709 Add phase 2 atoms for documentsui
Test: manual
Bug: 111552654

Change-Id: Iabf5e64871aafe885bf2b304a7a0c6e61c8c08da
2019-01-09 09:18:50 +08:00
Yiwen Chen
36e40ff22c Create a new setting in System Settings.Secure class to control whether ramping ringer is used.
Bug: 120789399
Test: When finish the whole change, flash into a dev phone to test first.
Change-Id: I16956f1115dcf5a1657739ad8aa3ab9295b21474
2019-01-08 18:22:32 +00:00
Yiwei Zhang
51015a756b GUP: Update global property for the new dev opt
We updated the development opt in mechanism for GUP. Now we have
GUP_DEV_OPT_IN_APPS for applications selected to use GUP and
GUP_DEV_OPT_OUT_APPS for applications selected not to use GUP.

Bug: 119221883
Test: Build, flash and boot, verify with prototype
Change-Id: I52869ecf9e411a8dbdc1146f00c82023ba41bebf
2019-01-04 11:01:19 +08:00
TreeHugger Robot
a449853e6e Merge "Rename updatable graphics driver to Game Update Package." 2019-01-03 23:06:35 +00:00
Tej Singh
06ba0a7db0 Merge "Migrate statsd to thermal hal v2" 2019-01-03 22:55:41 +00:00
Peiyong Lin
b33ffca825 Rename updatable graphics driver to Game Update Package.
We have rebranded this project to Game Update Package, and GUP for short.

BUG: 119221883
Test: Build, flash and boot. Verify by going to developer options.
Change-Id: If284bd3e0b29cb025833be29fa33179011c151d7
2019-01-02 17:00:00 -08:00
Wale Ogunwale
9e737db3c9 Add support for singleTaskInstance displays
singleTaskInstance displays will only contain on task. This is mostly
used by ActivityView for use cases like bubbles.

Bug: 121047677
Test: atest ActivityManagerMultiDisplayTests#testSingleTaskInstanceDisplay
Change-Id: I5166015d8ecfa2845b4ffaa6c16d21a30a56b8a8
2019-01-02 14:27:05 -08:00
Tej Singh
b6070b9c1c Migrate statsd to thermal hal v2
Part 1 of 2 in migrating statsd to thermal hal v2. Updates the
temperature puller to use thermal hal v2.

Bug: 119228310
Test: adb shell cmd stats pull-source 10021 on blueline. Received 8 cpu
temps, 2 gpu, 1 skin, 1 battery, 1 usb, and 1 npu. Did not receive any
bcl or power amplifier

Change-Id: I8804e282ea928c1815c2a29e72728edf9a053988
2018-12-19 19:05:51 -08:00
Dianne Hackborn
2da290134f Merge "Add package information to association sources." 2018-12-18 23:58:33 +00:00
Dianne Hackborn
24bbe58df6 Add package information to association sources.
This is often known by the system, though not always.  But when
we do know it, it is really useful to maintain that info so we can
do queries like "give me all of the associations that package X is
involved with".

Bug: 121146315
Test: manual
Change-Id: I0dd7aeb9147ecfd65a510d3b2a8bb4a0fbab57e3
2018-12-18 11:09:55 -08:00
TreeHugger Robot
8072b42bc2 Merge "TimeController skips alarms for jobs that wouldn't be ready." 2018-12-15 04:46:23 +00:00
TreeHugger Robot
cb03e4f9f0 Merge "Adding limit for active apps." 2018-12-15 02:29:40 +00:00
Antoan Angelov
4297efb252 Merge changes I0863b40a,I4810f5e3
* changes:
  Add metrics for DevicePolicyManagerService methods (Part 2)
  Add additional event ids for DevicePolicyEvent atom.
2018-12-14 22:05:57 +00:00
Kweku Adams
bffea5a13f TimeController skips alarms for jobs that wouldn't be ready.
If a job runs out of quota, the deadline alarm will not make it ready to
run. Similarly, there are two other implicit constraints (device not
dozing and not-restricted-in-background) that will stop a job from
running even if the deadline constraint has been satisfied. As such, it
doesn't make much sense to set an alarm to wake up the device when those
constraints aren't satisfied. When those constraints are updated,
TimeController is told to recheck its jobs, so this should have no
negative impact on jobs, but should reduce the number of wakeups the
device has from JobScheduler.

Bug: 117846754
Bug: 111423978
Test: atest com.android.server.job.controllers.TimeControllerTest
Change-Id: Ia0c09400079154287dff9ff2ac622d8870ef4110
2018-12-13 22:33:20 -08:00
Kweku Adams
045fb57278 Adding limit for active apps.
Add an overall time limit for all apps, including ACTIVE apps. Right
now, the default is 4 hours per day, so apps can only have their jobs
running for a maximum of 4 hours in a rolling 24 hour window.

Also fix calculation bug where an app could be brought back into quota
despite having less than the quota buffer time available.

Bug: 117846754
Bug: 111423978
Test: atest com.android.server.job.controllers.QuotaControllerTest
Change-Id: Ia0773ef9fe26f0a502fe487f1e11c243eede30b3
2018-12-13 15:23:20 -08:00
Hongming Jin
5172ec1216 Add page id for financial apps sms access.
Bug: 111207447
Test: rebuild
Change-Id: I0adc1ebdee96f1796c80ba55bc54ec4793f16b5e
2018-12-13 11:04:02 -08:00
TreeHugger Robot
1454998ec8 Merge "QuotaController tracking only jobs started in bg." 2018-12-13 04:11:55 +00:00
Hui Yu
b8f2dff7c6 Merge "UsageStats tracking of screen usage." 2018-12-12 20:51:00 +00:00
Hui Yu
03d1240ef3 UsageStats tracking of screen usage.
1. Add UsageStats Event types:
ACTIVITY_RESUMED is synonym to existing MOVE_TO_FOREGROUND.
ACTIVITY_PAUSED is synonym to existing MOVE_TO_BACKGROUND.
ACTIVITY_STOPPED when an activity becomes invisible on the UI.
2. In UsageStats.java, add API getLastTimeVisible() to report last time the
app is visible (ACTIVITY_RESUMED or ACTIVITY_PAUSED), add API getTotalTimeVisible()
to report total time the app is visible.
The existing API getLastTimeUsed() can report last time the app is in
foreground (AKA have focus).
The existing API getTotalTimeInForeground() can report total time the
app is in foreground (AKA have focus).
3. UsageStats.getTotalTimeVisible() can report screen usage for
split-screen mode and picture-in-picture mode.
4. Because in the same package, activity can be instantiated multiple times,
In UsageEvents.Event class, add a member mInstaceId for activity's
instance ID, add interface getInstanceId() to retrieve the instance ID.

Bug: 112002260
Test: frameworks/base/services/tests/servicestests/src/com/android/server/usage/UsageStatsDatabaseTest.java
atest frameworks/base/core/tests/coretests/src/android/app/usage/UsageStatsTest.java

Change-Id: Ibcef2488e9620804c9f9220b027f976e8fa0c98b
2018-12-12 10:07:14 -08:00
arangelov
6145acc3a3 Add additional event ids for DevicePolicyEvent atom.
Test: None
Bug: 120853676
Change-Id: I4810f5e3ee884dccf2356fac4f4109207e7cfa3b
2018-12-12 16:35:18 +00:00
Arc Wang
0a69b87dff Merge "Add Wi-Fi DPP metrics category constants." 2018-12-12 01:45:31 +00:00
Kweku Adams
cc5afbc8a1 QuotaController tracking only jobs started in bg.
We don't want to penalize apps for starting jobs while in the foreground
so QuotaController now only tracks jobs that started while the uid
wasn't active.

Bug: 117846754
Bug: 111423978
Test: atest com.android.server.job.controllers.QuotaControllerTest
Change-Id: Icc36a361a466571af75b74c0cd9c976c6c321b43
2018-12-11 15:31:25 -08:00
Badhri Jagan Sridharan
5b0bc1f7f0 Merge changes from topic "118783261"
* changes:
  Log connection duration.
  Log UsbConnectorStateChanged events
2018-12-11 16:40:01 +00:00
Arc Wang
b16327ab2e Add Wi-Fi DPP metrics category constants.
Bug: 118794858
Bug: 118797380

Test: NA
Change-Id: I5fdd7d107fec621086a3d0a1ab31a0dfc7f1a277
2018-12-11 01:59:34 +00:00
arangelov
1302e2d2b1 Add WifiService add networks enums.
Test: None
Bug: 119911940
Change-Id: I688a48479dbfb8ae2e1773eab2284910a0cfe217
2018-12-10 22:29:20 +00:00
Annie Meng
a6d828755e [Multi-user] Create setting for multi-user backup service support
Whether the backup service supports multi-user is now configured in a
Global setting: backup_multi_user_enabled

This allows us to develop multi-user support hidden behind a flag. In a
future CL, we'll also gate the types of users we support.

Also create basic infrastructure for starting the service for a newly
unlocked user (currently a no-op).

Bug: 120212806
Test: 1) atest TrampolineTest
2) adb shell settings put global backup_multi_user_enabled 0;
   unlock system user -> verify service started;
   unlock user 10 -> verify service not started;
3) adb shell settings put global backup_multi_user_enabled 1;
   unlock system user -> verify service started;
   unlock user 10 -> verify service started;

Change-Id: I048e017cfa6148097cebe2eb2916d1b53c53d3b0
2018-12-10 12:33:28 +00:00
Shawn Lin
029e4efc6b Merge "Migrate docsui tron metrics to westworld" 2018-12-10 08:10:54 +00:00
Tim Van Patten
3c61284416 Update ANGLE Developer Options
Update ANGLE developer options to allow selecting the OpenGL driver
(default, ANGLE, native) for each app as well as forcing ANGLE for all
apps.

Bug: 118384925
Test: Verify the default/ANGLE/native values are saved and applied and
used by the loader.

Change-Id: I189889b9b780eabe812298c0dd02838f70f97a03
2018-12-07 21:06:58 +00:00
Wei Wang
c90e979d6e Merge "Throttle jobs when thermal status is in THROTTLING_SEVERE and above" 2018-12-07 19:17:40 +00:00
Milo Sredkov
0b243df366 Merge "Create SMART_SUGGESTIONS_IN_NOTIFICATIONS_FLAGS" 2018-12-07 14:13:47 +00:00
Antoan Angelov
b1910c47a8 Merge "Improve naming of some of the constants in device_policy_enums." 2018-12-07 12:42:37 +00:00
Wei Wang
8c0c3c10ec Throttle jobs when thermal status is in THROTTLING_SEVERE and above
Bug: 116541003
Test: manually lower thermal thresholds on Pixel3
Change-Id: I26344716e2b6d84a04d9da02493673cc48c2854d
2018-12-06 21:30:11 -08:00
Felipe Leme
132b1c6002 Merge "Yet another (major) refactoring on Content Capture and Augmented Autofill." 2018-12-07 04:18:44 +00:00
TreeHugger Robot
4ea51d1b7a Merge "Add dual dumping for RoleManagerService." 2018-12-07 02:22:26 +00:00
TreeHugger Robot
bc4ae58461 Merge "Add new metrics constant for disable developer options" 2018-12-07 02:05:41 +00: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
Hai Zhang
33456fbfd7 Add dual dumping for RoleManagerService.
This change adds dual dumping for RoleManagerService.

Bug: 110557011
Test: adb shell dumpsys role
Change-Id: I2782cd896df5d79274963785e46d04a295d83f7f
2018-12-06 15:05:29 -08:00
arangelov
1476826d99 Improve naming of some of the constants in device_policy_enums.
Also add 4 new types of metrics.

Test: None
Bug: 119911940
Change-Id: Iecc5298f5cb611a878aad22a0ea91208ac134e38
2018-12-06 23:03:00 +00:00
Fan Zhang
1e31f82a48 Merge "Add bluetooth constants for Contextual Home Page" 2018-12-06 17:59:30 +00:00
Milo Sredkov
d8cacd5bec Create SMART_SUGGESTIONS_IN_NOTIFICATIONS_FLAGS
Create Global.SMART_SUGGESTIONS_IN_NOTIFICATIONS_FLAGS. This will
contain flags that control the automatic generation of suggestions in
notifications (smart actions and smart replies).

Bug: 111437455
Test: atest SettingsBackupTest
Change-Id: I91252d3e0f3d51000f6115a520d7054832fda1ce
2018-12-06 15:07:39 +00:00
shawnlin
ea5b66be7b Migrate docsui tron metrics to westworld
add docsui atoms

Test: manual
Bug: 111552654
Change-Id: I232be950281423a38763b6be1b70f70090d4e61b
2018-12-06 15:15:19 +08:00
Kweku Adams
fa1c305db0 Merge "Core QuotaController implementation." 2018-12-06 01:58:21 +00:00
Dianne Hackborn
77b13fd30a Merge "Fix various issues in ordering of grouped bindings." 2018-12-06 00:44:24 +00:00
Dianne Hackborn
2f55e5a929 Fix various issues in ordering of grouped bindings.
Everything needed to get the CTS tests to work.

Also:

- Change process names to be unique per isolated instance,
  and no longer use isolated uid in proc stats, so we don't
  have a crazy number of process entries there.
- Again move activity manager dumpsys output so we aren't
  spewing less useful stuff at the end where it hides the
  core state about processes.
- Fix protos so that we can read InstrumentationInfo from the
  activity manager protos.  (There was confusion about writing
  protos for a PackageItemInfo vs. an ApplicationInfo.)

Test: atest CtsAppTestCases:ServiceTest\#testActivityServiceBindingLru
Bug: 111434506
Change-Id: I2c86bd1daa582a5c60950173ca12e8ec21b13ead
2018-12-05 11:03:58 -08:00
TreeHugger Robot
0492440cd9 Merge "Changed how the Smart Suggestions service is defined." 2018-12-05 16:15:50 +00:00
Yanting Yang
7eb3b0962f Add bluetooth constants for Contextual Home Page
We would like to use these bluetooth constants in bluetooth devices
slice card of Contextual Home Page.

Bug: 114807655
Test: robotest
Change-Id: Id39080c3cd77fd625f7768700a5c612b5558c7e1
2018-12-05 21:51:48 +08:00