Commit Graph

16280 Commits

Author SHA1 Message Date
Svetoslav Ganov
77591d9942 Merge "Runtime permission attribution improvements" into sc-dev am: a6c3d6ad39
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13692058

Change-Id: Ibad155ee212f6e71800e288a44bbed6012d32838
2021-03-29 21:05:00 +00:00
Svetoslav Ganov
a6c3d6ad39 Merge "Runtime permission attribution improvements" into sc-dev 2021-03-29 21:03:06 +00:00
Siim Sammul
be6eacd120 Merge "Push the latency histograms to statsd" 2021-03-29 20:50:45 +00:00
Jeff DeCew
b558a615a1 Merge "Fix color filter on NotificationExpandButton's chevron" into sc-dev am: 2ea75ab9ce
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14019045

Change-Id: I4cd18b79696636a228bc3a296fe7e5f44e7d7e7b
2021-03-29 20:32:17 +00:00
Jeff DeCew
2ea75ab9ce Merge "Fix color filter on NotificationExpandButton's chevron" into sc-dev 2021-03-29 19:20:15 +00:00
Siim Sammul
a28ccaf373 Push the latency histograms to statsd
Test: unit tests, verified atom logging with statsd_testdrive
Bug: 180584913

Change-Id: I0b8db72c0cb3b285177bbe402ce37639c468dbf3
2021-03-29 18:04:21 +01:00
Svet Ganov
8d2ed50604 Runtime permission attribution improvements
When an app is proxying access to runtime permission protected
data it needs to check whether the calling app has a permission
to the data it is about to proxy which leaves a trace in app ops
that the requesting app perofmed a data access. However, then the
app doing the work needs to get the protected data itself from the
OS which access gets attributed only to itself. As a result there
are two data accesses in app ops where only the first one is a
proxy one that app A got access to Foo through app B - that is the
one we want to show in the permission tracking UIs - and one
for the data access - that is the one we would want to blame on
the calling app, and in fact, these two accesses should be one -
that app A accessed Foo though B. This limitation requires fragile
one off workarounds where both accesses use the same attribution
tag and sys UI has hardcoded rules to dedupe. Since this is not
documented we cannot expect that the ecosystem would reliably
do this workaround in apps that that the workaround in the OS
would be respected by every OEM.

This change adds a mechaism to resolve this issue. It allows for
an app to create an attribution context for another app and then
any private data access thorugh this context would result in a
single app op blame that A accessed Foo though B, i.e. we no longer
have double accounting. Also this can be nested through apps, e.g.
app A asks app B which asks app C for contacts. In this case app
B creates an attribution context for app A and calls into app C
which creates an attribution context for app B. When app C gets
contacts the entire attribution chain would get a porper, single
blame: that C accessed the data, that B got the data from C, and
that A got the data form B. Furthermore, this mechanism ensures
that apps cannot forget to check permissions for the caller
before proxying private data. In our example B and C don't need
to check the permisisons for A and B, respectively, since the
permisisons for the entire attribution chain are checked before
data delivery. Attribution chains are not forgeable preventing
a bad actor to create an arbitrary one - each attribution is
created by the app it refers to and points to a chain of
attributions created by their corresponding apps.

This change also fixes a bug where all content provider accesses
were double counted in app ops due to double noting. While at
this it also fixes that apps can now access their own last ops.
There was a bug where one could not pass null getting the attributed
ops from a historical package ops while this is a valid use case
since if there is no attribution everything is mapped to the null
tag. There were some app op APIs not being piped thorough the app
ops delegate and by extension through the app ops policy. Also
now that we have nice way to express the permission chain in a
call we no longer need the special casing in activity manager to
handle content provider accesses through the OS. Fixed a bug
where we don't properly handle the android.os.shell calls with
an invlaid tag which was failing while the shell can do any tag.

Finally, to ensure the mechanims is validated and works end-to-end
we are adding support for a voice recognizer to blame the client
app for the mic access. The recognition service can create a blaming
context when opening the mic and if the mic is open, which would
do all permission checks, we would not do so again. Since changes
to PermissionChercker for handling attribution sources were made
the CL also hooks up renounced permissoins in the request permission
flow and in the permission checks.

bug:158792096
bug:180647319

Test:atest CtsPermissionsTestCases
     atest CtsPermissions2TestCases
     atest CtsPermissions3TestCases
     atest CtsPermissions4TestCases
     atest CtsPermissions5TestCases
     atest CtsAppOpsTestCases
     atest CtsAppOps2TestCases

Change-Id: Ib04585515d3dc3956966005ae9d94955b2f3ee08
2021-03-29 16:49:33 +00:00
Jeff DeCew
a29c7b91a6 Fix color filter on NotificationExpandButton's chevron
Bug: 181048615
Test: visual
Change-Id: I7a9a9943e091f8a60b9a77836a946a38f5b570d6
2021-03-29 10:55:20 -04:00
Peter Li
d3b9b7d0f5 Merge "Add callback to report HotwordDetectionService status" into sc-dev am: 378b540fa1
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13974087

Change-Id: Idc441a5d54c25e58803bc4d8e609c57514a5416f
2021-03-29 12:04:21 +00:00
lpeter
6f2a263810 Add callback to report HotwordDetectionService status
Bug: 182788844
Test: Test: atest CtsVoiceInteractionTestCases
Test: atest CtsVoiceInteractionTestCases --instant
Change-Id: I12f0a265fc4fce0bbfe0983f39b4dcd947e3cf64
2021-03-29 17:41:24 +08:00
Dmitri Plotnikov
3497fb9b94 Merge "Add SystemBatteryConsumer.getPowerConsumedByApps()" into sc-dev am: eb2a57b807
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13944376

Change-Id: Ibed8bbf53944d2ef88f4cd2224cb4680d1e91494
2021-03-26 14:45:13 +00:00
Dmitri Plotnikov
eb2a57b807 Merge "Add SystemBatteryConsumer.getPowerConsumedByApps()" into sc-dev 2021-03-26 14:31:35 +00:00
Sergey Volnov
06cff513a1 Merge "Introduce the concept of software and external hotword." into sc-dev am: 86d7e7d2e0
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13727287

Change-Id: I45cd1c6be4d6cc14eb52681fdf4f8367d52af031
2021-03-26 13:08:11 +00:00
Sergey Volnov
baceb11e71 Introduce the concept of software and external hotword.
Follow-up: implement circular buffer and integrate with the flows.

Bug: 182788844
Bug: 168305377
CTS-Coverage-Bug: 183425641
Test: atest CtsVoiceInteractionTestCases
Change-Id: I654a06afb27bb961bfb547a6636e08eb72a031fc
2021-03-26 00:10:44 -07:00
Dmitri Plotnikov
c733ef6692 Add SystemBatteryConsumer.getPowerConsumedByApps()
Also, standardize the implementations of getConsumedPower()
to consistently return the total power consumed, not the
power unattributed to apps.

Bug: 183235836
Test: atest FrameworksCoreTests:com.android.internal.os.BatteryStatsTests
Change-Id: Iaedb29b9d7afd9843b0ab871e9b8656963db11ea
2021-03-25 18:45:08 -07:00
Benjamin Franz
001aff2da3 Merge "Create a new permission to override Overridable change ids" into sc-dev am: 16cd2836a3
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13988946

Change-Id: If9fa205c5bdf5d8f37846a84d55653ffd383604d
2021-03-25 15:44:55 +00:00
Benjamin Franz
16cd2836a3 Merge "Create a new permission to override Overridable change ids" into sc-dev 2021-03-25 15:29:21 +00:00
Alison Cichowlas
da20ba6846 More WP chooser/resolver strings am: d19254d3ab
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13986753

Change-Id: Id8218e31198cd5ad70fafcb6ed1afa7a3e7c7117
2021-03-25 13:44:46 +00:00
Alison Cichowlas
d19254d3ab More WP chooser/resolver strings
Bug: 182361692
Test: atest ChooserActivityTest, ResolverActivityTest
Change-Id: I4838ca3a4c861aae3a7bfe3f2396470c3525d3b5
2021-03-25 13:25:50 +00:00
Benjamin Franz
8ee7f9a4c3 Create a new permission to override Overridable change ids
With this change we allow system packages with the new permission to
override ChangeIds specifically annotated as Overridable to set
overrides even on non-debuggable builds.

Bug: 174043039
Bug: 175874108
CTS-Coverage-Bug: 180396382
Test: atest FrameworksServicesTests:CompatConfigTest
Test: atest FrameworksServicesTests:PlatformCompatTest
Change-Id: Ib8d5d83b5fd62acb5808d10f5c413616f29ee65c
2021-03-25 09:45:50 +00:00
Fiona Campbell
4e09a18070 Merge "Store Brightness Per Display" into sc-dev am: acc5fbcb39
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13562253

Change-Id: I3ad4774db8c45229944aacb982a78c82fea58cee
2021-03-25 09:21:56 +00:00
Fiona Campbell
acc5fbcb39 Merge "Store Brightness Per Display" into sc-dev 2021-03-25 08:40:15 +00:00
Tiger Huang
eca9c1e03f Merge "Re-land: Make window stable while resizing" into sc-dev am: 5905279553
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13921805

Change-Id: I62e224b2f5f5f311dc921f27eb9569ec5dc1c85a
2021-03-25 06:32:54 +00:00
Tiger Huang
5905279553 Merge "Re-land: Make window stable while resizing" into sc-dev 2021-03-25 06:24:43 +00:00
TreeHugger Robot
1e605a6f67 Merge "Accept strings for more parameters in Suspend Dialog" into sc-dev am: aeb2ba8da6
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13988109

Change-Id: Ieb2e905795764367f1495bb87dab626409308c14
2021-03-25 04:47:56 +00:00
TreeHugger Robot
aeb2ba8da6 Merge "Accept strings for more parameters in Suspend Dialog" into sc-dev 2021-03-25 04:38:58 +00:00
TreeHugger Robot
e168d1fc6f Merge "Unhide api for setHotwordDetectionServiceConfig" into sc-dev am: d5dc9e47a4
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13958483

Change-Id: Ia43f1abad77acf88cff962cf66844985381f9fe0
2021-03-25 04:26:27 +00:00
TreeHugger Robot
d5dc9e47a4 Merge "Unhide api for setHotwordDetectionServiceConfig" into sc-dev 2021-03-25 03:49:32 +00:00
Suprabh Shukla
241955129a Accept strings for more parameters in Suspend Dialog
Allowing passing raw texts offers more flexibility to callers in some
cases. However, in this case, the callers must handle locale changes on
their own.

Test: atest FrameworksServicesTests:SuspendDialogInfoTest
atest FrameworksServicesTests:PackageManagerSettingsTest
atest CtsSuspendAppsTestCases:DialogTests

Fixes: 170653551
Bug: 170653208
Change-Id: Iaa51e1d3f260ad553db8b33fddc935c478a40c9c
2021-03-24 16:14:47 -07:00
Michael Wachenschwanz
5e5c72e7ea Merge "Accumulate Mobile Radio and Gnss measured energy in BatteryStats" into sc-dev am: 522bb3d9cc
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13958991

Change-Id: Ia5cd74c3cfc074a9177fb343f4f33e3d11d188c9
2021-03-24 20:55:54 +00:00
Michael Wachenschwanz
522bb3d9cc Merge "Accumulate Mobile Radio and Gnss measured energy in BatteryStats" into sc-dev 2021-03-24 20:46:34 +00:00
Fiona Campbell
9320191858 Store Brightness Per Display
This changes stores a brightness value per display.

Add brightness value item to persistent data store.
Add BrightnessSettingController to save and retrieve brightnesses.
It is indexed by primary display device of the concerned logical display.
Add method in DisplayManager to expose this.

Bug: 176985835
Bug: 147415200
Bug: 175286226

Test: manual, check "adb shell dumpsys display | grep -A10 Persistent" shows brightness values for each display attached.
Change-Id: Ib8557f8a0f45a5bfb0810967f678015d3f121bb9
2021-03-24 19:34:36 +00:00
Dmitri Plotnikov
7d092ceaed Merge "Remove references to BatterStatsHelper from BatteryUsageStatsProvider" into sc-dev am: 0d1235b411
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13958996

Change-Id: I51b037979094152c429fe16f8f46561ef2271dc9
2021-03-24 18:55:36 +00:00
Dmitri Plotnikov
0d1235b411 Merge "Remove references to BatterStatsHelper from BatteryUsageStatsProvider" into sc-dev 2021-03-24 18:35:48 +00:00
Alison Cichowlas
6f4ca44c49 Merge "Update strings - chooser/resolver WP strings." into sc-dev am: edfb697d6b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13973973

Change-Id: Icecd0e9a90de20a62307c4cccfd46c516c06dbca
2021-03-24 15:45:14 +00:00
Alison Cichowlas
edfb697d6b Merge "Update strings - chooser/resolver WP strings." into sc-dev 2021-03-24 15:22:26 +00:00
lpeter
247d69aa7e Unhide api for setHotwordDetectionServiceConfig
We also changed API from setHotwordDetectionServiceConfig
to updateState.

Bug: 182951186
CTS-Coverage-Bug: 183425641
Test: Test: atest CtsVoiceInteractionTestCases
Test: atest CtsVoiceInteractionTestCases --instant
Change-Id: I29ed0736f9502d3ac5a29ea26a8386bce7113e54
2021-03-24 16:34:44 +08:00
Jacky Kao
c9f94813f9 Merge "Logs magnification feature behavior. (2/2)." 2021-03-24 05:08:59 +00:00
Dmitri Plotnikov
b8b58ebd2f Remove references to BatterStatsHelper from BatteryUsageStatsProvider
Also, add BatteryUsageStatsQuery.getMaxStatsAge() to allow throttling
of battery stats sync.

Bug: 174186345
Test: atest FrameworksCoreTests:com.android.internal.os.BatteryStatsTests
Change-Id: I097c6b9575422837a522cf313a320e83221cdfab
2021-03-23 19:29:11 -07:00
Michael Wachenschwanz
27959e75dc Accumulate Mobile Radio and Gnss measured energy in BatteryStats
Enabled querying and processing Mobile Radio and Gnss energy consumption
in BatteryStatsExternal.
Attribute and accumulate their power deltas in BatteryStatsImpl
Utilize measured power data in MobileRadioPowerCalculator and
GnssPowerCaluclulator.

Bug: 174818228
Test: atest GnssPowerCalculatorTest
Test: atest MobileRadioPowerCalculatorTest
Test: BatteryStatsExternalWorkerTest
Change-Id: If062033ff3c8cff20842be2cd92b04f6cb981366
2021-03-23 18:40:35 -07:00
Ahaan Ugale
47a6757c33 Merge "Allow HotwordDetectionService to return HotwordRejectedResult." into sc-dev am: 8f02ccf5dc
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13955919

Change-Id: Ibe6c653cc4e103942b870cb2b3bea7dd61eee99c
2021-03-24 01:19:36 +00:00
TreeHugger Robot
ecd46961ba Merge "Use the PersistableBundle instead of the Bundle" into sc-dev am: 20e5c931b5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13917726

Change-Id: I20c50141818d4b32d001ba4fe16c209927eec542
2021-03-24 01:19:01 +00:00
Matt Casey
4a7e011d77 Merge "Remove long screenshot flag" into sc-dev am: ba520c1f94
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13938723

Change-Id: I5e255b62856649887bb785dca49f91881055e0c6
2021-03-24 01:08:43 +00:00
Dmitri Plotnikov
7edd2b92e9 Merge "Change getStatsStartRealtime to getStatsStartTimestamp" into sc-dev am: f2dca81569
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13957373

Change-Id: Iba89366fedfd01a207d56c089f7bfd054d8a3151
2021-03-24 00:59:44 +00:00
Ahaan Ugale
8f02ccf5dc Merge "Allow HotwordDetectionService to return HotwordRejectedResult." into sc-dev 2021-03-23 21:58:59 +00:00
TreeHugger Robot
20e5c931b5 Merge "Use the PersistableBundle instead of the Bundle" into sc-dev 2021-03-23 21:42:26 +00:00
Tiger Huang
a7e33a41e5 Re-land: Make window stable while resizing
When the frame size and the frame position of the window are changed at
the same time, setPosition to the surface will be applied first, and
the client will draw on the new-size buffer later, which makes the
window flicker.

This CL uses applyWithNextDraw to make the new surface position can be
applied while the new frame is drawn. applyWithNextDraw is applied only
when
- the window doesn't have a move animation. So if a window needs to make
  resizing stable, it may need PRIVATE_FLAG_NO_MOVE_ANIMATION.
- it is visible, e.g., the surface is shown, and the window is OK to
  display -- for better performance.

If applyWithNextDraw is used while the window frame is changed to an
empty rectangle, e.g., Rect(10, 10 - 1000, 10), mNextDrawUseBlastSync
will stay true forever, because we don't draw while the dirty area is
empty, and ViewRootImpl would lose the only chance to clear the flag.
performTraversals will never be executed.

This CL makes mNextDrawUseBlastSync can be cleared in that case.

Bug: 182729646
Fix: 176874720
Test: steps in the bug
Change-Id: I81b0574ee8db7e4d9053639f56e04858d9feae90
2021-03-24 04:19:48 +08:00
Alison Cichowlas
f1f6c4ac7e Update strings - chooser/resolver WP strings.
Test: manual verification of string update, atest ChooserActivityTest
Bug: 182361692
Change-Id: I6ec45c5ae2a9877bb2114243589a0da0247bed95
2021-03-23 16:06:14 -04:00
Matt Casey
ba520c1f94 Merge "Remove long screenshot flag" into sc-dev 2021-03-23 20:00:09 +00:00
Siim Sammul
9d02e6101e Change BinderLatencyBuckets to use int[] instead of ArrayList to improve
performance.

Test: unit test
Bug: 179999191
Change-Id: Id996b52b5cb69a85f9c6a932ea8d30336fcaf12a
2021-03-23 17:38:33 +00:00