summaryrefslogtreecommitdiff
path: root/libs/androidfw/StringPool.cpp
diff options
context:
space:
mode:
author Eric Biggers <ebiggers@google.com> 2022-05-27 22:23:36 +0000
committer Eric Biggers <ebiggers@google.com> 2022-06-01 06:24:04 +0000
commit407bc2617e04c79066eabbc2d9e39cf37f37d875 (patch)
treecef87a887f7a35d86af429cc70a4e38736729131 /libs/androidfw/StringPool.cpp
parentf347ef66de548c272d92e8e7abb91dbd71933ce7 (diff)
UsageStatsService: ignore removed users in persistPendingEventsLocked()
If a pre-created user is removed before it becomes a full user, the ACTION_USER_REMOVED intent is never sent, so UsageStatsService is never notified that the user's pending events should be discarded. It will eventually try to persist the events. As the first step, it tries to create /data/system_de/$userId/usagestats and the parent directory /data/system_de/$userId if it doesn't already exist. However, due to https://r.android.com/2078213 the SELinux policy no longer allows system_server to create /data/system_de/$userId. The failure to create this directory is causing UsageStatsService to throw an IllegalStateException which crashes system_server. (Before the sepolicy change, system_server could create /data/system_de/$userId, so the crash wouldn't have happened. But problems still might have occurred if the user ID was reused.) The underlying user state tracking bug still needs to be fixed. For now, just avoid crashing system_server unnecessarily, and avoid an SELinux denial by using mkdir() instead of mkdirs(). Test: pm create-user --pre-create-only pm remove-user 10 # Wait 20 minutes and check logcat. Bug: 234059731 Change-Id: Ic5efc19cda6b820a2c07f77b4f316d501acb9e80
Diffstat (limited to 'libs/androidfw/StringPool.cpp')
0 files changed, 0 insertions, 0 deletions