Environment should only warn when asked.
Instead of warning on Process.SYSTEM_UID, which is also used by the
Settings app, change to have the parent process explicitly ask for
warnings.
Bug: 8667286
Change-Id: Ib26676694a4041ff4e6d3ffdcc14055b7eba13c7
diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java
index a30fc3b..681c21d 100644
--- a/services/java/com/android/server/SystemServer.java
+++ b/services/java/com/android/server/SystemServer.java
@@ -26,6 +26,7 @@
import android.content.res.Configuration;
import android.media.AudioService;
import android.net.wifi.p2p.WifiP2pService;
+import android.os.Environment;
import android.os.Handler;
import android.os.HandlerThread;
import android.os.Looper;
@@ -1055,6 +1056,8 @@
// as efficient as possible with its memory usage.
VMRuntime.getRuntime().setTargetHeapUtilization(0.8f);
+ Environment.setUserRequired(true);
+
System.loadLibrary("android_servers");
init1(args);
}