Merge "Fix some errorprone warnings"

This commit is contained in:
Neil Fuller
2020-09-30 09:25:41 +00:00
committed by Android (Google) Code Review
5 changed files with 8 additions and 5 deletions

View File

@@ -84,6 +84,7 @@ public final class TimeDetectorService extends ITimeDetectorService.Stub {
contentResolver.registerContentObserver(
Settings.Global.getUriFor(Settings.Global.AUTO_TIME), true,
new ContentObserver(handler) {
@Override
public void onChange(boolean selfChange) {
timeDetectorService.handleAutoTimeDetectionChanged();
}

View File

@@ -572,7 +572,7 @@ public final class TimeDetectorStrategyImpl implements TimeDetectorStrategy {
*/
@VisibleForTesting
@Nullable
public NetworkTimeSuggestion findLatestValidNetworkSuggestionForTests() {
public synchronized NetworkTimeSuggestion findLatestValidNetworkSuggestionForTests() {
return findLatestValidNetworkSuggestion();
}
@@ -590,7 +590,7 @@ public final class TimeDetectorStrategyImpl implements TimeDetectorStrategy {
*/
@VisibleForTesting
@Nullable
public NetworkTimeSuggestion getLatestNetworkSuggestion() {
public synchronized NetworkTimeSuggestion getLatestNetworkSuggestion() {
return mLastNetworkSuggestion.get();
}

View File

@@ -87,6 +87,7 @@ public final class TimeZoneDetectorCallbackImpl implements TimeZoneDetectorStrat
contentResolver.registerContentObserver(
Settings.Global.getUriFor(Settings.Global.AUTO_TIME_ZONE), true,
new ContentObserver(mHandler) {
@Override
public void onChange(boolean selfChange) {
handleConfigChangeOnHandlerThread();
}
@@ -97,6 +98,7 @@ public final class TimeZoneDetectorCallbackImpl implements TimeZoneDetectorStrat
Settings.Secure.getUriFor(Settings.Secure.LOCATION_TIME_ZONE_DETECTION_ENABLED),
true,
new ContentObserver(mHandler) {
@Override
public void onChange(boolean selfChange) {
handleConfigChangeOnHandlerThread();
}

View File

@@ -333,7 +333,7 @@ public final class TimeZoneDetectorService extends ITimeZoneDetectorService.Stub
public void onShellCommand(FileDescriptor in, FileDescriptor out,
FileDescriptor err, String[] args, ShellCallback callback,
ResultReceiver resultReceiver) {
(new TimeZoneDetectorShellCommand(this)).exec(
new TimeZoneDetectorShellCommand(this).exec(
this, in, out, err, args, callback, resultReceiver);
}
}

View File

@@ -644,7 +644,7 @@ public final class TimeZoneDetectorStrategyImpl implements TimeZoneDetectorStrat
* A method used to inspect strategy state during tests. Not intended for general use.
*/
@VisibleForTesting
public GeolocationTimeZoneSuggestion getLatestGeolocationSuggestion() {
public synchronized GeolocationTimeZoneSuggestion getLatestGeolocationSuggestion() {
return mLatestGeoLocationSuggestion.get();
}
@@ -652,7 +652,7 @@ public final class TimeZoneDetectorStrategyImpl implements TimeZoneDetectorStrat
* A {@link TelephonyTimeZoneSuggestion} with additional qualifying metadata.
*/
@VisibleForTesting
public static class QualifiedTelephonyTimeZoneSuggestion {
public static final class QualifiedTelephonyTimeZoneSuggestion {
@VisibleForTesting
public final TelephonyTimeZoneSuggestion suggestion;