Commit Graph

16171 Commits

Author SHA1 Message Date
Steven Moreland
52f5620763 Merge "IBatteryStats.aidl update path" am: 2a27671122 am: 0fd713954b am: 7c8edecd6d am: dfcb3c7908
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1661234

Change-Id: Iaf4576cef59e8a95646b8f173d3fb4b0aa65fe4f
2021-04-01 20:34:37 +00:00
Steven Moreland
dfcb3c7908 Merge "IBatteryStats.aidl update path" am: 2a27671122 am: 0fd713954b am: 7c8edecd6d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1661234

Change-Id: Ief137e0a515e75737148c474bbdfa2f89be10952
2021-04-01 20:19:40 +00:00
Steven Moreland
7c8edecd6d Merge "IBatteryStats.aidl update path" am: 2a27671122 am: 0fd713954b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1661234

Change-Id: If052ba67117e377e1db06c1f2a19159593a73d2d
2021-04-01 19:31:07 +00:00
Steven Moreland
2a27671122 Merge "IBatteryStats.aidl update path" 2021-04-01 18:08:11 +00:00
Aaron Huang
5b1b6bf264 Merge "Move some constants from TrafficStatsConstants to NetworkStackConstants" am: e427565991 am: 40b438abcc
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1625861

Change-Id: Ideb5a5abbd074a8c905861e902977c442317fc02
2021-04-01 16:45:22 +00:00
Aaron Huang
e427565991 Merge "Move some constants from TrafficStatsConstants to NetworkStackConstants" 2021-04-01 15:59:39 +00:00
Aaron Huang
42951ddb37 Move some constants from TrafficStatsConstants to NetworkStackConstants
Keep the constants are only used by framework in TrafficStatsConstants
and move the others to NetworkStackConstants which is in libs/net.

Bug: 182349970
Test: FrameworksNetTests
      NetworkStackTests
      TetheringTests
Change-Id: Ib667c115e5f1e01237d88b77bba753363da309cc
Merged-In: Ib667c115e5f1e01237d88b77bba753363da309cc
2021-04-01 05:10:03 +00:00
Steven Moreland
de4e95ed68 IBatteryStats.aidl update path
header moved

Bug: 183654927
Test: N/A
Change-Id: I5a74323f14da8aec636b4dea6eb22eae528556be
2021-03-31 23:46:34 +00:00
Wilson Wu
92de463629 Merge "Make IInputMethodPrivilegedOperations to async (1/N)" into sc-dev am: 889e3d63bb
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13982587

Change-Id: I22ec69e750da947d529ffc69971966bf965413b6
2021-03-31 10:41:08 +00:00
Wilson Wu
889e3d63bb Merge "Make IInputMethodPrivilegedOperations to async (1/N)" into sc-dev 2021-03-31 10:17:25 +00:00
Ioannis Ilkos
fb2db1932f Merge "Per process DMA-BUF stats" into sc-dev am: 50d4ba03b5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13988962

Change-Id: Iabb28779cd1a79c60fcf2f0c45b151a5ea0de148
2021-03-31 09:00:01 +00:00
Ioannis Ilkos
50d4ba03b5 Merge "Per process DMA-BUF stats" into sc-dev 2021-03-31 08:48:55 +00:00
Yohei Yukawa
5c0c433891 Merge "Avoid IME restart for configChanges" into sc-dev am: 12e4fde793
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13885361

Change-Id: I25e694142090ece30cb15cde33124e094e0cf944
2021-03-31 02:41:58 +00:00
Yohei Yukawa
12e4fde793 Merge "Avoid IME restart for configChanges" into sc-dev 2021-03-31 02:28:22 +00:00
Rob Carr
7f89042c95 Merge "Expose API for using SurfaceControl with ViewRootImpl" into sc-dev am: 2b434b28b0
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13842193

Change-Id: I991c351464b0b4fa27a68ee065b3057bd6ec3a01
2021-03-31 02:00:38 +00:00
Rob Carr
2b434b28b0 Merge "Expose API for using SurfaceControl with ViewRootImpl" into sc-dev 2021-03-31 01:35:49 +00:00
Ray Essick
6ccf5d7c47 Merge "No longer preload libsfplugin_ccodec in zygote" into sc-dev am: 2d2519e32d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14008903

Change-Id: I97fc60f5cbeadd2b688054c962e702f17fc14b34
2021-03-30 21:10:08 +00:00
Ray Essick
2d2519e32d Merge "No longer preload libsfplugin_ccodec in zygote" into sc-dev 2021-03-30 21:09:42 +00:00
Daniel Sandler
8af8f8d0f4 Merge "Add INVOCATION_TYPE_POWER_BUTTON_LONG_PRESS." into sc-dev am: ca0ac5e60d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13732010

Change-Id: I1a4245af72156c77280bc1a0139fa13803c9b8ef
2021-03-30 20:33:40 +00:00
Daniel Sandler
ca0ac5e60d Merge "Add INVOCATION_TYPE_POWER_BUTTON_LONG_PRESS." into sc-dev 2021-03-30 20:23:06 +00:00
Taran Singh
71ab752fc5 Avoid IME restart for configChanges
Handle onConfigurationChanged() in order to prevent restarting
InputMethodService everytime. We introduce a new API attribute
"configChanges" in InputMethod(attrs.xml) which when declared
by IME, will be responsible for handling mentioned
configuration changes.

This CL re-introduces [1] with fix: Use new Configuration instance for
IMS#mLastKnownConfig and also handle followup comments.

[1] Ib94fddadb0dae648cf73a4c1642e51edebd19f50

Note: this change has no impact for devices not using DisplayAreas.

Bug: 167948419
Test: atest InputMethodServiceTest
    Manually:
      1. Patch Ie91e7a8e06b80864ef9409031e8543858552d70d to use dual
         display area.
      2. Open applications with editors on both display areas.
      3. Attach a debug point for IMS#onConfigurationChanged().
      4. Make sure IMS#resetStateForNewConfiguration() is not called
         when IME moves between these two identical DisplayAreas
    Also verify that bug 182604598 don't happen.

Change-Id: I43b6b80cdb35410554412ee1d3b0917ee3198272
2021-03-30 20:03:55 +00:00
Treehugger Robot
cbbe436700 Merge "Notify CellLocation whenever ACTION_USER_SWITCHED" am: 2a5efce2d7 am: 4a73b5f3b5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1550658

Change-Id: I796876646ef59d15fb1d9f1bd8b751af4c0ec304
2021-03-30 19:47:51 +00:00
Treehugger Robot
2a5efce2d7 Merge "Notify CellLocation whenever ACTION_USER_SWITCHED" 2021-03-30 19:01:17 +00:00
Taesu Lee
9a218febc2 Notify CellLocation whenever ACTION_USER_SWITCHED
Notify device's cell location when ACTION_USER_SWITCHED even though no
changes.
And 1st arg of notifyCellLocationForSubscriber() shall be subId instead.

Bug: 177495399
Test: atest TelephonyRegistryTest

Signed-off-by: Taesu Lee <taesu82.lee@samsung.com>
Merged-In: I6761c4bb500da1748119f9917663dae0307ab437
Change-Id: I6761c4bb500da1748119f9917663dae0307ab437
2021-03-30 17:47:48 +00:00
Amit Mahajan
a681f374b7 Merge "Notify CellLocation whenever ACTION_USER_SWITCHED" into sc-dev am: 244c071737
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13891835

Change-Id: Ideca245d742325e14d936ca36ddb9716727561ae
2021-03-30 17:45:13 +00:00
Amit Mahajan
244c071737 Merge "Notify CellLocation whenever ACTION_USER_SWITCHED" into sc-dev 2021-03-30 17:42:08 +00:00
Ioannis Ilkos
228fc0293b Per process DMA-BUF stats
In order to detect memory regressions caused by improper handling of
dma-buf buffers we need to measure how this memory is used.

This change:
- Introduces DmabufInfoReader which wraps libmeminfo and provides
per-process DMA-BUF stats.
- Specifically, measures buffers mapped to the process address space
(from /proc/pid/maps). This is supported on all devices.
- For devices running 5.4+ (where the system processes can query fdinfo)
also measures the total retained memory (either by mmap or an open fd).
- Introduces a statsd atom that collects this for all running managed
processes. Non-managed processes will also hold dmabufs, but the
likelihood of them causing issues (post-launch) is smaller so I am
trading them off for cheaper collection (if indeed we encounter such
problems, they will definitely be caught by the total dmabuf counters).

Test: manual
Bug: 183708249
Change-Id: I5e0ef58ac1a66ebe2d280c5733de46ba84f75a46
2021-03-30 10:38:10 +01:00
Robert Carr
ee90cd4871 Expose API for using SurfaceControl with ViewRootImpl
This API is appropriately called "ViewRoot". So far we just expose
an API surface to reparent SurfaceControl to the ViewRoot (but without
exposing the ViewRoot's SurfaceControl, to encourage developers not
to shoot themselves in the foot) and to synchronize with the drawing
of the ViewRoot SurfaceControl.

Bug: 173463039
Test: ViewRootSyncTests
Change-Id: I8ce0ed4b3efe50cdb3b71ae0f05ce25438d42368
2021-03-30 04:10:05 +00:00
Jacky Kao
b599784e05 Merge "Logs magnification feature behavior. (2/2)." into sc-dev 2021-03-29 23:56:22 +00:00
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
Dan Sandler
f44b1709ff Add INVOCATION_TYPE_POWER_BUTTON_LONG_PRESS.
Since this is intended to be used by PhoneWindowManager,
this patch also hoists these internal constants out of
SystemUI and into com.android.internal.app.AssistUtils.

Adds the new UiEvent ASSISTANT_INVOCATION_POWER_LONG_PRESS
for future use by calling code.

This patch also fixes an inconsistency in the existing
constant names (internally to these files).

Fixes: 181601214
Test: atest SystemUITests
Change-Id: Ida860d78ef490e0dc119b37287c6ecdff5b9c0de
2021-03-29 20:23:27 +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
Wilson Wu
1b8593fdfe Make IInputMethodPrivilegedOperations to async (1/N)
-. Remove VoidResultCallback of setImeWindowStatus
   and let it be asynchronous.
-. Rename function naming to setImeWindowStatusAsync.

Bug: 183587528
Test: atest CtsInputMethodTestCases
Change-Id: Ia9f19ca5ae418089ce43816dcd50487e1b1172f1
2021-03-29 11:53:42 +08:00
Ray Essick
a15689d49f No longer preload libsfplugin_ccodec in zygote
libsfplugin_ccodec was loaded with dlopen() in initial generation.  It has
since been turned to always-linked.  This makes the performance tweak of
pre-loading in Zygote to improve camera startup latency no longer needed.

Bug: 177694783
Bug: 133186424
Test: functional camera
Change-Id: I054787cf9d6992515d3fccb289f041b536639bea
2021-03-27 10:05:38 -07: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
Treehugger Robot
f555b4252e Merge "Create a new permission to override Overridable change ids" am: 44008b63fb am: a5b9c920e5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1599153

Change-Id: I2f32113b8421c56ad9e0705ce240eed71c323c61
2021-03-25 18:06:23 +00:00
Treehugger Robot
44008b63fb Merge "Create a new permission to override Overridable change ids" 2021-03-25 17:35:45 +00:00
Benjamin Franz
229b809643 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
Test: atest FrameworksServicesTests:CompatConfigTest
Test: atest FrameworksServicesTests:PlatformCompatTest
Change-Id: Ib8d5d83b5fd62acb5808d10f5c413616f29ee65c
Merged-In: Ib8d5d83b5fd62acb5808d10f5c413616f29ee65c
2021-03-25 16:07:32 +00:00