Commit Graph

688253 Commits

Author SHA1 Message Date
Eric Biggers
3d9c19f2fd BrightnessTracker: don't create stuff directly in /data/system_de
/data/system_de is only for per-user data; it *must* only contain
per-user encrypted directories.  Only vold should ever create anything
directly in this directory.  In preparation for removing system_server's
write access to this directory (https://r.android.com/2078213), make
BrightnessTracker store its brightness_events.xml file at
/data/system/brightness_events.xml instead of
/data/system_de/brightness_events.xml, and likewise for
ambient_brightness_stats.xml.

Migration happens lazily, except that the old files aren't ever deleted
since the SELinux policy will no longer allow system_server to do that;
the old files just stop being used.  vold will need to handle the
cleanup instead, or we could just leave the files around.

Test: Flashed new build without wiping userdata.  Log shows "Reading
      ambient_brightness_stats.xml from old location" as expected.
      Rebooted.  Log message no longer appears, as expected.  File
      /data/system/ambient_brightness_stats.xml exists, as expected.
Bug: 156305599
Change-Id: I6e0948ac54ec9183348943234d505e7466042963
2022-05-04 22:35:17 +00:00
Xin Li
3c7a3e397f Merge "Merge SP2A.220505.002" 2022-05-04 20:30:20 +00:00
Eric Biggers
0c0888da1d Merge "UserDataPreparer: fix volume preparation order" 2022-05-04 18:56:16 +00:00
Miguel Aranda
2dc0d124a7 Merge "Still more libcore benchmarks migrated to Crystal Ball." 2022-05-04 16:55:08 +00:00
Shreerag Jayakrishnan
0bcfa16d6c Merge "Add Activity Recognition to default grants for Home app on Wear." 2022-05-04 14:59:07 +00:00
Miguel Aranda
2427797def Merge "Libcore VarHandle generator script and tests." 2022-05-04 12:31:56 +00:00
Miguel
2c04bb22f4 Still more libcore benchmarks migrated to Crystal Ball.
Test: atest {TestName}
Change-Id: I9e67814d011fc13a9a2cf57f2bf543ba89d9aaa2
2022-05-04 10:16:08 +00:00
Hyundo Moon
0bec859fb5 Merge "Rename CachedBluetoothDevice.setMemberDevice to addMemberDevice" 2022-05-04 10:14:20 +00:00
Miguel
4d8a847ab4 Libcore VarHandle generator script and tests.
Test: atest {TestName}
Change-Id: I6df071657a8d04ed4dd4c00ac4f4e2e941c91322
2022-05-04 10:00:26 +00:00
Jaegeuk Kim
65e07d31d4 Merge changes from topic "fscklog_f2fs"
* changes:
  Upload f2fs fscklog
  Keep the fsck log in /dev/fscklogs/fsck for bug report
2022-05-04 07:35:09 +00:00
Eric Biggers
a8a53c2615 UserDataPreparer: fix volume preparation order
Internal storage must be prepared before adoptable storage, since the
user's volume keys are stored in their internal storage.  Previously,
the order depended on the Java hashcodes of the volume IDs.  It seems
that in practice things sort of worked out anyway even with the wrong
order, via a bizarre sequence of events involving the user's storage
being deleted and re-created several times.  Regardless, let's fix it.

destroyUserData() sort of had the reverse bug, although I don't think it
actually mattered.  My concern there was that destroying the internal
storage first would bypass vold's destroyKey() for the volume keys.
However, that's okay since the volume keys don't actually need a special
destruction procedure in this case.  Also, internal storage has already
been locked when destroyUserData() runs anyway.

Test: On Cuttlefish:
      $ sm partition disk:253,32 private
      $ pm create-user 10
      $ pm remove-user 10
      Checked logcat for expected messages.
Bug: 231387956
Change-Id: I146d8c786c6b923aed7f8c748db8a7e90c96687f
2022-05-04 06:45:06 +00:00
Hyundo Moon
5c811c4df5 Rename CachedBluetoothDevice.setMemberDevice to addMemberDevice
Also fixes some typos.

Test: builds successfully
Change-Id: I39242b40ebe154b8b89f00f48ea320b18f56ecd7
2022-05-04 05:24:44 +00:00
Jeff Sharkey
6816c0d8dd Merge "Add Frank/team as android_os_GraphicsEnvironment.cpp OWNERS" 2022-05-04 00:37:56 +00:00
Shreerag Jayakrishnan
de7f98153e Add Activity Recognition to default grants for Home app on Wear.
Bug: 228252687
Test: Home app is granted Activity Recognition by default
Change-Id: I1084fc266ef5a2163fea95aa2ead22175ce18d2e
2022-05-03 22:58:10 +00:00
Ian Elliott
cf9df36902 Add Frank/team as android_os_GraphicsEnvironment.cpp OWNERS
Bug: 221459804
Test: Visual inspection
Change-Id: Icf4c65bc5a063574a4d6c860bd494b7f2624dc4d
2022-05-03 16:26:02 -06:00
Treehugger Robot
beccf603e8 Merge "Freeze all package processes before killing" 2022-05-03 21:49:42 +00:00
Xin Li
fd1b1662e9 Merge SP2A.220505.002
Bug: 231319788
Merged-In: I7707d01be37582461227edcecf5d559f2019c8a5
Change-Id: I1dad245a352258f2a0017b85f14c99f305d8d660
2022-05-03 20:53:01 +00:00
Suren Baghdasaryan
9e68daf1c8 Merge "Do not purge process groups on system_server startup" 2022-05-03 19:44:23 +00:00
Neil Fuller
6576601e82 Merge "Capitalize TZ display name strings" 2022-05-03 19:22:03 +00:00
Jayachandran C
3e25e7a0b8 Merge "Update SMS short code list for Italy" 2022-05-03 18:55:35 +00:00
Treehugger Robot
d58f16c645 Merge "Moved telephony related resource to a separate file" 2022-05-03 14:26:16 +00:00
Treehugger Robot
6fd3435745 Merge "Bit: teach bit how to print number of @Ignored tests" 2022-05-03 10:55:06 +00:00
Treehugger Robot
78e7ddbf43 Merge "Bit: use exec-out instead of shell" 2022-05-03 10:54:58 +00:00
Treehugger Robot
2ca9a7aeaa Merge "Update API doc for accidentally exposed NETWORK_TYPE_BITMASK_LTE_CA" 2022-05-03 07:28:19 +00:00
Jaegeuk Kim
624c1d307e Upload f2fs fscklog
Bug: 230637147
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Change-Id: I20568355f201bad371daae4e9a7fcc1bcd208e1d
2022-05-02 23:24:21 -07:00
Treehugger Robot
d24351d56e Merge "UsageStatsService: don't create stuff directly in /data/system_de" 2022-05-03 02:54:57 +00:00
Jack Yu
9c278dea57 Moved telephony related resource to a separate file
Test: Build
Bug: None
Merged-In: Iebbee458035538f47ebd82fb7b9ba5fcf74d33db
Change-Id: Iebbee458035538f47ebd82fb7b9ba5fcf74d33db
2022-05-02 15:42:10 -07:00
Jaegeuk Kim
c30d209f5f Keep the fsck log in /dev/fscklogs/fsck for bug report
Let's keep the log for bug report.

Bug: 230637147
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Change-Id: I4392c8b6d0332a18ea9302bdf53f902fde6d03dd
2022-05-02 15:09:49 -07:00
Eric Biggers
e25b77c1db UsageStatsService: don't create stuff directly in /data/system_de
/data/system_de is only for per-user data; it *must* only contain
per-user encrypted directories.  Only vold should ever create anything
directly in this directory.  In preparation for removing system_server's
write access to this directory (https://r.android.com/2078213), make
UsageStatsService store its globalcomponentusage file at
/data/system/usagestats/globalcomponentusage instead of
/data/system_de/usagestats/globalcomponentusage.

Migration happens lazily, except that the old file and directory aren't
ever deleted since the SELinux policy will no longer allow system_server
to do that; the old file just stops being used.  vold will need to
handle the cleanup instead, or we could just leave the file around.

Note that before Android 11, UsageStatsService stored per-user stats in
/data/system/usagestats/$userId.  These per-user stats are *not* the
same thing as globalcomponentusage, which was added in Android 12.
UsageStatsService contains code to migrate the per-user stats to
/data/system_ce/$userId/usagestats.  This is fine, and is the right
thing to do, since the per-user stats are potentially sensitive per-user
data.  This does mean that UsageStatsService now implements two types of
migrations, and that the source directory for one migration is the
target directory for the other, which is a bit unfortunate.  However,
since different files are involved in each one, it all works out.

Bug: 156305599
Change-Id: I53c16640e8ed8b7eac111990f1cdb3f59579e051
2022-05-02 20:58:00 +00:00
Ling Ma
6b7f9df1de Update API doc for accidentally exposed NETWORK_TYPE_BITMASK_LTE_CA
NETWORK_TYPE_BITMASK_LTE_CA is not used anywhere even if it's
accidentally passed into setAllowedNetworkTypesForReason(). Will be deprecated in U.

Fix: 230383206
Test: atest cts/tests/tests/telephony/current/src/android/telephony/cts/TelephonyManagerTest.java
Change-Id: Id0c521c4fb74eaf7d73deaf122e923f72b924c18
2022-05-02 13:52:18 -07:00
Eric Biggers
697b47b692 Merge "UserDataPreparer: only delete contents of user's system CE and DE dirs" 2022-05-02 20:15:47 +00:00
Treehugger Robot
13e9a8c0a2 Merge "Add "ro.hardware.egl_legacy" for ANGLE system driver" 2022-05-02 18:41:39 +00:00
Jayachandran C
61e314ec30 Update SMS short code list for Italy
Bug: 213183041
Change-Id: I043d3e7c24f59d17779f81c8a43109beecf7d881
Test: Manually verified by replacing it to US and sending messages to the short numbers
2022-04-29 23:21:50 +00:00
Treehugger Robot
416502831f Merge "Fixes UMS.getPreCreatedUserLU() to ignore partial pre-created users." 2022-04-29 21:27:29 +00:00
T.J. Mercier
a666f83b82 Freeze all package processes before killing
Apps are able to prevent their death by forking multiple processes
under different services and monitoring for the death of any of these.
When a child death is detected, the remaining process restarts the
terminating/terminated service before it's able to be killed itself.
This is now prevented by freezing all processes before killing any of
them so that no process can react to the death of another.

Bug: 148425913
Test: vsoc_arm64:/ $ monkey -p com.haok.nirvana 1
Test: bash arg: -p
Test: bash arg: com.haok.nirvana
Test: bash arg: 1
Test: args: [-p, com.haok.nirvana, 1]
Test: arg: "-p"
Test: arg: "com.haok.nirvana"
Test: arg: "1"
Test: data="com.haok.nirvana"
Test: Events injected: 1
Test: ## Network stats: elapsed time=3200ms (0ms mobile, 0ms wifi, 3200ms not connected)
Test: vsoc_arm64:/ $ ps -eo pid,uid,ppid,name|grep 10088
Test: 6827 10088  2973 com.haok.nirvana
Test: 6850 10088  2973 com.haok.nirvana:resident
Test: 6867 10088  2973 android.media
Test: 6895 10088     1 app_d
Test: 6899 10088     1 app_d
Test: vsoc_arm64:/ $ am force-stop com.haok.nirvana
Test: vsoc_arm64:/ $ ps -eo pid,uid,ppid,name |grep 10088
Test: 1|vsoc_arm64:/ $
Test: Also tested manually on Pixel 6 Pro
Change-Id: Ib0231eaf4b11b15a3d6bac5dc5486844f0f81d18
2022-04-29 20:36:54 +00:00
Felipe Leme
03d7a23d36 Merge "Cleanup user data when user stopped" 2022-04-29 19:40:05 +00:00
Eric Biggers
a703d2f5cb UserDataPreparer: only delete contents of user's system CE and DE dirs
The /data/system_ce/$userId and /data/system_de/$userId directories are
created by vold, so they should be deleted by vold as well, and in fact
that would already happen except that system_server deletes them
recursively before vold gets to it.  Change system_server to delete just
the contents of these directories.

This is a prerequisite to locking down the ability to create these
directories (https://r.android.com/2078213), which is needed to stop
subdirectories from accidentally being created too early.  Technically
we could achieve this goal without limiting delete access, as it's
create access that really matters, but having the operations be paired
properly is much cleaner.

Test: Created and deleted a user, and verified that all their
      directories still got deleted.
Test: atest UserDataPreparerTest
Bug: 156305599
Change-Id: Iec908e1bc15a00c7179fcd1d80321c315682d339
2022-04-29 19:04:32 +00:00
Kiwon Park
dd570fd0a6 Merge "Log TelephonyAnomalyDetected event from AnomalyReporter" 2022-04-29 18:53:48 +00:00
Suren Baghdasaryan
2239be877c Do not purge process groups on system_server startup
Removing all process groups during system_server startup can race with
process group creation from init which results in occasional failure to
create a process group and failure to boot the device.
Move process group purging into init to prevent such a race.

Bug: 228160715
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: I2e50f53c9692424c994c0b4ee6f1e2762632c3bc
2022-04-29 16:47:08 +00:00
Felipe Leme
8cce6d422b Fixes UMS.getPreCreatedUserLU() to ignore partial pre-created users.
Test: atest android.car.cts.PreCreateUsersHostTest#testAppPermissionsPreCreatedUserPackages # on automotive
Fixes: 229814265

Change-Id: I7c6b90e2c4af5ff0482c5445c1986d389e6a6610
Merged-In: I7c6b90e2c4af5ff0482c5445c1986d389e6a6610
(cherry picked from commit f173defe6e)
2022-04-29 09:32:08 -07:00
Miguel Aranda
14fff66fa2 Merge "Even more libcore benchmark tests." 2022-04-29 09:22:12 +00:00
Lucas Lin
c45eb2877a Merge changes from topics "CATEGORY_ERROR_IKE", "CATEGORY_ERROR_NETWORK", "CATEGORY_ERROR_USER_DEACTIVATED", "CATEGORY_EVENT_ALWAYS_ON_STATE_CHANGED"
* changes:
  Send VPN manager event when there is a network error
  Send VPN manager event when there is an IkeProtocolException
  Send VPN manager event when VPN is deactivated
  Send VPN manager event when VPN always-on status is changed
2022-04-29 08:13:51 +00:00
Mårten Kongstad
63312a63e0 Bit: teach bit how to print number of @Ignored tests
Teach bit about @Ignored tests (resultCode -3). If any ignored tests
are found, bit will now print

  Ran 10 tests for Foo. 10 passed, 0 failed, 1 ignored

However, if no ignored tests are found, bit will omit the "N ignored"
part.

Test: manual: bit CtsOpenGLTestCases:android.opengl.cts.CompressedTextureTest#testTextureATC, check output contains "0 passed, 0 failed, 1 ignored"
Change-Id: Ifde68efc99cb98bcf4a7bd73c389a846055c5449
2022-04-29 07:07:18 +00:00
Mårten Kongstad
4dcd3e0c48 Bit: use exec-out instead of shell
By switching to 'adb exec-out' instead of 'adb shell', characters such
as # no longer need to be escaped when executing a single
instrumentation method. The new syntax is simply

  $ bit module:class#method

Note: the old syntax (module:class\#method) still works.

Test: manual: bit InternalTests:android.app.WallpaperColorsTest#colorHintsTest, test should execute
Change-Id: I8c86faf2ccaf84834030f6ba7567cb4cecd37bc6
2022-04-29 07:06:05 +00:00
lucaslin
64eaff5dba Send VPN manager event when there is a network error
Bug: 191413541
Test: atest FrameworksNetTests:VpnTest
Change-Id: I767e23750ccf12c0c787a3ec23d4a520dc5bb570
2022-04-29 01:58:56 +00:00
lucaslin
4e1f12986a Send VPN manager event when there is an IkeProtocolException
Bug: 191413541
Test: atest FrameworksNetTests:VpnTest
Change-Id: Iff00d1f2728d36b23d58bda122f02d7676f49323
2022-04-29 01:48:02 +00:00
lucaslin
3f5bf1f059 Send VPN manager event when VPN is deactivated
Bug: 191413541
Test: atest FrameworksNetTests:VpnTest
Change-Id: I35fc360204f0227a969ff2b12a4c47f701a55a9c
2022-04-29 01:45:45 +00:00
lucaslin
48ed354751 Send VPN manager event when VPN always-on status is changed
Bug: 225010642
Test: atest FrameworksNetTests:VpnTest
Change-Id: I8d5fb7fdc4ba5e62d272a5b74466e45e1fc051af
2022-04-29 01:45:33 +00:00
sz656r
454b6c590f Cleanup user data when user stopped
1. During the quick user switch, the user status is changed from
   STATE_STOPPING to STATE_BOOTING, the process android.process.core
   (ContactsProvider2) was not closed, but the AccountManagerService
   cleanup the user in stopping stage.

2. When the user is switched back, the old ContactsProvider2
   process was used, but the client doesn't have the listener
   registered for AccountManager any more.

3. This causes the ContactsProvider reloaded again when the phone
   is connected, then duplicated contacts will show on the screen.

4. Solution is cleaning up the user data in onUserStopped.

Test: manual verification

Bug: 224818967

Change-Id: I8fb44e0e66ff73c055a548d57ff3d45ecc213f71
2022-04-28 23:22:54 +00:00
Colin Cross
b61b9e11b4 Merge "Update SysUI to be compatible with latest Jetpack libraries" 2022-04-28 22:11:00 +00:00