Commit Graph

2048 Commits

Author SHA1 Message Date
TreeHugger Robot
b45f0e8ac6 Merge "Add MIDI info to USB dumpsys" into tm-dev 2022-04-20 01:13:19 +00:00
Jing Ji
ba136aed98 Exempt the device/profile owner protected pkgs from FGS task manager
Bug: 203105544
Test: Manual
Change-Id: Ie444227eb1613d718b1859a0f5d6a9046900c9cb
2022-04-19 05:04:18 -07:00
Robert Wu
b83ae06adf Add MIDI info to USB dumpsys
Adding MIDI info to USB dumpsys so developers can debug better.

Bug: 229122603
Test: adb shell dumpsys usb
Change-Id: Ic3c7ab21865457b1e1f0f97fdd1827bb0b442481
2022-04-14 01:57:04 +00:00
Hui Yu
bf7ac2254b Log AppBatteryTracker to statsd atom APP_BACKGROUND_RESTRICTIONS_INFO.
Log per-uid battery usage percentage in last 24 hours.
Log total battery usage, background battey usage, foreground service
battery usage.

Bug: NA.
Test: manual test, adb logcat | grep getBatteryTrackerInfoProtoLocked.
Change-Id: I2c17fcfa2343103ecc8ad899db2ca4f89428abfb
2022-04-04 13:32:15 -07:00
Austin Borger
db9165baf2 Add new onUidProcAdjChanged callback to be consumed by the camera
service.

The camera service needs to know when individual process oom adj scores
are changed in order to address bug #124224342. When two separate
processes are displayed in split screen and focus is switched between
them, both proc states will remain the same while their oom scores
change. This is a problem if both have access to the camera - we want
only one owner of the camera stream at any given time and for the app
in focus to be the one to own it.

This patch adds a new IUidObserver registration level for individual
process oom score changes. In addition a new callback has been added to
IUidObserver to track these changes.

Change-Id: I68d964f474d20f819f54b614a4e314ce00aac8fb
Bug: 124224342
Test: -- ActivityManagerServiceTest
      -- ActivityManagerProcessStateTest
      -- ActivityManagerFgsBgStartTest
      -- UidObserverControllerTest
      -- NetworkPolicyManagerServiceTest
      -- ShortcutManagerTest2
      -- HintManagerServiceTest
      -- VibrationSettingsTest
      -- CameraEvictionTest#testCamera2AccessCallbackInSplitMode (x100)
2022-03-28 19:46:45 -07:00
Austin Borger
177d5bb187 Modify UidRecord.CHANGE_PROCSTATE such that it behaves like a bit mask.
UidRecord.CHANGE_PROCSTATE was allocated the value 0, since it is
assumed that if there is any change to a UidRecord it includes a proc
state change. This is a valid assumption, but is not an unusual design
for a bitmask. This change adds a bit specifically for proc state
changes.

At the time of this change, CHANGE_PROCSTATE should always be set.
However the intention is to pre-empt change
I68d964f474d20f819f54b614a4e314ce00aac8fb, which breaks the assumption
that all UidRecord changes will include proc state. To avoid verbosity,
additional constants have been defined which combine the other change
bits with CHANGE_PROCSTATE for external users to reference.

Change-Id: Iae7e6601938d1b3ee5c4c9b339ae06029eb598e6
Bug: 124224342
Test: -- ActivityManagerServiceTest
      -- ActivityManagerProcessStateTest
      -- ActivityManagerFgsBgStartTest
      -- UidObserverControllerTest
      -- CtsAppTestCases
2022-03-23 11:55:10 -07:00
Chris Li
a53b05ca8c Disable all input on ActivityRecord during untrusted animation
For cross-process embedding, there can be activity of other app embedded
in untrusted mode. When it happens, we need to disable all input on the
Task if we are going to play client-driven animation to make sure the
host client can't abuse the animation leash.

Bug: 197364677
Test: atest WmTests:AppTransitionControllerTest
Change-Id: I3e299c0a43ac823b7df6af9d02c7168bd65d3271
2022-03-23 10:01:40 +08:00
Dmitri Plotnikov
295f1d93f4 Define AppBatteryStatsProto for AppBatteryTracker dumpsys
Bug: 224604491
Test: build
Change-Id: I15e0915e3a80220cd4c7d328d0b2a7c581043640
2022-03-15 18:28:08 -07:00
Dmitri Plotnikov
c311349874 Track CACHED procstate in BatteryStats
Bug: 216361629
Test: atest FrameworksCoreTests:BatteryStatsTests

Change-Id: If3ada99a009d09db07f38be1ffb62e86c637e1a3
2022-03-10 17:26:11 -08:00
Tyler Dewey
4c5d89e69d Update build target names & code location for roleservice.proto usages
in framework.

Bug: 217406624
Test: built and flashed
Change-Id: Ibcb924df059af5d518b7f6f80487a3fb57bd6623
2022-03-07 05:48:42 +00:00
Aaron Huang
005da24a4c Merge "Fix proto invalid write type" into tm-dev 2022-03-05 07:43:09 +00:00
Tiger Huang
1153c8f352 Add window_frames_valid to proto
This is a step to move the window layout to the client side.

Once the window layout is moved to the client side, when something (such
as configuration) is changed, the server will send MSG_RESIZED to the
client. Before the client reports the new frame to the server, the frame
at the server side might not be up-to-date.

This gives WindowManagerState a signal to decide if it should retry.

Bug: 161810301
Test: presubmit
Change-Id: Idece0f559e7013ff389cbb7aa74d63734c95f64c
2022-03-04 19:46:34 +08:00
Aaron Huang
d87c9cb26b Fix proto invalid write type
While dumpProtoLocked is called, InvalidProtocolBufferException
occurred because types are mismatched between platform side and
module side.

netstats.proto was moved into connectivity module, both the
platform(incident.proto) and the module uses protoc-gen-javastream
to generate the Java classes from it. It should be fine since
platform includes the source of the proto, and jarjar the generated
classess in the module to avoid conflict with platform.

Bug: 218566849
Test: adb shell incident 3001
      adb shell dumpsys netstats --proto
      atest CtsIncidentHostTestCases:IncidentdTest#testIncidentReportDumpAuto
Change-Id: I4654350a59dc1ca1a925785ad37f34aa7b481235
Merged-In: I4654350a59dc1ca1a925785ad37f34aa7b481235
2022-03-04 06:39:30 +00:00
Sandro Montanari
b815f74d5f Merge "Add /metadata info on dumpsys diskstats and StatsPullAtomService" am: 31f779f949 am: 079b5b2e27 am: b5b91ee453
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1993550

Change-Id: I0fe8899299577c8b2b8381e4ea385fd982c74eb7
2022-03-02 19:31:13 +00:00
Sandro Montanari
079b5b2e27 Merge "Add /metadata info on dumpsys diskstats and StatsPullAtomService" am: 31f779f949
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1993550

Change-Id: Iebb35e4099506f05f73c59dd689e84e75ae8756d
2022-03-02 18:47:03 +00:00
Pat Manning
60b397e84a Merge "Refactor force visible nav bar into new secure setting." into tm-dev 2022-03-02 13:51:27 +00:00
sandrom
f76f5842a4 Add /metadata info on dumpsys diskstats and StatsPullAtomService
Bug: 208676063
Test: manual tests
Change-Id: Ice3b706222aa1f77beadb1b9f4ae93f0d796a0b0
2022-03-02 08:08:23 +00:00
Galia Peycheva
96c65d7c31 Merge "Add SystemApi to set unrestricted keep-clear rects" into tm-dev 2022-03-02 06:08:37 +00:00
Joe Bolinger
1c9a06276a Remove face to fingerprint multi-sensor behavior.
Refactor existing tests to remove unnecessary mocks and boilerplate code to
cover more of the real behavior. This is prep for adding new tests in another
change to add the new face and fingerprint behavior.

Bug: 217393533
Test: atest AuthBiometricViewTest AuthContainerViewTest
Test: manual (authenticate using test app)

Change-Id: If984d1c07fee98d2d7a20cb0025ad434ad9977f4
2022-02-28 18:36:20 -08:00
Galia Peycheva
acaf385715 Add SystemApi to set unrestricted keep-clear rects
This CL allows applications to choose whether to set restricted or
unrestricted keep-clear areas by adding a dedicated SystemApi for
unrestricted keep-clear areas - View#setUnrestrictedKeepClearRects. The
SET_UNRESTRICTED_PREFER_KEEP_CLEAR_AREAS permission is now only checked
for keep-clear areas from that API

Bug: 221094507
Test: atest CtsWindowManagerDeviceTestCases:KeepClearRectsTests
Test: atest WindowStateTests#testUnrestrictedKeepClearAreas
Change-Id: I89ca3149117b4d457c5521d617880870706d7793
2022-02-28 05:14:35 +00:00
Nate Myren
6510aa238e Implement API feedback for Safety Center QS
Implements API feedback about the safety center constants. Also renames
Safety Hub to Safety Center

Fixes: 215301946
Test: build
Change-Id: Ie07e8fc3ae7371e94d23ac6dfa9a446ef92da074
2022-02-25 16:56:30 +00:00
Pat Manning
a8210d8ec3 Refactor force visible nav bar into new secure setting.
Decouples force visible from kids mode setting.

Bug: 217668440
Test: manual
Change-Id: I363a2507cd1b073f44ed91e96b1dce7b3cd347c4
2022-02-24 16:18:47 +00:00
chaviw
c9d948238e Fix SnapshotTaskTests
Added enable_recents_screenshot to windowmanager proto file so it can be
used when testing. The test will read back this value to make sure it's
set before proceeding with taking a task snapshot.

Test: atest SnapshotTaskTests --rerun-until-failure 10
Fixes: 219750596
Change-Id: Ibd66c5f4d46e5102dbe0763f7b0b7cbcfb90a798
2022-02-22 17:30:33 -06:00
Antoan Angelov
332e6894b7 Merge "Add a Settings.Global feature flag to toggle role holder provisioning" 2022-02-14 15:48:37 +00:00
arangelov
0b02a41c3c Add a Settings.Global feature flag to toggle role holder provisioning
This will be useful for testing.

Bug: 218686349
Test: none
Change-Id: I21c9de56638827beb092eeeb2cdc70940e6377f0
2022-02-11 16:42:34 +00:00
Siim Sammul
9a8890e56b Add WIFI enum value to allow collecting binder latency data from the
Wifi process.

Test: n/a
Bug: 218318948
Change-Id: Ifc95b460f77cb48491e1c4ebeb958cc71d841560
2022-02-11 10:50:28 +00:00
Xin Li
5ad6db7742 Merge sc-v2-dev-plus-aosp-without-vendor@8084891
Bug: 214455710
Merged-In: I8cfa435bb6233818adb9cc99dadeeb06a03443d5
Change-Id: Ib93992d88fd1704179009a3872798b9e7b83a6d1
2022-02-11 07:25:43 +00:00
Andrii Kulian
d21447ccd2 Add Cross-UID ActivityEmbedding trust model APIs
By default activity embedding should be restricted, and apps have to
opt in explicitly to allow other hosts to embed them. An app can
declare a list of known trusted embedding host certificates in
AndroidManifest for individual activities or entire application.
Alternatively, an app can allow embedding by all hosts in untrusted
mode. In this case interactions and operations that the client host
can perform on the embedded container will be limited to prevent
tapjacking and overlay attacks.

Bug: 197364677
Test: ActivityEmbeddingCrossUidTests
Change-Id: I78c303237fdc77bdf55bd74580ac0b19c8de622b
2022-02-09 23:56:36 -08:00
TreeHugger Robot
9c0271eeba Merge "Fix LowPowerStandbyControllerDumpProto types" 2022-02-03 13:16:39 +00:00
Robert Horvath
c3b4ea9dc6 Fix LowPowerStandbyControllerDumpProto types
Bug: 217216949
Test: adb shell dumpsys power --proto
Change-Id: I07fd662c392c2f1dc6eee8bb5489a217ebff5806
2022-02-02 16:56:08 +00:00
Roopa Sattiraju
cbbd6badec Pulling in BluetoothProtoEnums into the apex
Bug: 211851706
Test: Compile against apk and apex
Change-Id: I51d9fc2c8a4bf4f351dcc4d907f5eb220ee6b53e
2022-02-01 06:41:29 +00:00
Robert Horvath
5dfac22224 Merge changes from topics "low-power-standby-api", "lps-wakelock-testapi"
* changes:
  Add API to configure LPS maintenance mode behavior
  Add TestApi to force Low Power Standby to be active
  Add TestApi wakelock flag to have system acquire wakelock
  Allowlist active voice interaction session from Low Power Standby
  Introduce Low Power Standby API and wakelock restrictions
2022-01-28 12:27:05 +00:00
Evan Severson
e5c3230597 Merge "Refactor SensorPrivacyService to separate state from service" 2022-01-27 22:10:37 +00:00
Robert Horvath
4845efb60d Add TestApi wakelock flag to have system acquire wakelock
Allows CTS tests to test power restrictions that disable wakelocks
without the system suspending (since system-wakelocks are exempt).

Bug: 190822356
Test: atest LowPowerStandbyTest
Change-Id: I91f44ae93480be992151d845175606fb66ecb127
2022-01-27 23:08:32 +01:00
Robert Horvath
287a3a7b94 Allowlist active voice interaction session from Low Power Standby
If a voice interaction session is started, then it should be allowed to
use the network & wakelocks unrestricted while it is ongoing, since it
is direct user interaction.

Bug: 190822356
Test: atest LowPowerStandbyControllerTest PowerManagerServiceTest
Test: With reference VIS: adb shell cmd voiceinteraction show
      To verify allowlist/wakelock state: adb shell dumpsys power
Change-Id: I63cd0cf2e97b574ba8fa6c6caa8f046cce2bb821
2022-01-27 23:08:32 +01:00
Robert Horvath
570645567f Introduce Low Power Standby API and wakelock restrictions
In Low Power Standby, additional restrictions are placed on apps that
are in a process state of FOREGROUND_SERVICE or less important
during standby (while the device is non-interactive):
- Wakelocks are disabled
- Network access is blocked
During doze maintenance windows the restrictions are lifted temporarily.

This change introduces the APIs for Low Power Standby, as well as
the wakelock restrictions.

This feature is targeting TVs. To prevent Low Power Standby from being
enabled on other devices, the feature is guarded by the config flag
config_lowPowerStandbySupported.

Bug: 190822356
Test: atest LowPowerStandbyControllerTest PowerManagerServiceTest
Ignore-AOSP-First: New permission only added internally for now.
Change-Id: Ia40f8a0fc4b366860af58ad76c988f93a5d41936
2022-01-27 23:08:26 +01:00
Evan Severson
0cefec2d4f Refactor SensorPrivacyService to separate state from service
This refactoring will let us have alternative implementations for the
state of microphone/camera. It also seperates the storage of the other
feature that is known as the "Sensor mute" so that the reuse of this
service doesn't get too convoluted.

Also extract the persitable state from the state implementation so that
alternative implementations can resuse the persistence code.

Some smaller changes:
* Start the sensor use dailog as user 0 always since system UI requires
user 0
* Use SystemClock.elapsedRealTime() instead of network time since it's
guaranteed to my monotonic. This will also change that intervals used in
telemetry aren't going to measure time the device is powered off.

Ignore-AOSP-First: New OWNERS file
Test: atest CtsSensorPrivacyTestCases SensorPrivacyServiceMockingTest
Bug: 200649586
Change-Id: I4c23c2509d7d1bdf49360fc9bbadb79ccd451dcc
2022-01-26 20:06:41 -08:00
Dmitri Plotnikov
425fbd777e Merge "Add BatteryUsageStats.getDischargeDurationMs" 2022-01-27 02:27:01 +00:00
Junyu Lai
6c7b1ff018 Merge "Mark NetworkStatsServiceDumpProto userdebug_and_eng_only" am: 0843c02abc am: 5a46037e6a am: 7d9ae5a362 am: 9e2f825f12
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1954377

Change-Id: Id07f23e89ba9f683194219e4ff68ed4e1bc7e48c
2022-01-25 17:42:19 +00:00
Junyu Lai
9e2f825f12 Merge "Mark NetworkStatsServiceDumpProto userdebug_and_eng_only" am: 0843c02abc am: 5a46037e6a am: 7d9ae5a362
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1954377

Change-Id: I6a0751cf97f1ea5f46695c5748f9bf3965bfac56
2022-01-25 17:23:00 +00:00
Junyu Lai
7d9ae5a362 Merge "Mark NetworkStatsServiceDumpProto userdebug_and_eng_only" am: 0843c02abc am: 5a46037e6a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1954377

Change-Id: I05760b6a52c24f16f99e2e6928f9e6e26e4c3f5e
2022-01-25 17:12:49 +00:00
Junyu Lai
0843c02abc Merge "Mark NetworkStatsServiceDumpProto userdebug_and_eng_only" 2022-01-25 16:40:40 +00:00
Tiger Huang
dc94a72272 Merge "Remove the frame number from WindowManagerService" 2022-01-25 14:11:20 +00:00
An An Yu
f36089e8fc Allow DisplayContent to report per-Display minimal task size.
Currently minimal task size is calculated from the default display in
RootWindowContainer and used for all resizeable tasks; instead we should calculate this from per-Display
context to extend for additional displays.

Test: DisplayContentTests
Bug: 191434136

Change-Id: Ib9397de5570c0b17651c4ccfcb30bee836f684e8
2022-01-25 00:14:02 +00:00
Badhri Jagan Sridharan
d368d4ee67 Merge "Add systemApis to allow data transfer over USB-C while being docked" 2022-01-24 19:19:25 +00:00
Dmitri Plotnikov
5f9c679caf Add BatteryUsageStats.getDischargeDurationMs
This method returns the total amount of time the battery was
discharging during the current battery session.

Also, fixing time units used in BatteryStats tests: they are
supposed to be microseconds, not milliseconds.

Bug: 214407774
Test: atest FrameworksCoreTests:BatteryChargeCalculatorTest
Change-Id: I5b64a6bd8a577b558b90cb60a1db8c3774121921
2022-01-24 11:03:53 -08:00
Tiger Huang
96c3e87e9e Remove the frame number from WindowManagerService
The frame number at the server side is not used anymore since BLAST.

Bug: 161810301
Test: presubmit
Change-Id: I01c6fb0750799aa94766f2582ce6ac031c9426cf
2022-01-24 21:43:28 +08:00
Badhri Jagan Sridharan
7212c8fda4 Add systemApis to allow data transfer over USB-C while being docked
This change adds two systemApis to UsbPortStatus viz.,
a. getUsbDataStatus: Allows caller to infer whether USB data is enabled.
b. getPowerBrickStatus: Allows caller to infer whether a power brick
                        is connected to the USB port.

The change also adds enableUsbDataWhileDocked systemApi to UsbPort to
enable Usb data momentarily.

Bug: 211677613
Bug: 213312081
Test: Manually tested on tablet
CTS-Coverage-Bug: 215019881
Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
Change-Id: Ib7521f0f04b7f8e3e58dc253b28072d3631f21a7
2022-01-24 21:30:05 +08:00
Galia Peycheva
92edc518ff Add WMS support for keep-clear areas
Test: atest DisplayContentTests#testKeepClearAreasMultipleWindows
Test: atest WindowStateTests#testKeepClearAreas
Bug: 183746978
Change-Id: I974bf4254003467c8aa9a4f7aa618ab96985dd38
2022-01-22 08:50:02 +01:00
Badhri Jagan Sridharan
da433c60c1 Merge changes from topics "199357330", "200993386"
* changes:
  Add limitPowerTransfer SystemAPI to UsbPort
  Support IUsb AIDL interface
2022-01-22 01:20:21 +00:00