blob: 5dd3c5b117ba75558d28609bdd2747d1c91d1052 [file] [log] [blame]
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001/*
2 * Copyright (C) 2006 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package com.android.server;
18
Jeff Hamilton35eef702010-06-09 15:45:18 -050019import android.accounts.AccountManagerService;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080020import android.app.ActivityManagerNative;
Nick Pellyf242b7b2009-10-08 00:12:45 +020021import android.bluetooth.BluetoothAdapter;
Joe Onoratof3c3c4f2010-10-21 11:09:02 -040022import android.content.ComponentName;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080023import android.content.ContentResolver;
24import android.content.ContentService;
25import android.content.Context;
Joe Onoratof3c3c4f2010-10-21 11:09:02 -040026import android.content.Intent;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080027import android.content.pm.IPackageManager;
Joe Onoratodc565f42010-10-04 15:27:22 -040028import android.content.res.Configuration;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080029import android.media.AudioService;
Irfan Sherifff6d09842011-08-03 15:37:08 -070030import android.net.wifi.p2p.WifiP2pService;
Jeff Hamilton35eef702010-06-09 15:45:18 -050031import android.os.Looper;
32import android.os.RemoteException;
33import android.os.ServiceManager;
Brad Fitzpatrickc74a1b442010-09-10 16:03:29 -070034import android.os.StrictMode;
Jeff Hamilton35eef702010-06-09 15:45:18 -050035import android.os.SystemClock;
36import android.os.SystemProperties;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080037import android.provider.Settings;
38import android.server.BluetoothA2dpService;
Nick Pellybd022f42009-08-14 18:33:38 -070039import android.server.BluetoothService;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080040import android.server.search.SearchManagerService;
Joe Onoratodc565f42010-10-04 15:27:22 -040041import android.util.DisplayMetrics;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080042import android.util.EventLog;
Joe Onorato8a9b2202010-02-26 18:56:32 -080043import android.util.Slog;
Brad Fitzpatrick5fdc0c72010-10-12 13:12:18 -070044import android.view.WindowManager;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080045
Jeff Sharkeyc006f1a2011-05-19 17:12:49 -070046import com.android.internal.app.ShutdownThread;
47import com.android.internal.os.BinderInternal;
48import com.android.internal.os.SamplingProfilerIntegration;
49import com.android.server.accessibility.AccessibilityManagerService;
50import com.android.server.am.ActivityManagerService;
51import com.android.server.net.NetworkPolicyManagerService;
Jeff Sharkey75279902011-05-24 18:39:45 -070052import com.android.server.net.NetworkStatsService;
Jeff Sharkeyc006f1a2011-05-19 17:12:49 -070053import com.android.server.pm.PackageManagerService;
54import com.android.server.usb.UsbService;
55import com.android.server.wm.WindowManagerService;
56
57import dalvik.system.VMRuntime;
58import dalvik.system.Zygote;
59
Dan Egnor4410ec82009-09-11 16:40:01 -070060import java.io.File;
Bob Leee5408332009-09-04 18:31:17 -070061import java.util.Timer;
62import java.util.TimerTask;
63
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080064class ServerThread extends Thread {
65 private static final String TAG = "SystemServer";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080066
Jeff Hamilton35eef702010-06-09 15:45:18 -050067 ContentResolver mContentResolver;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080068
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080069 @Override
70 public void run() {
Doug Zongkerab5c49c2009-12-04 10:31:43 -080071 EventLog.writeEvent(EventLogTags.BOOT_PROGRESS_SYSTEM_RUN,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080072 SystemClock.uptimeMillis());
73
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080074 Looper.prepare();
75
76 android.os.Process.setThreadPriority(
77 android.os.Process.THREAD_PRIORITY_FOREGROUND);
78
Dianne Hackborn887f3552009-12-07 17:59:37 -080079 BinderInternal.disableBackgroundScheduling(true);
Christopher Tate160edb32010-06-30 17:46:30 -070080 android.os.Process.setCanSelfBackground(false);
Sen Hubde75702010-05-28 01:54:03 -070081
Kenny Rootf547d672010-09-22 10:36:48 -070082 // Check whether we failed to shut down last time we tried.
83 {
84 final String shutdownAction = SystemProperties.get(
85 ShutdownThread.SHUTDOWN_ACTION_PROPERTY, "");
86 if (shutdownAction != null && shutdownAction.length() > 0) {
87 boolean reboot = (shutdownAction.charAt(0) == '1');
88
89 final String reason;
90 if (shutdownAction.length() > 1) {
91 reason = shutdownAction.substring(1, shutdownAction.length());
92 } else {
93 reason = null;
94 }
95
96 ShutdownThread.rebootOrShutdown(reboot, reason);
97 }
98 }
99
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800100 String factoryTestStr = SystemProperties.get("ro.factorytest");
101 int factoryTest = "".equals(factoryTestStr) ? SystemServer.FACTORY_TEST_OFF
102 : Integer.parseInt(factoryTestStr);
103
Mike Lockwood3a322132009-11-24 00:30:52 -0500104 LightsService lights = null;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800105 PowerManagerService power = null;
Mike Lockwood07a500f2009-08-12 09:56:44 -0400106 BatteryService battery = null;
Jeff Sharkey75279902011-05-24 18:39:45 -0700107 AlarmManagerService alarm = null;
Jeff Sharkeyc006f1a2011-05-19 17:12:49 -0700108 NetworkManagementService networkManagement = null;
Jeff Sharkey75279902011-05-24 18:39:45 -0700109 NetworkStatsService networkStats = null;
Jeff Sharkeya4620792011-05-20 15:29:23 -0700110 NetworkPolicyManagerService networkPolicy = null;
Mike Lockwood0f79b542009-08-14 14:18:49 -0400111 ConnectivityService connectivity = null;
repo sync55bc5f32011-06-24 14:23:07 -0700112 WifiP2pService wifiP2p = null;
repo syncaea743a2011-07-29 23:55:49 -0700113 WifiService wifi = null;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800114 IPackageManager pm = null;
115 Context context = null;
116 WindowManagerService wm = null;
Nick Pellybd022f42009-08-14 18:33:38 -0700117 BluetoothService bluetooth = null;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800118 BluetoothA2dpService bluetoothA2dp = null;
Praveen Bharathi21e941b2010-10-06 15:23:14 -0500119 WiredAccessoryObserver wiredAccessory = null;
Dan Murphyc9f4eaf2009-08-12 15:15:43 -0500120 DockObserver dock = null;
Mike Lockwood770126a2010-12-09 22:30:37 -0800121 UsbService usb = null;
Dianne Hackborn7299c412010-03-04 18:41:49 -0800122 UiModeManagerService uiMode = null;
Dianne Hackborn21f1bd12010-02-19 17:02:21 -0800123 RecognitionManagerService recognition = null;
Robert Greenwalt9e696c22010-04-01 14:45:18 -0700124 ThrottleService throttle = null;
Amith Yamasani6734b9f62010-09-13 16:24:08 -0700125 NetworkTimeUpdateService networkTimeUpdater = null;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800126
127 // Critical services...
128 try {
Joe Onorato8a9b2202010-02-26 18:56:32 -0800129 Slog.i(TAG, "Entropy Service");
Nick Kralevich4fb25612009-06-17 16:03:22 -0700130 ServiceManager.addService("entropy", new EntropyService());
131
Joe Onorato8a9b2202010-02-26 18:56:32 -0800132 Slog.i(TAG, "Power Manager");
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800133 power = new PowerManagerService();
134 ServiceManager.addService(Context.POWER_SERVICE, power);
135
Joe Onorato8a9b2202010-02-26 18:56:32 -0800136 Slog.i(TAG, "Activity Manager");
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800137 context = ActivityManagerService.main(factoryTest);
138
Joe Onorato8a9b2202010-02-26 18:56:32 -0800139 Slog.i(TAG, "Telephony Registry");
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800140 ServiceManager.addService("telephony.registry", new TelephonyRegistry(context));
141
142 AttributeCache.init(context);
143
Joe Onorato8a9b2202010-02-26 18:56:32 -0800144 Slog.i(TAG, "Package Manager");
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800145 pm = PackageManagerService.main(context,
146 factoryTest != SystemServer.FACTORY_TEST_OFF);
147
148 ActivityManagerService.setSystemProcess();
149
150 mContentResolver = context.getContentResolver();
151
Fred Quintanae91ebe22009-09-29 20:44:30 -0700152 // The AccountManager must come before the ContentService
Fred Quintana60307342009-03-24 22:48:12 -0700153 try {
Joe Onorato8a9b2202010-02-26 18:56:32 -0800154 Slog.i(TAG, "Account Manager");
Fred Quintana60307342009-03-24 22:48:12 -0700155 ServiceManager.addService(Context.ACCOUNT_SERVICE,
156 new AccountManagerService(context));
157 } catch (Throwable e) {
Joe Onorato8a9b2202010-02-26 18:56:32 -0800158 Slog.e(TAG, "Failure starting Account Manager", e);
Fred Quintana60307342009-03-24 22:48:12 -0700159 }
160
Joe Onorato8a9b2202010-02-26 18:56:32 -0800161 Slog.i(TAG, "Content Manager");
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800162 ContentService.main(context,
163 factoryTest == SystemServer.FACTORY_TEST_LOW_LEVEL);
164
Joe Onorato8a9b2202010-02-26 18:56:32 -0800165 Slog.i(TAG, "System Content Providers");
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800166 ActivityManagerService.installSystemProviders();
167
Joe Onorato8a9b2202010-02-26 18:56:32 -0800168 Slog.i(TAG, "Lights Service");
Mike Lockwood3a322132009-11-24 00:30:52 -0500169 lights = new LightsService(context);
170
Joe Onoratode1b3592010-10-25 20:36:47 -0700171 Slog.i(TAG, "Battery Service");
172 battery = new BatteryService(context, lights);
173 ServiceManager.addService("battery", battery);
174
Joe Onorato8a9b2202010-02-26 18:56:32 -0800175 Slog.i(TAG, "Vibrator Service");
Mike Lockwood3a322132009-11-24 00:30:52 -0500176 ServiceManager.addService("vibrator", new VibratorService(context));
The Android Open Source Project10592532009-03-18 17:39:46 -0700177
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800178 // only initialize the power service after we have started the
Mike Lockwood3a322132009-11-24 00:30:52 -0500179 // lights service, content providers and the battery service.
180 power.init(context, lights, ActivityManagerService.getDefault(), battery);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800181
Joe Onorato8a9b2202010-02-26 18:56:32 -0800182 Slog.i(TAG, "Alarm Manager");
Jeff Sharkey75279902011-05-24 18:39:45 -0700183 alarm = new AlarmManagerService(context);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800184 ServiceManager.addService(Context.ALARM_SERVICE, alarm);
185
Joe Onorato8a9b2202010-02-26 18:56:32 -0800186 Slog.i(TAG, "Init Watchdog");
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800187 Watchdog.getInstance().init(context, battery, power, alarm,
188 ActivityManagerService.self());
189
Joe Onorato8a9b2202010-02-26 18:56:32 -0800190 Slog.i(TAG, "Window Manager");
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800191 wm = WindowManagerService.main(context, power,
192 factoryTest != SystemServer.FACTORY_TEST_LOW_LEVEL);
193 ServiceManager.addService(Context.WINDOW_SERVICE, wm);
194
195 ((ActivityManagerService)ServiceManager.getService("activity"))
196 .setWindowManager(wm);
197
198 // Skip Bluetooth if we have an emulator kernel
199 // TODO: Use a more reliable check to see if this product should
200 // support Bluetooth - see bug 988521
201 if (SystemProperties.get("ro.kernel.qemu").equals("1")) {
David 'Digit' Turnere2a5e862011-01-17 00:32:33 +0100202 Slog.i(TAG, "No Bluetooh Service (emulator)");
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800203 } else if (factoryTest == SystemServer.FACTORY_TEST_LOW_LEVEL) {
David 'Digit' Turnere2a5e862011-01-17 00:32:33 +0100204 Slog.i(TAG, "No Bluetooth Service (factory test)");
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800205 } else {
Joe Onorato8a9b2202010-02-26 18:56:32 -0800206 Slog.i(TAG, "Bluetooth Service");
Nick Pellybd022f42009-08-14 18:33:38 -0700207 bluetooth = new BluetoothService(context);
Nick Pellyf242b7b2009-10-08 00:12:45 +0200208 ServiceManager.addService(BluetoothAdapter.BLUETOOTH_SERVICE, bluetooth);
Nick Pellybd022f42009-08-14 18:33:38 -0700209 bluetooth.initAfterRegistration();
Jaikumar Ganeshd5ac1ae2009-05-05 22:26:12 -0700210 bluetoothA2dp = new BluetoothA2dpService(context, bluetooth);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800211 ServiceManager.addService(BluetoothA2dpService.BLUETOOTH_A2DP_SERVICE,
212 bluetoothA2dp);
Jaikumar Ganesh7d0548d2010-10-18 15:29:09 -0700213 bluetooth.initAfterA2dpRegistration();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800214
Jake Hambyaa6bd942011-06-27 16:32:37 -0700215 int airplaneModeOn = Settings.System.getInt(mContentResolver,
216 Settings.System.AIRPLANE_MODE_ON, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800217 int bluetoothOn = Settings.Secure.getInt(mContentResolver,
218 Settings.Secure.BLUETOOTH_ON, 0);
Jake Hambyaa6bd942011-06-27 16:32:37 -0700219 if (airplaneModeOn == 0 && bluetoothOn != 0) {
The Android Open Source Project10592532009-03-18 17:39:46 -0700220 bluetooth.enable();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800221 }
222 }
223
224 } catch (RuntimeException e) {
Joe Onorato8a9b2202010-02-26 18:56:32 -0800225 Slog.e("System", "Failure starting core service", e);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800226 }
227
Dianne Hackbornd6847842010-01-12 18:14:19 -0800228 DevicePolicyManagerService devicePolicy = null;
Joe Onorato089de882010-04-12 08:18:45 -0700229 StatusBarManagerService statusBar = null;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800230 InputMethodManagerService imm = null;
The Android Open Source Projectc39a6e02009-03-11 12:11:56 -0700231 AppWidgetService appWidget = null;
Joe Onorato30275482009-07-08 17:09:14 -0700232 NotificationManagerService notification = null;
Dianne Hackbornf21adf62009-08-13 10:20:21 -0700233 WallpaperManagerService wallpaper = null;
Mike Lockwood46db5042010-02-22 16:36:44 -0500234 LocationManagerService location = null;
Bai Taoa58a8752010-07-13 15:32:16 +0800235 CountryDetectorService countryDetector = null;
satok988323c2011-06-22 16:38:13 +0900236 TextServicesManagerService tsms = null;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800237
238 if (factoryTest != SystemServer.FACTORY_TEST_LOW_LEVEL) {
239 try {
Joe Onorato8a9b2202010-02-26 18:56:32 -0800240 Slog.i(TAG, "Device Policy");
Dianne Hackbornd6847842010-01-12 18:14:19 -0800241 devicePolicy = new DevicePolicyManagerService(context);
242 ServiceManager.addService(Context.DEVICE_POLICY_SERVICE, devicePolicy);
243 } catch (Throwable e) {
Joe Onorato8a9b2202010-02-26 18:56:32 -0800244 Slog.e(TAG, "Failure starting DevicePolicyService", e);
Dianne Hackbornd6847842010-01-12 18:14:19 -0800245 }
246
247 try {
Joe Onorato8a9b2202010-02-26 18:56:32 -0800248 Slog.i(TAG, "Status Bar");
Jeff Brown2992ea72011-01-28 22:04:14 -0800249 statusBar = new StatusBarManagerService(context, wm);
Dianne Hackbornd6847842010-01-12 18:14:19 -0800250 ServiceManager.addService(Context.STATUS_BAR_SERVICE, statusBar);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800251 } catch (Throwable e) {
Joe Onorato089de882010-04-12 08:18:45 -0700252 Slog.e(TAG, "Failure starting StatusBarManagerService", e);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800253 }
254
255 try {
Joe Onorato8a9b2202010-02-26 18:56:32 -0800256 Slog.i(TAG, "Clipboard Service");
Dianne Hackbornd6847842010-01-12 18:14:19 -0800257 ServiceManager.addService(Context.CLIPBOARD_SERVICE,
258 new ClipboardService(context));
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800259 } catch (Throwable e) {
Joe Onorato8a9b2202010-02-26 18:56:32 -0800260 Slog.e(TAG, "Failure starting Clipboard Service", e);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800261 }
262
263 try {
Joe Onorato8a9b2202010-02-26 18:56:32 -0800264 Slog.i(TAG, "Input Method Service");
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800265 imm = new InputMethodManagerService(context, statusBar);
266 ServiceManager.addService(Context.INPUT_METHOD_SERVICE, imm);
267 } catch (Throwable e) {
Joe Onorato8a9b2202010-02-26 18:56:32 -0800268 Slog.e(TAG, "Failure starting Input Manager Service", e);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800269 }
270
271 try {
Joe Onorato8a9b2202010-02-26 18:56:32 -0800272 Slog.i(TAG, "NetworkManagement Service");
Jeff Sharkeyc006f1a2011-05-19 17:12:49 -0700273 networkManagement = NetworkManagementService.create(context);
274 ServiceManager.addService(Context.NETWORKMANAGEMENT_SERVICE, networkManagement);
San Mehatd1df8ac2010-01-26 06:17:26 -0800275 } catch (Throwable e) {
Joe Onorato8a9b2202010-02-26 18:56:32 -0800276 Slog.e(TAG, "Failure starting NetworkManagement Service", e);
San Mehatd1df8ac2010-01-26 06:17:26 -0800277 }
278
279 try {
satok988323c2011-06-22 16:38:13 +0900280 Slog.i(TAG, "Text Service Manager Service");
281 tsms = new TextServicesManagerService(context);
282 ServiceManager.addService(Context.TEXT_SERVICES_MANAGER_SERVICE, tsms);
283 } catch (Throwable e) {
284 Slog.e(TAG, "Failure starting Text Service Manager Service", e);
285 }
286
287 try {
Jeff Sharkey75279902011-05-24 18:39:45 -0700288 Slog.i(TAG, "NetworkStats Service");
289 networkStats = new NetworkStatsService(context, networkManagement, alarm);
290 ServiceManager.addService(Context.NETWORK_STATS_SERVICE, networkStats);
291 } catch (Throwable e) {
292 Slog.e(TAG, "Failure starting NetworkStats Service", e);
293 }
294
295 try {
296 Slog.i(TAG, "NetworkPolicy Service");
297 networkPolicy = new NetworkPolicyManagerService(
Ashish Sharma50fd36d2011-06-15 19:34:53 -0700298 context, ActivityManagerService.self(), power,
299 networkStats, networkManagement);
Jeff Sharkey75279902011-05-24 18:39:45 -0700300 ServiceManager.addService(Context.NETWORK_POLICY_SERVICE, networkPolicy);
301 } catch (Throwable e) {
302 Slog.e(TAG, "Failure starting NetworkPolicy Service", e);
303 }
304
repo sync55bc5f32011-06-24 14:23:07 -0700305 try {
306 Slog.i(TAG, "Wi-Fi P2pService");
307 wifiP2p = new WifiP2pService(context);
308 ServiceManager.addService(Context.WIFI_P2P_SERVICE, wifiP2p);
309 } catch (Throwable e) {
310 Slog.e(TAG, "Failure starting Wi-Fi P2pService", e);
311 }
312
repo syncaea743a2011-07-29 23:55:49 -0700313 try {
314 Slog.i(TAG, "Wi-Fi Service");
315 wifi = new WifiService(context);
316 ServiceManager.addService(Context.WIFI_SERVICE, wifi);
317 wifi.checkAndStartWifi();
318 } catch (Throwable e) {
319 Slog.e(TAG, "Failure starting Wi-Fi Service", e);
320 }
321
Jeff Sharkey75279902011-05-24 18:39:45 -0700322 try {
Joe Onorato8a9b2202010-02-26 18:56:32 -0800323 Slog.i(TAG, "Connectivity Service");
Jeff Sharkeyc006f1a2011-05-19 17:12:49 -0700324 connectivity = new ConnectivityService(context, networkManagement, networkPolicy);
Mike Lockwood0f79b542009-08-14 14:18:49 -0400325 ServiceManager.addService(Context.CONNECTIVITY_SERVICE, connectivity);
Jeff Sharkeyd2a45872011-05-28 20:56:34 -0700326 networkStats.bindConnectivityManager(connectivity);
Jeff Sharkey21c9c452011-06-07 12:26:43 -0700327 networkPolicy.bindConnectivityManager(connectivity);
Irfan Sheriffcb30b222011-07-29 20:54:52 -0700328 wifiP2p.connectivityServiceReady();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800329 } catch (Throwable e) {
Joe Onorato8a9b2202010-02-26 18:56:32 -0800330 Slog.e(TAG, "Failure starting Connectivity Service", e);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800331 }
332
333 try {
Robert Greenwalt9e696c22010-04-01 14:45:18 -0700334 Slog.i(TAG, "Throttle Service");
335 throttle = new ThrottleService(context);
336 ServiceManager.addService(
337 Context.THROTTLE_SERVICE, throttle);
338 } catch (Throwable e) {
339 Slog.e(TAG, "Failure starting ThrottleService", e);
340 }
341
342 try {
Joe Onorato8a9b2202010-02-26 18:56:32 -0800343 Slog.i(TAG, "Accessibility Manager");
svetoslavganov75986cf2009-05-14 22:28:01 -0700344 ServiceManager.addService(Context.ACCESSIBILITY_SERVICE,
345 new AccessibilityManagerService(context));
346 } catch (Throwable e) {
Joe Onorato8a9b2202010-02-26 18:56:32 -0800347 Slog.e(TAG, "Failure starting Accessibility Manager", e);
svetoslavganov75986cf2009-05-14 22:28:01 -0700348 }
349
350 try {
San Mehat1bf3f8b2010-02-03 14:43:09 -0800351 /*
352 * NotificationManagerService is dependant on MountService,
353 * (for media / usb notifications) so we must start MountService first.
354 */
Joe Onorato8a9b2202010-02-26 18:56:32 -0800355 Slog.i(TAG, "Mount Service");
San Mehat1bf3f8b2010-02-03 14:43:09 -0800356 ServiceManager.addService("mount", new MountService(context));
357 } catch (Throwable e) {
Joe Onorato8a9b2202010-02-26 18:56:32 -0800358 Slog.e(TAG, "Failure starting Mount Service", e);
San Mehat1bf3f8b2010-02-03 14:43:09 -0800359 }
360
361 try {
Joe Onorato8a9b2202010-02-26 18:56:32 -0800362 Slog.i(TAG, "Notification Manager");
Mike Lockwood3a322132009-11-24 00:30:52 -0500363 notification = new NotificationManagerService(context, statusBar, lights);
Joe Onorato30275482009-07-08 17:09:14 -0700364 ServiceManager.addService(Context.NOTIFICATION_SERVICE, notification);
Jeff Sharkey497e4432011-06-14 17:27:29 -0700365 networkPolicy.bindNotificationManager(notification);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800366 } catch (Throwable e) {
Joe Onorato8a9b2202010-02-26 18:56:32 -0800367 Slog.e(TAG, "Failure starting Notification Manager", e);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800368 }
369
370 try {
Joe Onorato8a9b2202010-02-26 18:56:32 -0800371 Slog.i(TAG, "Device Storage Monitor");
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800372 ServiceManager.addService(DeviceStorageMonitorService.SERVICE,
373 new DeviceStorageMonitorService(context));
374 } catch (Throwable e) {
Joe Onorato8a9b2202010-02-26 18:56:32 -0800375 Slog.e(TAG, "Failure starting DeviceStorageMonitor service", e);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800376 }
377
378 try {
Joe Onorato8a9b2202010-02-26 18:56:32 -0800379 Slog.i(TAG, "Location Manager");
Mike Lockwood46db5042010-02-22 16:36:44 -0500380 location = new LocationManagerService(context);
381 ServiceManager.addService(Context.LOCATION_SERVICE, location);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800382 } catch (Throwable e) {
Joe Onorato8a9b2202010-02-26 18:56:32 -0800383 Slog.e(TAG, "Failure starting Location Manager", e);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800384 }
385
386 try {
Bai Taoa58a8752010-07-13 15:32:16 +0800387 Slog.i(TAG, "Country Detector");
388 countryDetector = new CountryDetectorService(context);
389 ServiceManager.addService(Context.COUNTRY_DETECTOR, countryDetector);
390 } catch (Throwable e) {
391 Slog.e(TAG, "Failure starting Country Detector", e);
392 }
393
394 try {
Joe Onorato8a9b2202010-02-26 18:56:32 -0800395 Slog.i(TAG, "Search Service");
Dianne Hackbornd6847842010-01-12 18:14:19 -0800396 ServiceManager.addService(Context.SEARCH_SERVICE,
397 new SearchManagerService(context));
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800398 } catch (Throwable e) {
Joe Onorato8a9b2202010-02-26 18:56:32 -0800399 Slog.e(TAG, "Failure starting Search Service", e);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800400 }
401
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800402 try {
Joe Onorato8a9b2202010-02-26 18:56:32 -0800403 Slog.i(TAG, "DropBox Service");
Dan Egnor95240272009-10-27 18:23:39 -0700404 ServiceManager.addService(Context.DROPBOX_SERVICE,
Dan Egnorf18a01c2009-11-12 11:32:50 -0800405 new DropBoxManagerService(context, new File("/data/system/dropbox")));
Dan Egnor4410ec82009-09-11 16:40:01 -0700406 } catch (Throwable e) {
Joe Onorato8a9b2202010-02-26 18:56:32 -0800407 Slog.e(TAG, "Failure starting DropBoxManagerService", e);
Dan Egnor4410ec82009-09-11 16:40:01 -0700408 }
409
410 try {
Joe Onorato8a9b2202010-02-26 18:56:32 -0800411 Slog.i(TAG, "Wallpaper Service");
Dianne Hackbornf21adf62009-08-13 10:20:21 -0700412 wallpaper = new WallpaperManagerService(context);
413 ServiceManager.addService(Context.WALLPAPER_SERVICE, wallpaper);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800414 } catch (Throwable e) {
Joe Onorato8a9b2202010-02-26 18:56:32 -0800415 Slog.e(TAG, "Failure starting Wallpaper Service", e);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800416 }
417
418 try {
Joe Onorato8a9b2202010-02-26 18:56:32 -0800419 Slog.i(TAG, "Audio Service");
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800420 ServiceManager.addService(Context.AUDIO_SERVICE, new AudioService(context));
421 } catch (Throwable e) {
Joe Onorato8a9b2202010-02-26 18:56:32 -0800422 Slog.e(TAG, "Failure starting Audio Service", e);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800423 }
424
425 try {
Joe Onorato8a9b2202010-02-26 18:56:32 -0800426 Slog.i(TAG, "Dock Observer");
Dan Murphyc9f4eaf2009-08-12 15:15:43 -0500427 // Listen for dock station changes
Ken Schultzf02c0742009-09-10 18:37:37 -0500428 dock = new DockObserver(context, power);
Dan Murphyc9f4eaf2009-08-12 15:15:43 -0500429 } catch (Throwable e) {
Joe Onorato8a9b2202010-02-26 18:56:32 -0800430 Slog.e(TAG, "Failure starting DockObserver", e);
Dan Murphyc9f4eaf2009-08-12 15:15:43 -0500431 }
432
433 try {
Praveen Bharathi21e941b2010-10-06 15:23:14 -0500434 Slog.i(TAG, "Wired Accessory Observer");
435 // Listen for wired headset changes
436 wiredAccessory = new WiredAccessoryObserver(context);
437 } catch (Throwable e) {
438 Slog.e(TAG, "Failure starting WiredAccessoryObserver", e);
439 }
440
441 try {
Mike Lockwood02e45692011-06-14 15:43:51 -0400442 Slog.i(TAG, "USB Service");
443 // Manage USB host and device support
Mike Lockwood770126a2010-12-09 22:30:37 -0800444 usb = new UsbService(context);
Mike Lockwoode7d511e2010-12-30 13:39:37 -0500445 ServiceManager.addService(Context.USB_SERVICE, usb);
Mike Lockwood57c798a2010-06-23 17:36:36 -0400446 } catch (Throwable e) {
Mike Lockwood770126a2010-12-09 22:30:37 -0800447 Slog.e(TAG, "Failure starting UsbService", e);
Mike Lockwood57c798a2010-06-23 17:36:36 -0400448 }
449
450 try {
Dianne Hackborn7299c412010-03-04 18:41:49 -0800451 Slog.i(TAG, "UI Mode Manager Service");
Mike Lockwood57c798a2010-06-23 17:36:36 -0400452 // Listen for UI mode changes
Dianne Hackborn7299c412010-03-04 18:41:49 -0800453 uiMode = new UiModeManagerService(context);
454 } catch (Throwable e) {
455 Slog.e(TAG, "Failure starting UiModeManagerService", e);
456 }
457
458 try {
Joe Onorato8a9b2202010-02-26 18:56:32 -0800459 Slog.i(TAG, "Backup Service");
Dianne Hackbornd6847842010-01-12 18:14:19 -0800460 ServiceManager.addService(Context.BACKUP_SERVICE,
461 new BackupManagerService(context));
Christopher Tate487529a2009-04-29 14:03:25 -0700462 } catch (Throwable e) {
Joe Onorato8a9b2202010-02-26 18:56:32 -0800463 Slog.e(TAG, "Failure starting Backup Service", e);
Christopher Tate487529a2009-04-29 14:03:25 -0700464 }
465
466 try {
Joe Onorato8a9b2202010-02-26 18:56:32 -0800467 Slog.i(TAG, "AppWidget Service");
The Android Open Source Projectc39a6e02009-03-11 12:11:56 -0700468 appWidget = new AppWidgetService(context);
469 ServiceManager.addService(Context.APPWIDGET_SERVICE, appWidget);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800470 } catch (Throwable e) {
Joe Onorato8a9b2202010-02-26 18:56:32 -0800471 Slog.e(TAG, "Failure starting AppWidget Service", e);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800472 }
473
474 try {
Joe Onorato8a9b2202010-02-26 18:56:32 -0800475 Slog.i(TAG, "Recognition Service");
Dianne Hackborn21f1bd12010-02-19 17:02:21 -0800476 recognition = new RecognitionManagerService(context);
477 } catch (Throwable e) {
Joe Onorato8a9b2202010-02-26 18:56:32 -0800478 Slog.e(TAG, "Failure starting Recognition Service", e);
Dianne Hackborn21f1bd12010-02-19 17:02:21 -0800479 }
Jaikumar Ganesh7d0548d2010-10-18 15:29:09 -0700480
Nick Pelly038cabe2010-09-23 16:12:11 -0700481 try {
Dan Egnor621bc542010-03-25 16:20:14 -0700482 Slog.i(TAG, "DiskStats Service");
483 ServiceManager.addService("diskstats", new DiskStatsService(context));
484 } catch (Throwable e) {
485 Slog.e(TAG, "Failure starting DiskStats Service", e);
486 }
Sen Hubde75702010-05-28 01:54:03 -0700487
488 try {
489 // need to add this service even if SamplingProfilerIntegration.isEnabled()
490 // is false, because it is this service that detects system property change and
491 // turns on SamplingProfilerIntegration. Plus, when sampling profiler doesn't work,
492 // there is little overhead for running this service.
493 Slog.i(TAG, "SamplingProfiler Service");
494 ServiceManager.addService("samplingprofiler",
495 new SamplingProfilerService(context));
496 } catch (Throwable e) {
497 Slog.e(TAG, "Failure starting SamplingProfiler Service", e);
498 }
Chung-yih Wang024d5962010-08-06 12:06:04 +0800499
500 try {
Amith Yamasani6734b9f62010-09-13 16:24:08 -0700501 Slog.i(TAG, "NetworkTimeUpdateService");
502 networkTimeUpdater = new NetworkTimeUpdateService(context);
503 } catch (Throwable e) {
504 Slog.e(TAG, "Failure starting NetworkTimeUpdate service");
505 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800506 }
507
Dianne Hackborn6af0d502009-09-28 13:25:46 -0700508 // Before things start rolling, be sure we have decided whether
509 // we are in safe mode.
Dianne Hackborna34f1ad2009-09-02 13:26:28 -0700510 final boolean safeMode = wm.detectSafeMode();
Dianne Hackborn6af0d502009-09-28 13:25:46 -0700511 if (safeMode) {
Jeff Brownb09abc12011-01-13 21:08:27 -0800512 ActivityManagerService.self().enterSafeMode();
513 // Post the safe mode state in the Zygote class
514 Zygote.systemInSafeMode = true;
515 // Disable the JIT for the system_server process
516 VMRuntime.getRuntime().disableJitCompilation();
Ben Cheng6c0afff2010-02-14 16:18:56 -0800517 } else {
518 // Enable the JIT for the system_server process
519 VMRuntime.getRuntime().startJitCompilation();
Dianne Hackborn6af0d502009-09-28 13:25:46 -0700520 }
Doug Zongkerab5c49c2009-12-04 10:31:43 -0800521
Dianne Hackborn6af0d502009-09-28 13:25:46 -0700522 // It is now time to start up the app processes...
Joe Onorato30275482009-07-08 17:09:14 -0700523
Dianne Hackbornd6847842010-01-12 18:14:19 -0800524 if (devicePolicy != null) {
525 devicePolicy.systemReady();
526 }
527
Joe Onorato30275482009-07-08 17:09:14 -0700528 if (notification != null) {
529 notification.systemReady();
530 }
531
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800532 wm.systemReady();
Joe Onoratodc565f42010-10-04 15:27:22 -0400533
Jeff Brownb09abc12011-01-13 21:08:27 -0800534 if (safeMode) {
535 ActivityManagerService.self().showSafeModeOverlay();
536 }
537
Joe Onoratodc565f42010-10-04 15:27:22 -0400538 // Update the configuration for this context by hand, because we're going
539 // to start using it before the config change done in wm.systemReady() will
540 // propagate to it.
541 Configuration config = wm.computeNewConfiguration();
542 DisplayMetrics metrics = new DisplayMetrics();
543 WindowManager w = (WindowManager)context.getSystemService(Context.WINDOW_SERVICE);
544 w.getDefaultDisplay().getMetrics(metrics);
545 context.getResources().updateConfiguration(config, metrics);
546
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800547 power.systemReady();
548 try {
549 pm.systemReady();
550 } catch (RemoteException e) {
551 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800552
Dianne Hackborna34f1ad2009-09-02 13:26:28 -0700553 // These are needed to propagate to the runnable below.
Joe Onoratof3c3c4f2010-10-21 11:09:02 -0400554 final Context contextF = context;
Dianne Hackborna34f1ad2009-09-02 13:26:28 -0700555 final BatteryService batteryF = battery;
Jeff Sharkey350083e2011-06-29 10:45:16 -0700556 final NetworkManagementService networkManagementF = networkManagement;
Jeff Sharkey75279902011-05-24 18:39:45 -0700557 final NetworkStatsService networkStatsF = networkStats;
Jeff Sharkeya4620792011-05-20 15:29:23 -0700558 final NetworkPolicyManagerService networkPolicyF = networkPolicy;
Dianne Hackborna34f1ad2009-09-02 13:26:28 -0700559 final ConnectivityService connectivityF = connectivity;
560 final DockObserver dockF = dock;
Mike Lockwood770126a2010-12-09 22:30:37 -0800561 final UsbService usbF = usb;
Robert Greenwalt9e696c22010-04-01 14:45:18 -0700562 final ThrottleService throttleF = throttle;
Dianne Hackborn7299c412010-03-04 18:41:49 -0800563 final UiModeManagerService uiModeF = uiMode;
Dianne Hackborna34f1ad2009-09-02 13:26:28 -0700564 final AppWidgetService appWidgetF = appWidget;
565 final WallpaperManagerService wallpaperF = wallpaper;
566 final InputMethodManagerService immF = imm;
Dianne Hackborn21f1bd12010-02-19 17:02:21 -0800567 final RecognitionManagerService recognitionF = recognition;
Mike Lockwood46db5042010-02-22 16:36:44 -0500568 final LocationManagerService locationF = location;
Bai Taoa58a8752010-07-13 15:32:16 +0800569 final CountryDetectorService countryDetectorF = countryDetector;
Amith Yamasani6734b9f62010-09-13 16:24:08 -0700570 final NetworkTimeUpdateService networkTimeUpdaterF = networkTimeUpdater;
satok988323c2011-06-22 16:38:13 +0900571 final TextServicesManagerService textServiceManagerServiceF = tsms;
Doug Zongkerab5c49c2009-12-04 10:31:43 -0800572
Dianne Hackborna34f1ad2009-09-02 13:26:28 -0700573 // We now tell the activity manager it is okay to run third party
574 // code. It will call back into us once it has gotten to the state
575 // where third party code can really run (but before it has actually
576 // started launching the initial applications), for us to complete our
577 // initialization.
578 ((ActivityManagerService)ActivityManagerNative.getDefault())
579 .systemReady(new Runnable() {
580 public void run() {
Joe Onorato8a9b2202010-02-26 18:56:32 -0800581 Slog.i(TAG, "Making services ready");
Doug Zongkerab5c49c2009-12-04 10:31:43 -0800582
Joe Onoratof3c3c4f2010-10-21 11:09:02 -0400583 startSystemUi(contextF);
Dianne Hackborna34f1ad2009-09-02 13:26:28 -0700584 if (batteryF != null) batteryF.systemReady();
Jeff Sharkey350083e2011-06-29 10:45:16 -0700585 if (networkManagementF != null) networkManagementF.systemReady();
Jeff Sharkey75279902011-05-24 18:39:45 -0700586 if (networkStatsF != null) networkStatsF.systemReady();
Jeff Sharkeya4620792011-05-20 15:29:23 -0700587 if (networkPolicyF != null) networkPolicyF.systemReady();
Dianne Hackborna34f1ad2009-09-02 13:26:28 -0700588 if (connectivityF != null) connectivityF.systemReady();
589 if (dockF != null) dockF.systemReady();
Mike Lockwood57c798a2010-06-23 17:36:36 -0400590 if (usbF != null) usbF.systemReady();
Dianne Hackborn7299c412010-03-04 18:41:49 -0800591 if (uiModeF != null) uiModeF.systemReady();
Dianne Hackborn21f1bd12010-02-19 17:02:21 -0800592 if (recognitionF != null) recognitionF.systemReady();
Dianne Hackborna34f1ad2009-09-02 13:26:28 -0700593 Watchdog.getInstance().start();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800594
Dianne Hackborna34f1ad2009-09-02 13:26:28 -0700595 // It is now okay to let the various system services start their
596 // third party code...
Doug Zongkerab5c49c2009-12-04 10:31:43 -0800597
Dianne Hackborna34f1ad2009-09-02 13:26:28 -0700598 if (appWidgetF != null) appWidgetF.systemReady(safeMode);
599 if (wallpaperF != null) wallpaperF.systemReady();
600 if (immF != null) immF.systemReady();
Mike Lockwood46db5042010-02-22 16:36:44 -0500601 if (locationF != null) locationF.systemReady();
Bai Taoa58a8752010-07-13 15:32:16 +0800602 if (countryDetectorF != null) countryDetectorF.systemReady();
Robert Greenwalt9e696c22010-04-01 14:45:18 -0700603 if (throttleF != null) throttleF.systemReady();
Amith Yamasani6734b9f62010-09-13 16:24:08 -0700604 if (networkTimeUpdaterF != null) networkTimeUpdaterF.systemReady();
satok988323c2011-06-22 16:38:13 +0900605 if (textServiceManagerServiceF != null) textServiceManagerServiceF.systemReady();
Dianne Hackborna34f1ad2009-09-02 13:26:28 -0700606 }
607 });
Doug Zongkerab5c49c2009-12-04 10:31:43 -0800608
Brad Fitzpatrick1e02d362010-09-10 09:19:50 -0700609 // For debug builds, log event loop stalls to dropbox for analysis.
Brad Fitzpatrick50d66f92010-09-13 21:29:05 -0700610 if (StrictMode.conditionallyEnableDebugLogging()) {
611 Slog.i(TAG, "Enabled StrictMode for system server main thread.");
Brad Fitzpatrick1e02d362010-09-10 09:19:50 -0700612 }
613
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800614 Looper.loop();
Joe Onorato8a9b2202010-02-26 18:56:32 -0800615 Slog.d(TAG, "System ServerThread is exiting!");
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800616 }
Joe Onoratof3c3c4f2010-10-21 11:09:02 -0400617
618 static final void startSystemUi(Context context) {
619 Intent intent = new Intent();
620 intent.setComponent(new ComponentName("com.android.systemui",
621 "com.android.systemui.SystemUIService"));
622 Slog.d(TAG, "Starting service: " + intent);
623 context.startService(intent);
624 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800625}
626
Jeff Hamilton35eef702010-06-09 15:45:18 -0500627public class SystemServer {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800628 private static final String TAG = "SystemServer";
629
630 public static final int FACTORY_TEST_OFF = 0;
631 public static final int FACTORY_TEST_LOW_LEVEL = 1;
632 public static final int FACTORY_TEST_HIGH_LEVEL = 2;
Jaikumar Ganeshd5ac1ae2009-05-05 22:26:12 -0700633
Bob Leee5408332009-09-04 18:31:17 -0700634 static Timer timer;
635 static final long SNAPSHOT_INTERVAL = 60 * 60 * 1000; // 1hr
636
Brad Fitzpatrick6bb7a4a2010-10-11 13:41:10 -0700637 // The earliest supported time. We pick one day into 1970, to
638 // give any timezone code room without going into negative time.
639 private static final long EARLIEST_SUPPORTED_TIME = 86400 * 1000;
640
Jaikumar Ganeshd5ac1ae2009-05-05 22:26:12 -0700641 /**
642 * This method is called from Zygote to initialize the system. This will cause the native
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800643 * services (SurfaceFlinger, AudioFlinger, etc..) to be started. After that it will call back
644 * up into init2() to start the Android services.
Jaikumar Ganeshd5ac1ae2009-05-05 22:26:12 -0700645 */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800646 native public static void init1(String[] args);
647
648 public static void main(String[] args) {
Brad Fitzpatrick6bb7a4a2010-10-11 13:41:10 -0700649 if (System.currentTimeMillis() < EARLIEST_SUPPORTED_TIME) {
Brad Fitzpatrick35ca9d82010-10-11 11:52:49 -0700650 // If a device's clock is before 1970 (before 0), a lot of
651 // APIs crash dealing with negative numbers, notably
652 // java.io.File#setLastModified, so instead we fake it and
653 // hope that time from cell towers or NTP fixes it
654 // shortly.
655 Slog.w(TAG, "System clock is before 1970; setting to 1970.");
Brad Fitzpatrick6bb7a4a2010-10-11 13:41:10 -0700656 SystemClock.setCurrentTimeMillis(EARLIEST_SUPPORTED_TIME);
Brad Fitzpatrick35ca9d82010-10-11 11:52:49 -0700657 }
658
Bob Leee5408332009-09-04 18:31:17 -0700659 if (SamplingProfilerIntegration.isEnabled()) {
660 SamplingProfilerIntegration.start();
661 timer = new Timer();
662 timer.schedule(new TimerTask() {
663 @Override
664 public void run() {
Sen Hubde75702010-05-28 01:54:03 -0700665 SamplingProfilerIntegration.writeSnapshot("system_server", null);
Bob Leee5408332009-09-04 18:31:17 -0700666 }
667 }, SNAPSHOT_INTERVAL, SNAPSHOT_INTERVAL);
668 }
669
Dianne Hackbornac1471a2011-02-03 13:46:06 -0800670 // Mmmmmm... more memory!
671 dalvik.system.VMRuntime.getRuntime().clearGrowthLimit();
672
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800673 // The system server has to run all of the time, so it needs to be
674 // as efficient as possible with its memory usage.
675 VMRuntime.getRuntime().setTargetHeapUtilization(0.8f);
Sen Hubde75702010-05-28 01:54:03 -0700676
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800677 System.loadLibrary("android_servers");
678 init1(args);
679 }
680
681 public static final void init2() {
Joe Onorato8a9b2202010-02-26 18:56:32 -0800682 Slog.i(TAG, "Entered the Android system server!");
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800683 Thread thr = new ServerThread();
684 thr.setName("android.server.ServerThread");
685 thr.start();
686 }
687}