Loading services/core/java/com/android/server/location/timezone/BinderLocationTimeZoneProvider.java +0 −5 Original line number Diff line number Diff line Loading @@ -161,11 +161,6 @@ class BinderLocationTimeZoneProvider extends LocationTimeZoneProvider { mProxy.setRequest(request); } @Override void logWarn(String msg) { Slog.w(TAG, msg); } @Override public void dump(@NonNull IndentingPrintWriter ipw, @Nullable String[] args) { synchronized (mSharedLock) { Loading services/core/java/com/android/server/location/timezone/LocationTimeZoneManagerService.java +5 −1 Original line number Diff line number Diff line Loading @@ -285,8 +285,12 @@ public class LocationTimeZoneManagerService extends Binder { } static void warnLog(String msg) { warnLog(msg, null); } static void warnLog(String msg, @Nullable Throwable t) { if (Log.isLoggable(TAG, Log.WARN)) { Slog.w(TAG, msg); Slog.w(TAG, msg, t); } } } services/core/java/com/android/server/location/timezone/LocationTimeZoneProvider.java +18 −13 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.server.location.timezone; import static com.android.server.location.timezone.LocationTimeZoneManagerService.debugLog; import static com.android.server.location.timezone.LocationTimeZoneManagerService.warnLog; import static com.android.server.location.timezone.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_PERM_FAILED; import static com.android.server.location.timezone.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_STARTED_CERTAIN; import static com.android.server.location.timezone.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_STARTED_INITIALIZING; Loading Loading @@ -345,12 +346,21 @@ abstract class LocationTimeZoneProvider implements Dumpable { } mProviderListener = Objects.requireNonNull(providerListener); ProviderState currentState = ProviderState.createStartingState(this); ProviderState newState = currentState.newState( currentState = currentState.newState( PROVIDER_STATE_STOPPED, null, null, "initialize() called"); setCurrentState(newState, false); setCurrentState(currentState, false); // Guard against uncaught exceptions due to initialization problems. try { onInitialize(); } catch (RuntimeException e) { warnLog("Unable to initialize the provider", e); currentState = currentState .newState(PROVIDER_STATE_PERM_FAILED, null, null, "Provider failed to initialize"); setCurrentState(currentState, true); } } } Loading Loading @@ -498,7 +508,7 @@ abstract class LocationTimeZoneProvider implements Dumpable { case PROVIDER_STATE_PERM_FAILED: { // After entering perm failed, there is nothing to do. The remote peer is // supposed to stop sending events after it has reported perm failure. logWarn("handleTimeZoneProviderEvent: Event=" + timeZoneProviderEvent warnLog("handleTimeZoneProviderEvent: Event=" + timeZoneProviderEvent + " received for provider=" + this + " when in failed state"); return; } Loading @@ -509,7 +519,7 @@ abstract class LocationTimeZoneProvider implements Dumpable { + " Failure event=" + timeZoneProviderEvent + " received for stopped provider=" + this + ", entering permanently failed state"; logWarn(msg); warnLog(msg); ProviderState newState = currentState.newState( PROVIDER_STATE_PERM_FAILED, null, null, msg); setCurrentState(newState, true); Loading @@ -522,7 +532,7 @@ abstract class LocationTimeZoneProvider implements Dumpable { case EVENT_TYPE_UNCERTAIN: { // Any geolocation-related events received for a stopped provider are // ignored: they should not happen. logWarn("handleTimeZoneProviderEvent:" warnLog("handleTimeZoneProviderEvent:" + " event=" + timeZoneProviderEvent + " received for stopped provider=" + this + ", ignoring"); Loading @@ -544,7 +554,7 @@ abstract class LocationTimeZoneProvider implements Dumpable { + " Failure event=" + timeZoneProviderEvent + " received for provider=" + this + ", entering permanently failed state"; logWarn(msg); warnLog(msg); ProviderState newState = currentState.newState( PROVIDER_STATE_PERM_FAILED, null, null, msg); setCurrentState(newState, true); Loading Loading @@ -584,11 +594,6 @@ abstract class LocationTimeZoneProvider implements Dumpable { } } /** * Implemented by subclasses. */ abstract void logWarn(String msg); @GuardedBy("mSharedLock") private void assertIsStarted() { ProviderState currentState = mCurrentState.get(); Loading services/core/java/com/android/server/location/timezone/LocationTimeZoneProviderProxy.java +1 −1 Original line number Diff line number Diff line Loading @@ -79,9 +79,9 @@ abstract class LocationTimeZoneProviderProxy implements Dumpable { throw new IllegalStateException("listener already set"); } this.mListener = listener; } onInitialize(); } } /** * Initializes the proxy. This is called after {@link #mListener} is set. Loading services/core/java/com/android/server/location/timezone/NullLocationTimeZoneProvider.java +0 −6 Original line number Diff line number Diff line Loading @@ -21,7 +21,6 @@ import static com.android.server.location.timezone.LocationTimeZoneProvider.Prov import android.annotation.NonNull; import android.annotation.Nullable; import android.util.IndentingPrintWriter; import android.util.Slog; import java.time.Duration; Loading Loading @@ -73,11 +72,6 @@ class NullLocationTimeZoneProvider extends LocationTimeZoneProvider { // Ignored - this implementation is always permanently failed. } @Override void logWarn(String msg) { Slog.w(TAG, msg); } @Override public void dump(@NonNull IndentingPrintWriter ipw, @Nullable String[] args) { synchronized (mSharedLock) { Loading Loading
services/core/java/com/android/server/location/timezone/BinderLocationTimeZoneProvider.java +0 −5 Original line number Diff line number Diff line Loading @@ -161,11 +161,6 @@ class BinderLocationTimeZoneProvider extends LocationTimeZoneProvider { mProxy.setRequest(request); } @Override void logWarn(String msg) { Slog.w(TAG, msg); } @Override public void dump(@NonNull IndentingPrintWriter ipw, @Nullable String[] args) { synchronized (mSharedLock) { Loading
services/core/java/com/android/server/location/timezone/LocationTimeZoneManagerService.java +5 −1 Original line number Diff line number Diff line Loading @@ -285,8 +285,12 @@ public class LocationTimeZoneManagerService extends Binder { } static void warnLog(String msg) { warnLog(msg, null); } static void warnLog(String msg, @Nullable Throwable t) { if (Log.isLoggable(TAG, Log.WARN)) { Slog.w(TAG, msg); Slog.w(TAG, msg, t); } } }
services/core/java/com/android/server/location/timezone/LocationTimeZoneProvider.java +18 −13 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.server.location.timezone; import static com.android.server.location.timezone.LocationTimeZoneManagerService.debugLog; import static com.android.server.location.timezone.LocationTimeZoneManagerService.warnLog; import static com.android.server.location.timezone.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_PERM_FAILED; import static com.android.server.location.timezone.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_STARTED_CERTAIN; import static com.android.server.location.timezone.LocationTimeZoneProvider.ProviderState.PROVIDER_STATE_STARTED_INITIALIZING; Loading Loading @@ -345,12 +346,21 @@ abstract class LocationTimeZoneProvider implements Dumpable { } mProviderListener = Objects.requireNonNull(providerListener); ProviderState currentState = ProviderState.createStartingState(this); ProviderState newState = currentState.newState( currentState = currentState.newState( PROVIDER_STATE_STOPPED, null, null, "initialize() called"); setCurrentState(newState, false); setCurrentState(currentState, false); // Guard against uncaught exceptions due to initialization problems. try { onInitialize(); } catch (RuntimeException e) { warnLog("Unable to initialize the provider", e); currentState = currentState .newState(PROVIDER_STATE_PERM_FAILED, null, null, "Provider failed to initialize"); setCurrentState(currentState, true); } } } Loading Loading @@ -498,7 +508,7 @@ abstract class LocationTimeZoneProvider implements Dumpable { case PROVIDER_STATE_PERM_FAILED: { // After entering perm failed, there is nothing to do. The remote peer is // supposed to stop sending events after it has reported perm failure. logWarn("handleTimeZoneProviderEvent: Event=" + timeZoneProviderEvent warnLog("handleTimeZoneProviderEvent: Event=" + timeZoneProviderEvent + " received for provider=" + this + " when in failed state"); return; } Loading @@ -509,7 +519,7 @@ abstract class LocationTimeZoneProvider implements Dumpable { + " Failure event=" + timeZoneProviderEvent + " received for stopped provider=" + this + ", entering permanently failed state"; logWarn(msg); warnLog(msg); ProviderState newState = currentState.newState( PROVIDER_STATE_PERM_FAILED, null, null, msg); setCurrentState(newState, true); Loading @@ -522,7 +532,7 @@ abstract class LocationTimeZoneProvider implements Dumpable { case EVENT_TYPE_UNCERTAIN: { // Any geolocation-related events received for a stopped provider are // ignored: they should not happen. logWarn("handleTimeZoneProviderEvent:" warnLog("handleTimeZoneProviderEvent:" + " event=" + timeZoneProviderEvent + " received for stopped provider=" + this + ", ignoring"); Loading @@ -544,7 +554,7 @@ abstract class LocationTimeZoneProvider implements Dumpable { + " Failure event=" + timeZoneProviderEvent + " received for provider=" + this + ", entering permanently failed state"; logWarn(msg); warnLog(msg); ProviderState newState = currentState.newState( PROVIDER_STATE_PERM_FAILED, null, null, msg); setCurrentState(newState, true); Loading Loading @@ -584,11 +594,6 @@ abstract class LocationTimeZoneProvider implements Dumpable { } } /** * Implemented by subclasses. */ abstract void logWarn(String msg); @GuardedBy("mSharedLock") private void assertIsStarted() { ProviderState currentState = mCurrentState.get(); Loading
services/core/java/com/android/server/location/timezone/LocationTimeZoneProviderProxy.java +1 −1 Original line number Diff line number Diff line Loading @@ -79,9 +79,9 @@ abstract class LocationTimeZoneProviderProxy implements Dumpable { throw new IllegalStateException("listener already set"); } this.mListener = listener; } onInitialize(); } } /** * Initializes the proxy. This is called after {@link #mListener} is set. Loading
services/core/java/com/android/server/location/timezone/NullLocationTimeZoneProvider.java +0 −6 Original line number Diff line number Diff line Loading @@ -21,7 +21,6 @@ import static com.android.server.location.timezone.LocationTimeZoneProvider.Prov import android.annotation.NonNull; import android.annotation.Nullable; import android.util.IndentingPrintWriter; import android.util.Slog; import java.time.Duration; Loading Loading @@ -73,11 +72,6 @@ class NullLocationTimeZoneProvider extends LocationTimeZoneProvider { // Ignored - this implementation is always permanently failed. } @Override void logWarn(String msg) { Slog.w(TAG, msg); } @Override public void dump(@NonNull IndentingPrintWriter ipw, @Nullable String[] args) { synchronized (mSharedLock) { Loading