am bf88205b: Fall back to persist.sys.language/country if locale isn\'t set.
* commit 'bf88205bef88f78ade5c6830e6203aa343387820': Fall back to persist.sys.language/country if locale isn't set.
This commit is contained in:
@@ -95,6 +95,7 @@ import com.android.server.wm.WindowManagerService;
|
||||
import dalvik.system.VMRuntime;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Locale;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
|
||||
@@ -182,6 +183,23 @@ public final class SystemServer {
|
||||
SystemClock.setCurrentTimeMillis(EARLIEST_SUPPORTED_TIME);
|
||||
}
|
||||
|
||||
// If the system has "persist.sys.language" and friends set, replace them with
|
||||
// "persist.sys.locale". Note that the default locale at this point is calculated
|
||||
// using the "-Duser.locale" command line flag. That flag is usually populated by
|
||||
// AndroidRuntime using the same set of system properties, but only the system_server
|
||||
// and system apps are allowed to set them.
|
||||
//
|
||||
// NOTE: Most changes made here will need an equivalent change to
|
||||
// core/jni/AndroidRuntime.cpp
|
||||
if (!SystemProperties.get("persist.sys.language").isEmpty()) {
|
||||
final String languageTag = Locale.getDefault().toLanguageTag();
|
||||
|
||||
SystemProperties.set("persist.sys.locale", languageTag);
|
||||
SystemProperties.set("persist.sys.language", "");
|
||||
SystemProperties.set("persist.sys.country", "");
|
||||
SystemProperties.set("persist.sys.localevar", "");
|
||||
}
|
||||
|
||||
// Here we go!
|
||||
Slog.i(TAG, "Entered the Android system server!");
|
||||
EventLog.writeEvent(EventLogTags.BOOT_PROGRESS_SYSTEM_RUN, SystemClock.uptimeMillis());
|
||||
|
||||
Reference in New Issue
Block a user