Commit Graph

2070 Commits

Author SHA1 Message Date
Felipe Leme
4b1b298444 Minor improvements on user management stack.
- Clarify that UserController.mCurrentProfileIds lists all profiles,
  not just the started ones.
- Similarly, renamed updateCurrentProfileIds() to
  updateProfileRelatedCaches() (and updated its javadoc), as that
  method was also updating mUserProfileGroupIds
- Added a UserLifecycleListener to UserController, so the profile
  caches are updated when a new profile is added.
- Removed the UserController.onUserRemoved() call from
  ActivityServiceManager and used the above listener instead.
- Added mCurrentProfileIds to UserController dump() methods.
- Added mCurrentUserId to UserController dump(proto) method.

Test: manual verification
Test: adb shell dumpsys activity users|grep -i profile

Change-Id: I7e11a8d7237a7421ad396ad6515a9496d0bb7f8d
Fixes: 255357601
2022-10-28 21:07:04 +00:00
Felipe Leme
e861d161d8 Merge "Added user visibility callbacks on SystemService." 2022-10-26 15:43:40 +00:00
Felipe Leme
9edf758fd6 Added user visibility callbacks on SystemService.
On Android U, system components (like location) should rely on
UM.isUserVisible() (rather than AM.getCurrentUser()) to check if a
user is "visible". Hence, we need to provide a callback mechanism to
notify when the user visibility changes.

This change adds a SystemService.onUserVisibilityChanged() API, and
also refactors how some internal components (like UserController and
ActivityManagerService) handle the initial start of user 0.

Finally, it also changes some user-related event logs to include
more info.

Bug: 244333150

Test: atest UserControllerTest # to check for breakage only
Test: m update-api
Test: adb shell dumpsys activity users|grep mVisibleUsers
Test: adb logcat -D -b events | egrep '(I uc_|I ssm_)'

Change-Id: I6898a7fc553b2bc600151715707b409b68e4880d
2022-10-25 09:25:02 -07:00
Ming-Shin Lu
bb42ab032d Dump InputMethodManager#{mServedView, mNextServedView} for ime tracing
As CL[1] migrated {mServedView, mNextServedView} from ImeFocusController
to InputMethodManager and removed its proto dump, we add it back to
imputmethodmanager.proto to keep it tracked in winscope for debugging.
(And deprecate the original fields in imefocuscontroller.proto)

[1]:Ie3446e1d0f62c489195e31fc7f073020884d6cae

Bug: 244504062
Test: manual as following steps:
   1) rebuild rom image and winscope
   2) flash the rom and reboot the device
   3) run the built winscope and connect with the device
   4) start record trace by winscope page
   5) stop recording and verify {servedView, nextServedView} can be
      shown on the ImeClient Tracing panel.
Change-Id: I1ffb63a2e1e73591e7bf349d88e1e56728ab0953
2022-10-20 22:40:12 +08:00
Lauren Winston
eebf4335d3 Revert "Add secure settings key for software cursor."
This reverts commit fb43f54289.

Reason for revert: Software Cursor not launching in Android U

Test: manual
Change-Id: I3f27b7d8958f455a580758192794308d5f91d152
2022-10-13 17:30:26 +00:00
Lauren Winston
d769064638 Revert "Add Settings.Secure values for Software Cursor settings for hiding"
This reverts commit 36e81f298f.

Reason for revert: Software Cursor will not be launching in Android U
Test: manual

Change-Id: Ibf70015d294e03aa74d839c0caa64bf3542b341f
2022-10-07 04:16:54 +00:00
Hai Zhang
e247dbe5fe Remove service-permission-streaming-proto-sources from platform.
Fixes: 246812597
Test: build
Change-Id: Ide9ff8a3b6009df33418e46aebd75d66be4907e4
2022-09-14 19:57:29 +00:00
Aaron Huang
75fa89293d Merge "Remove framework-connectivity-proto from platform" 2022-09-14 02:23:40 +00:00
Chris Li
14a5a54095 Merge "Expose state of ignoring orientation" am: 47653ee99d am: 4f49e133f6 am: 14ac88f4b5 am: 30c9768b66 am: b1fa65240e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2173785

Change-Id: If112e9e9d23ef1b33e450716497ea97ff156c132
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-02 03:09:51 +00:00
Chris Li
b1fa65240e Merge "Expose state of ignoring orientation" am: 47653ee99d am: 4f49e133f6 am: 14ac88f4b5 am: 30c9768b66
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2173785

Change-Id: I7bb07e4dbcbabf7014b4611ce2032661400c3af5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-02 03:01:26 +00:00
Chris Li
30c9768b66 Merge "Expose state of ignoring orientation" am: 47653ee99d am: 4f49e133f6 am: 14ac88f4b5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2173785

Change-Id: I8c991fbd9a9568bce4886e3333c981690bd92083
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-02 02:52:56 +00:00
Charles Tsai
dd8d8be35c Expose state of ignoring orientation
To support state retrieval of ignoring orientation request in
a specific display area, we have to extend capability of protocol
buffer to expose such information.

This change revises WMS's protobuf definition to reach the goal.

Bug: 234669107
Test: atest android.server.wm.AppConfigurationTests
      atest android.dpi.cts.ConfigurationScreenLayoutTest
      atest android.view.cts.AttachedSurfaceControlTest

Change-Id: I8cd658283bd90fb6a4f8c55d7a60e7e7e9202195
2022-09-01 18:20:24 +08:00
Julia Reynolds
223d8c4679 Merge "Add missing enum value" into tm-qpr-dev am: 1f8fded512 am: d32b9b832f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19783121

Change-Id: Icf1a4ad6b865c27792517a68b6d8b5b3cc45a4e8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-31 19:02:06 +00:00
Julia Reynolds
d32b9b832f Merge "Add missing enum value" into tm-qpr-dev am: 1f8fded512
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19783121

Change-Id: I956929c0f357983bad64c909b12d02b72dca0357
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-31 18:41:57 +00:00
Julia Reynolds
7b09ca8629 Add missing enum value
Test: make
Fixes: 233754823
Change-Id: Ieed92a5b831393a90f64af004dadf3fadfeb95c5
2022-08-30 16:43:18 +00:00
Zixuan Qu
a0ae5c1951 Register VibrationSettings as a listener to:
1) virtual displays creation and removal.
2) App Uids running on virtual displays.
These will be used in combination to ignore vibration initiated from a virtual display.

Test: VibrationSettingsTest, VibratorManagerServiceTest

bug: 189474679

Change-Id: Ie10dbfe65bb3ab9d62ed5c7b5ed7095a51bccf24
2022-08-27 16:38:54 +00:00
Siim Sammul
69c7bef1e9 Merge "Add a container proto to include dropped counts with proto tombstones. This is needed to keep count of how many events get dropped due to rate limiting." 2022-08-25 09:33:49 +00:00
Lauren Winston
b3403373ea Merge "Add Settings.Secure values for Software Cursor settings for hiding trigger hints and for shifting the trigger region when the keyboard is opened." 2022-08-19 17:14:51 +00:00
Aaron Huang
93239bf038 Remove framework-connectivity-proto from platform
In the generated javastream and cppsteam incident proto file,
it defines the start position for netstats at 3001 and it doesn't
actually use the NetworkStatsServiceDumpProto which is deinfed in
netstats.proto.
Thus, the framework-connectivity-proto can be removed from
framework-javastream-protos and framework-cppstream-protos.

The generated incident proto file defines netstats as the following,

    // optional .android.service.NetworkStatsServiceDumpProto netstats = 3001;
    public static final long NETSTATS = 0x0000010b00000bb9L;

Furthermore, on Android side, this is not strictly proto dependency,
and there's no one using this section, so it can be removed and mark
it as reserved.

Bug: 222625935
Test: FrameworksNetTests
      atest CtsIncidentHostTestCases:IncidentdTest
      adb shell dumpsys netstats
Change-Id: I3083a43a2f9c20768264ce2a531e0a0593f31697
2022-08-19 16:15:05 +08:00
Lauren Winston
36e81f298f Add Settings.Secure values for Software Cursor settings for hiding
trigger hints and for shifting the trigger region when the keyboard is
opened.

More context for these settings: https://docs.google.com/document/d/1hh2eY1a6wsOmOajxOUm8Xt8DT29oUvH9x0mCH83pnvk/edit#heading=h.e572ymeclvtl

Bug: 242218807
Test: SettingsBackupTest
Change-Id: I67e6d1ed0261a592aba0cb75a8e900c07683f667
2022-08-18 21:09:45 +00:00
Jeff Nainaparampil
bda6edb414 Merge "Fix unbounded number of uncached shortcuts" into tm-qpr-dev am: 0082587393 am: 57cc8e039d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19571392

Change-Id: I624e5a3d7047a5e9206f1c18b9cbac1212253271
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-17 17:03:26 +00:00
Jeff Nainaparampil
57cc8e039d Merge "Fix unbounded number of uncached shortcuts" into tm-qpr-dev am: 0082587393
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19571392

Change-Id: I7a7886dc4e30fb821bccff416bdaa96fba21856c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-17 15:59:34 +00:00
Jeff Nainaparampil
0082587393 Merge "Fix unbounded number of uncached shortcuts" into tm-qpr-dev 2022-08-17 15:41:48 +00:00
Jeff Nainaparampil
59b2f1743d Fix unbounded number of uncached shortcuts
There is a consistency issue in which some cached conversations in
People Service do not get cleaned up because they are missing a event
timestamp. For those cases, we use the creation timestamp to order by
recency and still clean up those conversations.

This change will enforce that at most `MAX_CACHED_RECENT_SHORTCUTS` are
cached by People Service for uncustomized conversations as expected.

Test: Manually with app that creates cached shortcuts and unit tests
Bug: 233926836
Change-Id: Ia017917ea56f2e233fdb837e574a8bd7c0d69e3b
2022-08-17 15:04:51 +00:00
Lais Andrade
21a1e81d7f Merge "Collect VibrationReported metrics" into tm-qpr-dev am: e076854f74 am: 6affc31cbe
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19457536

Change-Id: I173bdd9e30bfd5d19a1bab92ebc0aa24747bc59c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-17 13:53:12 +00:00
Lais Andrade
6affc31cbe Merge "Collect VibrationReported metrics" into tm-qpr-dev am: e076854f74
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19457536

Change-Id: I1d06c7720a6cfa9534a18fd88bcef846ee8a4574
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-16 13:11:32 +00:00
Lais Andrade
e076854f74 Merge "Collect VibrationReported metrics" into tm-qpr-dev 2022-08-16 11:47:49 +00:00
Lais Andrade
b8674b79c8 Collect VibrationReported metrics
Report atom VibrationReported on each vibration request received by the
VibratorManagerService.

This atom includes the vibration status, introduced as a proto enum to
be logged as an integer, the latency values and API trigger counts.

Bug: 232902688
Test: VibratorManagerServiceTest
Change-Id: Ic50def27d0fc9585941387fb7b8bfa5dceb42d78
2022-08-15 16:59:37 +01:00
Siim Sammul
d2fa0380d5 Add a container proto to include dropped counts with proto
tombstones. This is needed to keep count of how many events get dropped
due to rate limiting.

The accompanying file creation permissions change is in aosp/2112289

Bug: 225173288
Test: atest ErrorsTest

Change-Id: I1ddffc63179c44e2ce0e2297656abd45c480d4b7
2022-08-12 11:19:47 +01:00
Suprabh Shukla
0148b606f2 Merge "Cleaning up duplicate proto for ProcessStartTime" 2022-08-11 18:30:34 +00:00
Michael Wachenschwanz
0575637c2f Merge "Add Power Model info to the BatteryUsageStats atom" 2022-08-10 23:10:52 +00:00
Kristi Saney
f6a9009aee Merge "Add secure settings key for software cursor." 2022-08-10 18:02:44 +00:00
Suprabh Shukla
e6073bc3ce Cleaning up duplicate proto for ProcessStartTime
There is no need to maintain two copies of the same proto message.
Moving framework to directly use the canonical proto used by statsd.

Test: m -j statsd_testdrive
out/host/linux-x86/bin/statsd_testdrive 169

Bug: 241474647
Change-Id: Ie2bdd2151dae26a611c3905342bb49ddddf2788d
2022-08-09 18:24:19 -07:00
Kristi Saney
fb43f54289 Add secure settings key for software cursor.
Context for this setting: https://docs.google.com/document/d/1hh2eY1a6wsOmOajxOUm8Xt8DT29oUvH9x0mCH83pnvk/edit#heading=h.e572ymeclvtl

Bug: 240718050
Test: SettingsBackupTest

Change-Id: I325cff738116887f65d6254703b4ce14328c7d86
2022-08-09 21:45:24 +00:00
Kean Mariotti
4e008a8ace Traces with real-to-elapsed time offset
Add real_to_elapsed_time_offset_nanos field to protobuf traces:
- Accessibility
- IME
- WindowManager

Bug: 235196806
Change-Id: I922a85edb940719c27028623c26208ece016b9b2
Test: record and view accessibility + IME + WindowManager traces with winscope
2022-08-09 14:05:04 +00:00
Michael Wachenschwanz
cb02f0d95a Add Power Model info to the BatteryUsageStats atom
Test: atest BatteryUsageStatsPulledTest
Fixes: 241575236
Change-Id: I8dc3df7ed70914db99581cb8a2f616bb2cd9ea8e
2022-08-05 17:26:16 -07:00
Issei Suzuki
57b8f647ac Clear ActivityRecord#mDismissKeyguard flag after app launches. am: 811c0f0b02
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19500309

Change-Id: Iab5eb04e46db026a1a2f7151112a7efa5757d914
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-03 17:50:13 +00:00
Issei Suzuki
811c0f0b02 Clear ActivityRecord#mDismissKeyguard flag after app launches.
This flag is used by the SysUI to dismiss an insecure keyguard
when an app is launched from an insecure lock screen. The flag
should only affect the app launch once, so needs to be cleared
once app launch animation finishes.

Bug: 234583880
Test: atest KeyguardTests
Change-Id: I74e9e00caad0d9af80127b2fc930c4ff0d52af76
2022-08-02 16:52:46 +00:00
TreeHugger Robot
57b0b38b61 Merge "Add dock charging state into stay awake feature (2/2)" into tm-qpr-dev am: db8dacec8a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19116650

Change-Id: I3e07127a49dedb42f441a70e9555fdfb182d00f4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-26 16:37:11 +00:00
TreeHugger Robot
db8dacec8a Merge "Add dock charging state into stay awake feature (2/2)" into tm-qpr-dev 2022-07-26 15:42:36 +00:00
TreeHugger Robot
d8cd6d9b4a Merge "Add a Settings.Secure value to store extra battery saver schedule" into tm-qpr-dev am: 1dc27fa1f6 am: 00be659711
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19194690

Change-Id: I3928a59c7730582f3ece664274d670ff98e78080
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-25 16:46:03 +00:00
TreeHugger Robot
00be659711 Merge "Add a Settings.Secure value to store extra battery saver schedule" into tm-qpr-dev am: 1dc27fa1f6
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19194690

Change-Id: I99927c9818b93b73f268bdc64fda1813e0d7b346
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-25 16:26:58 +00:00
Wesley Wang
c7adaf6f0f Add a Settings.Secure value to store extra battery saver schedule
- To store extra battery saver schedule mode

Bug: 224899180
Bug: 236688783
Bug: 238841059
Test: Build pass and local access verify
Change-Id: I4a394de04fdb9020ce22377390b81bccfaec2090
2022-07-23 08:10:29 +00:00
wesleycwwang
9121f848db Add dock charging state into stay awake feature (2/2)
- Make dump proto method support dock charging state
 - Add dock charging into proto file and validators

Bug: 233704731
Test: atest FrameworksServicesTests
Change-Id: I8208414cc40a12f783749d2c7a9f71be6efab8d9
2022-07-20 06:09:02 +00:00
Wesley Wang
496afc58c9 Merge "Add dock charging state into stay awake feature (2/2)" 2022-07-15 02:55:27 +00:00
Yunfan Chen
3111dcd51a Merge "Introduce InsetsSizeOverride" into tm-qpr-dev am: dd1b8480de am: 57ad712787
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19095354

Change-Id: Id1aafab84f4d269387e605d7e8e1ffb63902e88e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-13 03:36:33 +00:00
Yunfan Chen
57ad712787 Merge "Introduce InsetsSizeOverride" into tm-qpr-dev am: dd1b8480de
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19095354

Change-Id: I8784d9ebb838c7a906fb61119223a92e669f090f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-13 03:14:29 +00:00
wesleycwwang
8ccdab518f Add dock charging state into stay awake feature (2/2)
- Make dump proto method support dock charging state
 - Add dock charging into proto file and validators

Bug: 233704731
Test: atest FrameworksServicesTests
Change-Id: I8208414cc40a12f783749d2c7a9f71be6efab8d9
2022-07-12 07:01:08 +00:00
Yunfan Chen
14f94246f6 Introduce InsetsSizeOverride
This is to let the insets provider provide a different size to the given
windowing typed window. This can completely replace the ime frame
provider and the old ime frame provider is migrated.

Test: The task bar can still provide correct IME insets
Test: DisplayPolicyInsetsTests
Test: WmTests
Bug: 225200928
Change-Id: I5f8c4462cdc48011efda908e0337a86cbf2a417f
2022-07-06 16:41:38 +09:00
Edgar Arriaga
506e3f17c5 Add sql statement cache miss info and test
This patch adds a test for checking that statement cache
works and it also improves dumpsys diagnostics to include
per database stats as previously it only showed per connection
stats which could have data loss if a connection was dropped
for any reason and not put back in the pool and it also
provides the aggregated view.

Test: dumpsys meminfo
Test: atest SQLiteDatabasePerfTest#testSelectCacheMissRate
Bug: 228498581

Change-Id: Ia49264e8f0e6db83234c2ba5943fd9e25fd5d8b2
2022-06-30 18:47:06 +00:00