Frameworks/base: Refactor UserHandle and Environment a bit

Refactor slightly to forbid using myUserId in the zygote (uid == 0).
Also factor Environment to put user data (vs shared data) into its
own class, which should keep the page the shared data is on actually
shared between processes.

Bug: 29338430
Change-Id: I05d1306b57658a83299e38076171f56cb364ea80
This commit is contained in:
Andreas Gampe
2016-06-14 17:13:37 -07:00
parent 3c32cf8a8c
commit 6e16714c68
4 changed files with 46 additions and 22 deletions

View File

@@ -284,6 +284,9 @@ public final class SystemServer {
// we've defined it before booting further.
Build.ensureFingerprintProperty();
// Initialize Environment for the system user.
Environment.init();
// Within the system server, it is an error to access Environment paths without
// explicitly specifying a user.
Environment.setUserRequired(true);