Loading services/core/java/com/android/server/LocationManagerService.java +28 −3 Original line number Diff line number Diff line Loading @@ -128,6 +128,32 @@ import java.util.concurrent.TimeUnit; * updates and alerts. */ public class LocationManagerService extends ILocationManager.Stub { /** * Controls lifecycle of LocationManagerService. */ public static class Lifecycle extends SystemService { private LocationManagerService mService; public Lifecycle(Context context) { super(context); mService = new LocationManagerService(context); } @Override public void onStart() { publishBinderService(Context.LOCATION_SERVICE, mService); } @Override public void onBootPhase(int phase) { if (phase == SystemService.PHASE_THIRD_PARTY_APPS_CAN_START) { mService.systemRunning(); } } } private static final String TAG = "LocationManagerService"; public static final boolean D = Log.isLoggable(TAG, Log.DEBUG); Loading Loading @@ -234,8 +260,7 @@ public class LocationManagerService extends ILocationManager.Stub { @GuardedBy("mLock") private final LocationUsageLogger mLocationUsageLogger; public LocationManagerService(Context context) { super(); private LocationManagerService(Context context) { mContext = context; mHandler = FgThread.getHandler(); mLocationUsageLogger = new LocationUsageLogger(); Loading @@ -254,7 +279,7 @@ public class LocationManagerService extends ILocationManager.Stub { // most startup is deferred until systemRunning() } public void systemRunning() { private void systemRunning() { synchronized (mLock) { initializeLocked(); } Loading services/java/com/android/server/SystemServer.java +1 −18 Original line number Diff line number Diff line Loading @@ -1135,7 +1135,6 @@ public final class SystemServer { StatusBarManagerService statusBar = null; INotificationManager notification = null; LocationManagerService location = null; CountryDetectorService countryDetector = null; ILockSettings lockSettings = null; MediaRouterService mediaRouter = null; Loading Loading @@ -1432,12 +1431,7 @@ public final class SystemServer { t.traceEnd(); t.traceBegin("StartLocationManagerService"); try { location = new LocationManagerService(context); ServiceManager.addService(Context.LOCATION_SERVICE, location); } catch (Throwable e) { reportWtf("starting Location Manager", e); } mSystemServiceManager.startService(LocationManagerService.Lifecycle.class); t.traceEnd(); t.traceBegin("StartCountryDetectorService"); Loading Loading @@ -2021,7 +2015,6 @@ public final class SystemServer { final NetworkStatsService networkStatsF = networkStats; final NetworkPolicyManagerService networkPolicyF = networkPolicy; final ConnectivityService connectivityF = connectivity; final LocationManagerService locationF = location; final CountryDetectorService countryDetectorF = countryDetector; final NetworkTimeUpdateService networkTimeUpdaterF = networkTimeUpdater; final InputManagerService inputManagerF = inputManager; Loading Loading @@ -2177,16 +2170,6 @@ public final class SystemServer { } t.traceEnd(); t.traceBegin("MakeLocationServiceReady"); try { if (locationF != null) { locationF.systemRunning(); } } catch (Throwable e) { reportWtf("Notifying Location Service running", e); } t.traceEnd(); t.traceBegin("MakeCountryDetectionServiceReady"); try { if (countryDetectorF != null) { Loading Loading
services/core/java/com/android/server/LocationManagerService.java +28 −3 Original line number Diff line number Diff line Loading @@ -128,6 +128,32 @@ import java.util.concurrent.TimeUnit; * updates and alerts. */ public class LocationManagerService extends ILocationManager.Stub { /** * Controls lifecycle of LocationManagerService. */ public static class Lifecycle extends SystemService { private LocationManagerService mService; public Lifecycle(Context context) { super(context); mService = new LocationManagerService(context); } @Override public void onStart() { publishBinderService(Context.LOCATION_SERVICE, mService); } @Override public void onBootPhase(int phase) { if (phase == SystemService.PHASE_THIRD_PARTY_APPS_CAN_START) { mService.systemRunning(); } } } private static final String TAG = "LocationManagerService"; public static final boolean D = Log.isLoggable(TAG, Log.DEBUG); Loading Loading @@ -234,8 +260,7 @@ public class LocationManagerService extends ILocationManager.Stub { @GuardedBy("mLock") private final LocationUsageLogger mLocationUsageLogger; public LocationManagerService(Context context) { super(); private LocationManagerService(Context context) { mContext = context; mHandler = FgThread.getHandler(); mLocationUsageLogger = new LocationUsageLogger(); Loading @@ -254,7 +279,7 @@ public class LocationManagerService extends ILocationManager.Stub { // most startup is deferred until systemRunning() } public void systemRunning() { private void systemRunning() { synchronized (mLock) { initializeLocked(); } Loading
services/java/com/android/server/SystemServer.java +1 −18 Original line number Diff line number Diff line Loading @@ -1135,7 +1135,6 @@ public final class SystemServer { StatusBarManagerService statusBar = null; INotificationManager notification = null; LocationManagerService location = null; CountryDetectorService countryDetector = null; ILockSettings lockSettings = null; MediaRouterService mediaRouter = null; Loading Loading @@ -1432,12 +1431,7 @@ public final class SystemServer { t.traceEnd(); t.traceBegin("StartLocationManagerService"); try { location = new LocationManagerService(context); ServiceManager.addService(Context.LOCATION_SERVICE, location); } catch (Throwable e) { reportWtf("starting Location Manager", e); } mSystemServiceManager.startService(LocationManagerService.Lifecycle.class); t.traceEnd(); t.traceBegin("StartCountryDetectorService"); Loading Loading @@ -2021,7 +2015,6 @@ public final class SystemServer { final NetworkStatsService networkStatsF = networkStats; final NetworkPolicyManagerService networkPolicyF = networkPolicy; final ConnectivityService connectivityF = connectivity; final LocationManagerService locationF = location; final CountryDetectorService countryDetectorF = countryDetector; final NetworkTimeUpdateService networkTimeUpdaterF = networkTimeUpdater; final InputManagerService inputManagerF = inputManager; Loading Loading @@ -2177,16 +2170,6 @@ public final class SystemServer { } t.traceEnd(); t.traceBegin("MakeLocationServiceReady"); try { if (locationF != null) { locationF.systemRunning(); } } catch (Throwable e) { reportWtf("Notifying Location Service running", e); } t.traceEnd(); t.traceBegin("MakeCountryDetectionServiceReady"); try { if (countryDetectorF != null) { Loading