summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSasha Kuznetsov <sashakuznetsov@google.com>2020-03-26 12:08:17 -0700
committerSasha Kuznetsov <sashakuznetsov@google.com>2020-03-26 20:31:08 +0000
commit94bb0098bcb8e501eb9040c40199442e858c4e8a (patch)
tree2a2feda5a740506b8fb96fed4d033ef3e67dd57f
parentb8a9f46f0660aa6d79777b651ab515f82c5a70f9 (diff)
Move gnss files to server/location/gnss
Test: build and run cuttlefish Bug: 150810542 Change-Id: I0b83ba5850249e3111b80fcb774dee8121d0a048 Merged-In: I7d966b3e26f1d5e5aadf0085d0d0bfe51b9dfc1a
-rw-r--r--services/core/java/com/android/server/location/RemoteListenerHelper.java2
-rw-r--r--services/core/java/com/android/server/location/gnss/ExponentialBackOff.java (renamed from services/core/java/com/android/server/location/ExponentialBackOff.java)18
-rw-r--r--services/core/java/com/android/server/location/gnss/GnssAntennaInfoProvider.java (renamed from services/core/java/com/android/server/location/GnssAntennaInfoProvider.java)4
-rw-r--r--services/core/java/com/android/server/location/gnss/GnssBatchingProvider.java (renamed from services/core/java/com/android/server/location/GnssBatchingProvider.java)18
-rw-r--r--services/core/java/com/android/server/location/gnss/GnssCapabilitiesProvider.java (renamed from services/core/java/com/android/server/location/GnssCapabilitiesProvider.java)4
-rw-r--r--services/core/java/com/android/server/location/gnss/GnssConfiguration.java (renamed from services/core/java/com/android/server/location/GnssConfiguration.java)4
-rw-r--r--services/core/java/com/android/server/location/gnss/GnssGeofenceProvider.java (renamed from services/core/java/com/android/server/location/GnssGeofenceProvider.java)18
-rw-r--r--services/core/java/com/android/server/location/gnss/GnssLocationProvider.java (renamed from services/core/java/com/android/server/location/GnssLocationProvider.java)9
-rw-r--r--services/core/java/com/android/server/location/gnss/GnssManagerService.java8
-rw-r--r--services/core/java/com/android/server/location/gnss/GnssMeasurementCorrectionsProvider.java (renamed from services/core/java/com/android/server/location/GnssMeasurementCorrectionsProvider.java)4
-rw-r--r--services/core/java/com/android/server/location/gnss/GnssMeasurementsProvider.java (renamed from services/core/java/com/android/server/location/GnssMeasurementsProvider.java)6
-rw-r--r--services/core/java/com/android/server/location/gnss/GnssNavigationMessageProvider.java (renamed from services/core/java/com/android/server/location/GnssNavigationMessageProvider.java)6
-rw-r--r--services/core/java/com/android/server/location/gnss/GnssNetworkConnectivityHandler.java (renamed from services/core/java/com/android/server/location/GnssNetworkConnectivityHandler.java)4
-rw-r--r--services/core/java/com/android/server/location/gnss/GnssPositionMode.java (renamed from services/core/java/com/android/server/location/GnssPositionMode.java)18
-rw-r--r--services/core/java/com/android/server/location/gnss/GnssSatelliteBlacklistHelper.java (renamed from services/core/java/com/android/server/location/GnssSatelliteBlacklistHelper.java)18
-rw-r--r--services/core/java/com/android/server/location/gnss/GnssStatusListenerHelper.java (renamed from services/core/java/com/android/server/location/GnssStatusListenerHelper.java)9
-rw-r--r--services/core/java/com/android/server/location/gnss/GnssVisibilityControl.java (renamed from services/core/java/com/android/server/location/GnssVisibilityControl.java)4
-rw-r--r--services/core/java/com/android/server/location/gnss/GpsPsdsDownloader.java (renamed from services/core/java/com/android/server/location/GpsPsdsDownloader.java)4
-rw-r--r--services/core/java/com/android/server/location/gnss/NtpTimeHelper.java (renamed from services/core/java/com/android/server/location/NtpTimeHelper.java)19
-rw-r--r--services/core/jni/com_android_server_location_GnssLocationProvider.cpp126
-rw-r--r--services/robotests/src/com/android/server/location/gnss/GnssAntennaInfoProviderTest.java (renamed from services/robotests/src/com/android/server/location/GnssAntennaInfoProviderTest.java)5
-rw-r--r--services/robotests/src/com/android/server/location/gnss/GnssBatchingProviderTest.java (renamed from services/robotests/src/com/android/server/location/GnssBatchingProviderTest.java)20
-rw-r--r--services/robotests/src/com/android/server/location/gnss/GnssGeofenceProviderTest.java (renamed from services/robotests/src/com/android/server/location/GnssGeofenceProviderTest.java)18
-rw-r--r--services/robotests/src/com/android/server/location/gnss/GnssMeasurementsProviderTest.java (renamed from services/robotests/src/com/android/server/location/GnssMeasurementsProviderTest.java)21
-rw-r--r--services/robotests/src/com/android/server/location/gnss/GnssNavigationMessageProviderTest.java (renamed from services/robotests/src/com/android/server/location/GnssNavigationMessageProviderTest.java)21
-rw-r--r--services/robotests/src/com/android/server/location/gnss/GnssPositionModeTest.java (renamed from services/robotests/src/com/android/server/location/GnssPositionModeTest.java)18
-rw-r--r--services/robotests/src/com/android/server/location/gnss/GnssSatelliteBlacklistHelperTest.java (renamed from services/robotests/src/com/android/server/location/GnssSatelliteBlacklistHelperTest.java)21
-rw-r--r--services/robotests/src/com/android/server/location/gnss/NtpTimeHelperTest.java (renamed from services/robotests/src/com/android/server/location/NtpTimeHelperTest.java)20
-rw-r--r--services/tests/servicestests/src/com/android/server/location/gnss/GnssManagerServiceTest.java14
29 files changed, 316 insertions, 145 deletions
diff --git a/services/core/java/com/android/server/location/RemoteListenerHelper.java b/services/core/java/com/android/server/location/RemoteListenerHelper.java
index 11f068533a6d..f6652892c3de 100644
--- a/services/core/java/com/android/server/location/RemoteListenerHelper.java
+++ b/services/core/java/com/android/server/location/RemoteListenerHelper.java
@@ -273,7 +273,7 @@ public abstract class RemoteListenerHelper<TRequest, TListener extends IInterfac
}
@Nullable
- protected TRequest getRequest() {
+ public TRequest getRequest() {
return mRequest;
}
}
diff --git a/services/core/java/com/android/server/location/ExponentialBackOff.java b/services/core/java/com/android/server/location/gnss/ExponentialBackOff.java
index 8c77b2176b74..05a534fa36e9 100644
--- a/services/core/java/com/android/server/location/ExponentialBackOff.java
+++ b/services/core/java/com/android/server/location/gnss/ExponentialBackOff.java
@@ -1,4 +1,20 @@
-package com.android.server.location;
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.server.location.gnss;
/**
* A simple implementation of exponential backoff.
diff --git a/services/core/java/com/android/server/location/GnssAntennaInfoProvider.java b/services/core/java/com/android/server/location/gnss/GnssAntennaInfoProvider.java
index bc50ebc2c5c3..d839095542c7 100644
--- a/services/core/java/com/android/server/location/GnssAntennaInfoProvider.java
+++ b/services/core/java/com/android/server/location/gnss/GnssAntennaInfoProvider.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.server.location;
+package com.android.server.location.gnss;
import android.content.Context;
import android.location.GnssAntennaInfo;
@@ -23,6 +23,8 @@ import android.os.Handler;
import android.util.Log;
import com.android.internal.annotations.VisibleForTesting;
+import com.android.server.location.CallerIdentity;
+import com.android.server.location.RemoteListenerHelper;
import java.util.List;
diff --git a/services/core/java/com/android/server/location/GnssBatchingProvider.java b/services/core/java/com/android/server/location/gnss/GnssBatchingProvider.java
index f3918ee9e8ff..f583a3ed3136 100644
--- a/services/core/java/com/android/server/location/GnssBatchingProvider.java
+++ b/services/core/java/com/android/server/location/gnss/GnssBatchingProvider.java
@@ -1,4 +1,20 @@
-package com.android.server.location;
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.server.location.gnss;
import android.util.Log;
diff --git a/services/core/java/com/android/server/location/GnssCapabilitiesProvider.java b/services/core/java/com/android/server/location/gnss/GnssCapabilitiesProvider.java
index 5c8507f7fde0..71b5b33c242b 100644
--- a/services/core/java/com/android/server/location/GnssCapabilitiesProvider.java
+++ b/services/core/java/com/android/server/location/gnss/GnssCapabilitiesProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2019 The Android Open Source Project
+ * Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.server.location;
+package com.android.server.location.gnss;
import android.location.GnssCapabilities;
import android.util.Log;
diff --git a/services/core/java/com/android/server/location/GnssConfiguration.java b/services/core/java/com/android/server/location/gnss/GnssConfiguration.java
index a3523f23ddcf..14ab79e7ecde 100644
--- a/services/core/java/com/android/server/location/GnssConfiguration.java
+++ b/services/core/java/com/android/server/location/gnss/GnssConfiguration.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2019 The Android Open Source Project
+ * Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.server.location;
+package com.android.server.location.gnss;
import android.content.Context;
import android.os.PersistableBundle;
diff --git a/services/core/java/com/android/server/location/GnssGeofenceProvider.java b/services/core/java/com/android/server/location/gnss/GnssGeofenceProvider.java
index a84b0b1c4335..53883b91c36d 100644
--- a/services/core/java/com/android/server/location/GnssGeofenceProvider.java
+++ b/services/core/java/com/android/server/location/gnss/GnssGeofenceProvider.java
@@ -1,4 +1,20 @@
-package com.android.server.location;
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.server.location.gnss;
import android.location.IGpsGeofenceHardware;
import android.util.Log;
diff --git a/services/core/java/com/android/server/location/GnssLocationProvider.java b/services/core/java/com/android/server/location/gnss/GnssLocationProvider.java
index c1fbcfba864a..ad3c8a61182f 100644
--- a/services/core/java/com/android/server/location/GnssLocationProvider.java
+++ b/services/core/java/com/android/server/location/gnss/GnssLocationProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.server.location;
+package com.android.server.location.gnss;
import android.app.AlarmManager;
import android.app.AppOpsManager;
@@ -78,8 +78,9 @@ import com.android.internal.util.FrameworkStatsLog;
import com.android.server.DeviceIdleInternal;
import com.android.server.FgThread;
import com.android.server.LocalServices;
-import com.android.server.location.GnssSatelliteBlacklistHelper.GnssSatelliteBlacklistCallback;
-import com.android.server.location.NtpTimeHelper.InjectNtpTimeCallback;
+import com.android.server.location.AbstractLocationProvider;
+import com.android.server.location.gnss.NtpTimeHelper.InjectNtpTimeCallback;
+import com.android.server.location.gnss.GnssSatelliteBlacklistHelper.GnssSatelliteBlacklistCallback;
import java.io.FileDescriptor;
import java.io.PrintWriter;
diff --git a/services/core/java/com/android/server/location/gnss/GnssManagerService.java b/services/core/java/com/android/server/location/gnss/GnssManagerService.java
index b57c261931f8..9e64e3aeae59 100644
--- a/services/core/java/com/android/server/location/gnss/GnssManagerService.java
+++ b/services/core/java/com/android/server/location/gnss/GnssManagerService.java
@@ -55,14 +55,6 @@ import com.android.server.LocationManagerServiceUtils.LinkedListener;
import com.android.server.LocationManagerServiceUtils.LinkedListenerBase;
import com.android.server.location.AppForegroundHelper;
import com.android.server.location.CallerIdentity;
-import com.android.server.location.GnssAntennaInfoProvider;
-import com.android.server.location.GnssBatchingProvider;
-import com.android.server.location.GnssCapabilitiesProvider;
-import com.android.server.location.GnssLocationProvider;
-import com.android.server.location.GnssMeasurementCorrectionsProvider;
-import com.android.server.location.GnssMeasurementsProvider;
-import com.android.server.location.GnssNavigationMessageProvider;
-import com.android.server.location.GnssStatusListenerHelper;
import com.android.server.location.LocationUsageLogger;
import com.android.server.location.RemoteListenerHelper;
import com.android.server.location.SettingsHelper;
diff --git a/services/core/java/com/android/server/location/GnssMeasurementCorrectionsProvider.java b/services/core/java/com/android/server/location/gnss/GnssMeasurementCorrectionsProvider.java
index 82528caa0b4e..ac165d1a206b 100644
--- a/services/core/java/com/android/server/location/GnssMeasurementCorrectionsProvider.java
+++ b/services/core/java/com/android/server/location/gnss/GnssMeasurementCorrectionsProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2019 The Android Open Source Project
+ * Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.server.location;
+package com.android.server.location.gnss;
import android.location.GnssMeasurementCorrections;
import android.os.Handler;
diff --git a/services/core/java/com/android/server/location/GnssMeasurementsProvider.java b/services/core/java/com/android/server/location/gnss/GnssMeasurementsProvider.java
index 6ba5f079264c..76c3ad02e7e9 100644
--- a/services/core/java/com/android/server/location/GnssMeasurementsProvider.java
+++ b/services/core/java/com/android/server/location/gnss/GnssMeasurementsProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2014 The Android Open Source Project
+ * Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.server.location;
+package com.android.server.location.gnss;
import android.content.Context;
import android.location.GnssMeasurementsEvent;
@@ -26,6 +26,8 @@ import android.provider.Settings;
import android.util.Log;
import com.android.internal.annotations.VisibleForTesting;
+import com.android.server.location.CallerIdentity;
+import com.android.server.location.RemoteListenerHelper;
/**
* An base implementation for GPS measurements provider. It abstracts out the responsibility of
diff --git a/services/core/java/com/android/server/location/GnssNavigationMessageProvider.java b/services/core/java/com/android/server/location/gnss/GnssNavigationMessageProvider.java
index fb901e86f494..722be3df2691 100644
--- a/services/core/java/com/android/server/location/GnssNavigationMessageProvider.java
+++ b/services/core/java/com/android/server/location/gnss/GnssNavigationMessageProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2014 The Android Open Source Project
+ * Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.server.location;
+package com.android.server.location.gnss;
import android.content.Context;
import android.location.GnssNavigationMessage;
@@ -24,6 +24,8 @@ import android.os.RemoteException;
import android.util.Log;
import com.android.internal.annotations.VisibleForTesting;
+import com.android.server.location.CallerIdentity;
+import com.android.server.location.RemoteListenerHelper;
/**
* An base implementation for GPS navigation messages provider.
diff --git a/services/core/java/com/android/server/location/GnssNetworkConnectivityHandler.java b/services/core/java/com/android/server/location/gnss/GnssNetworkConnectivityHandler.java
index 5d6474bdbccc..3fb713bc01a5 100644
--- a/services/core/java/com/android/server/location/GnssNetworkConnectivityHandler.java
+++ b/services/core/java/com/android/server/location/gnss/GnssNetworkConnectivityHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2018 The Android Open Source Project
+ * Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.server.location;
+package com.android.server.location.gnss;
import android.content.Context;
import android.database.Cursor;
diff --git a/services/core/java/com/android/server/location/GnssPositionMode.java b/services/core/java/com/android/server/location/gnss/GnssPositionMode.java
index 36838fc3647f..045118afbda0 100644
--- a/services/core/java/com/android/server/location/GnssPositionMode.java
+++ b/services/core/java/com/android/server/location/gnss/GnssPositionMode.java
@@ -1,4 +1,20 @@
-package com.android.server.location;
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.server.location.gnss;
import java.util.Arrays;
diff --git a/services/core/java/com/android/server/location/GnssSatelliteBlacklistHelper.java b/services/core/java/com/android/server/location/gnss/GnssSatelliteBlacklistHelper.java
index eb99a851115f..dccef9b9a9c4 100644
--- a/services/core/java/com/android/server/location/GnssSatelliteBlacklistHelper.java
+++ b/services/core/java/com/android/server/location/gnss/GnssSatelliteBlacklistHelper.java
@@ -1,4 +1,20 @@
-package com.android.server.location;
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.server.location.gnss;
import android.content.ContentResolver;
import android.content.Context;
diff --git a/services/core/java/com/android/server/location/GnssStatusListenerHelper.java b/services/core/java/com/android/server/location/gnss/GnssStatusListenerHelper.java
index 1d16c03fd6f7..d2ecdeebd9d0 100644
--- a/services/core/java/com/android/server/location/GnssStatusListenerHelper.java
+++ b/services/core/java/com/android/server/location/gnss/GnssStatusListenerHelper.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2014 The Android Open Source Project
+ * Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -11,16 +11,19 @@
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
- * limitations under the License
+ * limitations under the License.
*/
-package com.android.server.location;
+package com.android.server.location.gnss;
import android.content.Context;
import android.location.IGnssStatusListener;
import android.os.Handler;
import android.util.Log;
+import com.android.server.location.CallerIdentity;
+import com.android.server.location.RemoteListenerHelper;
+
/**
* Implementation of a handler for {@link IGnssStatusListener}.
*/
diff --git a/services/core/java/com/android/server/location/GnssVisibilityControl.java b/services/core/java/com/android/server/location/gnss/GnssVisibilityControl.java
index 2b5fc7989d8b..06fa0ea7791d 100644
--- a/services/core/java/com/android/server/location/GnssVisibilityControl.java
+++ b/services/core/java/com/android/server/location/gnss/GnssVisibilityControl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2019 The Android Open Source Project
+ * Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.server.location;
+package com.android.server.location.gnss;
import android.annotation.Nullable;
import android.annotation.SuppressLint;
diff --git a/services/core/java/com/android/server/location/GpsPsdsDownloader.java b/services/core/java/com/android/server/location/gnss/GpsPsdsDownloader.java
index 6fcb7d1af2ce..273f9cb13a1b 100644
--- a/services/core/java/com/android/server/location/GpsPsdsDownloader.java
+++ b/services/core/java/com/android/server/location/gnss/GpsPsdsDownloader.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 The Android Open Source Project
+ * Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.server.location;
+package com.android.server.location.gnss;
import android.net.TrafficStats;
import android.text.TextUtils;
diff --git a/services/core/java/com/android/server/location/NtpTimeHelper.java b/services/core/java/com/android/server/location/gnss/NtpTimeHelper.java
index d2296ea27913..2bbb61fbe018 100644
--- a/services/core/java/com/android/server/location/NtpTimeHelper.java
+++ b/services/core/java/com/android/server/location/gnss/NtpTimeHelper.java
@@ -1,4 +1,20 @@
-package com.android.server.location;
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.server.location.gnss;
import android.content.Context;
import android.net.ConnectivityManager;
@@ -12,6 +28,7 @@ import android.util.NtpTrustedTime;
import com.android.internal.annotations.GuardedBy;
import com.android.internal.annotations.VisibleForTesting;
+import com.android.server.location.gnss.ExponentialBackOff;
import java.util.Date;
diff --git a/services/core/jni/com_android_server_location_GnssLocationProvider.cpp b/services/core/jni/com_android_server_location_GnssLocationProvider.cpp
index 822f3835cc07..e4061b4fc34c 100644
--- a/services/core/jni/com_android_server_location_GnssLocationProvider.cpp
+++ b/services/core/jni/com_android_server_location_GnssLocationProvider.cpp
@@ -2068,8 +2068,8 @@ static void android_location_GnssLocationProvider_class_init_native(JNIEnv* env,
class_gnssClock = (jclass) env->NewGlobalRef(gnssClockClass);
method_gnssClockCtor = env->GetMethodID(class_gnssClock, "<init>", "()V");
- jclass gnssConfiguration_halInterfaceVersionClass =
- env->FindClass("com/android/server/location/GnssConfiguration$HalInterfaceVersion");
+ jclass gnssConfiguration_halInterfaceVersionClass = env->FindClass(
+ "com/android/server/location/gnss/GnssConfiguration$HalInterfaceVersion");
class_gnssConfiguration_halInterfaceVersion =
(jclass) env->NewGlobalRef(gnssConfiguration_halInterfaceVersionClass);
method_halInterfaceVersionCtor =
@@ -3738,39 +3738,29 @@ static const JNINativeMethod sNetworkConnectivityMethods[] = {
};
static const JNINativeMethod sConfigurationMethods[] = {
- /* name, signature, funcPtr */
- {"native_get_gnss_configuration_version",
- "()Lcom/android/server/location/GnssConfiguration$HalInterfaceVersion;",
- reinterpret_cast<void *>(
- android_location_GnssConfiguration_get_gnss_configuration_version)},
- {"native_set_supl_es",
- "(I)Z",
- reinterpret_cast<void *>(android_location_GnssConfiguration_set_supl_es)},
- {"native_set_supl_version",
- "(I)Z",
- reinterpret_cast<void *>(android_location_GnssConfiguration_set_supl_version)},
- {"native_set_supl_mode",
- "(I)Z",
- reinterpret_cast<void *>(android_location_GnssConfiguration_set_supl_mode)},
- {"native_set_lpp_profile",
- "(I)Z",
- reinterpret_cast<void *>(android_location_GnssConfiguration_set_lpp_profile)},
- {"native_set_gnss_pos_protocol_select",
- "(I)Z",
- reinterpret_cast<void *>(
- android_location_GnssConfiguration_set_gnss_pos_protocol_select)},
- {"native_set_gps_lock",
- "(I)Z",
- reinterpret_cast<void *>(android_location_GnssConfiguration_set_gps_lock)},
- {"native_set_emergency_supl_pdn",
- "(I)Z",
- reinterpret_cast<void *>(android_location_GnssConfiguration_set_emergency_supl_pdn)},
- {"native_set_satellite_blacklist",
- "([I[I)Z",
- reinterpret_cast<void *>(android_location_GnssConfiguration_set_satellite_blacklist)},
- {"native_set_es_extension_sec",
- "(I)Z",
- reinterpret_cast<void *>(android_location_GnssConfiguration_set_es_extension_sec)},
+ /* name, signature, funcPtr */
+ {"native_get_gnss_configuration_version",
+ "()Lcom/android/server/location/gnss/GnssConfiguration$HalInterfaceVersion;",
+ reinterpret_cast<void*>(
+ android_location_GnssConfiguration_get_gnss_configuration_version)},
+ {"native_set_supl_es", "(I)Z",
+ reinterpret_cast<void*>(android_location_GnssConfiguration_set_supl_es)},
+ {"native_set_supl_version", "(I)Z",
+ reinterpret_cast<void*>(android_location_GnssConfiguration_set_supl_version)},
+ {"native_set_supl_mode", "(I)Z",
+ reinterpret_cast<void*>(android_location_GnssConfiguration_set_supl_mode)},
+ {"native_set_lpp_profile", "(I)Z",
+ reinterpret_cast<void*>(android_location_GnssConfiguration_set_lpp_profile)},
+ {"native_set_gnss_pos_protocol_select", "(I)Z",
+ reinterpret_cast<void*>(android_location_GnssConfiguration_set_gnss_pos_protocol_select)},
+ {"native_set_gps_lock", "(I)Z",
+ reinterpret_cast<void*>(android_location_GnssConfiguration_set_gps_lock)},
+ {"native_set_emergency_supl_pdn", "(I)Z",
+ reinterpret_cast<void*>(android_location_GnssConfiguration_set_emergency_supl_pdn)},
+ {"native_set_satellite_blacklist", "([I[I)Z",
+ reinterpret_cast<void*>(android_location_GnssConfiguration_set_satellite_blacklist)},
+ {"native_set_es_extension_sec", "(I)Z",
+ reinterpret_cast<void*>(android_location_GnssConfiguration_set_es_extension_sec)},
};
static const JNINativeMethod sVisibilityControlMethods[] = {
@@ -3782,53 +3772,27 @@ static const JNINativeMethod sVisibilityControlMethods[] = {
};
int register_android_server_location_GnssLocationProvider(JNIEnv* env) {
- jniRegisterNativeMethods(env, "com/android/server/location/GnssAntennaInfoProvider",
+ jniRegisterNativeMethods(env, "com/android/server/location/gnss/GnssAntennaInfoProvider",
sAntennaInfoMethods, NELEM(sAntennaInfoMethods));
- jniRegisterNativeMethods(
- env,
- "com/android/server/location/GnssBatchingProvider",
- sMethodsBatching,
- NELEM(sMethodsBatching));
- jniRegisterNativeMethods(
- env,
- "com/android/server/location/GnssGeofenceProvider",
- sGeofenceMethods,
- NELEM(sGeofenceMethods));
- jniRegisterNativeMethods(
- env,
- "com/android/server/location/GnssMeasurementsProvider",
- sMeasurementMethods,
- NELEM(sMeasurementMethods));
- jniRegisterNativeMethods(
- env,
- "com/android/server/location/GnssMeasurementCorrectionsProvider",
- sMeasurementCorrectionsMethods,
- NELEM(sMeasurementCorrectionsMethods));
- jniRegisterNativeMethods(
- env,
- "com/android/server/location/GnssNavigationMessageProvider",
- sNavigationMessageMethods,
- NELEM(sNavigationMessageMethods));
- jniRegisterNativeMethods(
- env,
- "com/android/server/location/GnssNetworkConnectivityHandler",
- sNetworkConnectivityMethods,
- NELEM(sNetworkConnectivityMethods));
- jniRegisterNativeMethods(
- env,
- "com/android/server/location/GnssConfiguration",
- sConfigurationMethods,
- NELEM(sConfigurationMethods));
- jniRegisterNativeMethods(
- env,
- "com/android/server/location/GnssVisibilityControl",
- sVisibilityControlMethods,
- NELEM(sVisibilityControlMethods));
- return jniRegisterNativeMethods(
- env,
- "com/android/server/location/GnssLocationProvider",
- sMethods,
- NELEM(sMethods));
+ jniRegisterNativeMethods(env, "com/android/server/location/gnss/GnssBatchingProvider",
+ sMethodsBatching, NELEM(sMethodsBatching));
+ jniRegisterNativeMethods(env, "com/android/server/location/gnss/GnssGeofenceProvider",
+ sGeofenceMethods, NELEM(sGeofenceMethods));
+ jniRegisterNativeMethods(env, "com/android/server/location/gnss/GnssMeasurementsProvider",
+ sMeasurementMethods, NELEM(sMeasurementMethods));
+ jniRegisterNativeMethods(env,
+ "com/android/server/location/gnss/GnssMeasurementCorrectionsProvider",
+ sMeasurementCorrectionsMethods, NELEM(sMeasurementCorrectionsMethods));
+ jniRegisterNativeMethods(env, "com/android/server/location/gnss/GnssNavigationMessageProvider",
+ sNavigationMessageMethods, NELEM(sNavigationMessageMethods));
+ jniRegisterNativeMethods(env, "com/android/server/location/gnss/GnssNetworkConnectivityHandler",
+ sNetworkConnectivityMethods, NELEM(sNetworkConnectivityMethods));
+ jniRegisterNativeMethods(env, "com/android/server/location/gnss/GnssConfiguration",
+ sConfigurationMethods, NELEM(sConfigurationMethods));
+ jniRegisterNativeMethods(env, "com/android/server/location/gnss/GnssVisibilityControl",
+ sVisibilityControlMethods, NELEM(sVisibilityControlMethods));
+ return jniRegisterNativeMethods(env, "com/android/server/location/gnss/GnssLocationProvider",
+ sMethods, NELEM(sMethods));
}
} /* namespace android */
diff --git a/services/robotests/src/com/android/server/location/GnssAntennaInfoProviderTest.java b/services/robotests/src/com/android/server/location/gnss/GnssAntennaInfoProviderTest.java
index 76f7ad646bb1..d8acd6ea6948 100644
--- a/services/robotests/src/com/android/server/location/GnssAntennaInfoProviderTest.java
+++ b/services/robotests/src/com/android/server/location/gnss/GnssAntennaInfoProviderTest.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.server.location;
+package com.android.server.location.gnss;
import static com.google.common.truth.Truth.assertThat;
@@ -41,7 +41,8 @@ import org.robolectric.RuntimeEnvironment;
@Presubmit
public class GnssAntennaInfoProviderTest {
@Mock
- private GnssAntennaInfoProvider.GnssAntennaInfoProviderNative mMockNative;
+ private GnssAntennaInfoProvider.GnssAntennaInfoProviderNative
+ mMockNative;
private GnssAntennaInfoProvider mTestProvider;
/** Setup. */
diff --git a/services/robotests/src/com/android/server/location/GnssBatchingProviderTest.java b/services/robotests/src/com/android/server/location/gnss/GnssBatchingProviderTest.java
index d58c3f73b8e8..25d6aa4dae29 100644
--- a/services/robotests/src/com/android/server/location/GnssBatchingProviderTest.java
+++ b/services/robotests/src/com/android/server/location/gnss/GnssBatchingProviderTest.java
@@ -1,4 +1,20 @@
-package com.android.server.location;
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.server.location.gnss;
import static com.google.common.truth.Truth.assertThat;
@@ -11,7 +27,7 @@ import static org.mockito.Mockito.when;
import android.platform.test.annotations.Presubmit;
-import com.android.server.location.GnssBatchingProvider.GnssBatchingProviderNative;
+import com.android.server.location.gnss.GnssBatchingProvider.GnssBatchingProviderNative;
import org.junit.Before;
import org.junit.Test;
diff --git a/services/robotests/src/com/android/server/location/GnssGeofenceProviderTest.java b/services/robotests/src/com/android/server/location/gnss/GnssGeofenceProviderTest.java
index 30c73368da15..4a533aac01db 100644
--- a/services/robotests/src/com/android/server/location/GnssGeofenceProviderTest.java
+++ b/services/robotests/src/com/android/server/location/gnss/GnssGeofenceProviderTest.java
@@ -1,4 +1,20 @@
-package com.android.server.location;
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.server.location.gnss;
import static org.mockito.ArgumentMatchers.anyDouble;
import static org.mockito.ArgumentMatchers.anyInt;
diff --git a/services/robotests/src/com/android/server/location/GnssMeasurementsProviderTest.java b/services/robotests/src/com/android/server/location/gnss/GnssMeasurementsProviderTest.java
index b349b67dab0c..e7d9ef810e51 100644
--- a/services/robotests/src/com/android/server/location/GnssMeasurementsProviderTest.java
+++ b/services/robotests/src/com/android/server/location/gnss/GnssMeasurementsProviderTest.java
@@ -1,4 +1,20 @@
-package com.android.server.location;
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.server.location.gnss;
import static com.google.common.truth.Truth.assertThat;
@@ -26,7 +42,8 @@ import org.robolectric.RuntimeEnvironment;
@Presubmit
public class GnssMeasurementsProviderTest {
@Mock
- private GnssMeasurementsProvider.GnssMeasurementProviderNative mMockNative;
+ private GnssMeasurementsProvider.GnssMeasurementProviderNative
+ mMockNative;
private GnssMeasurementsProvider mTestProvider;
@Before
diff --git a/services/robotests/src/com/android/server/location/GnssNavigationMessageProviderTest.java b/services/robotests/src/com/android/server/location/gnss/GnssNavigationMessageProviderTest.java
index aa2a96e6fad4..c21db73fb56c 100644
--- a/services/robotests/src/com/android/server/location/GnssNavigationMessageProviderTest.java
+++ b/services/robotests/src/com/android/server/location/gnss/GnssNavigationMessageProviderTest.java
@@ -1,4 +1,20 @@
-package com.android.server.location;
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.server.location.gnss;
import static com.google.common.truth.Truth.assertThat;
@@ -25,7 +41,8 @@ import org.robolectric.RuntimeEnvironment;
@Presubmit
public class GnssNavigationMessageProviderTest {
@Mock
- private GnssNavigationMessageProvider.GnssNavigationMessageProviderNative mMockNative;
+ private GnssNavigationMessageProvider.GnssNavigationMessageProviderNative
+ mMockNative;
private GnssNavigationMessageProvider mTestProvider;
@Before
diff --git a/services/robotests/src/com/android/server/location/GnssPositionModeTest.java b/services/robotests/src/com/android/server/location/gnss/GnssPositionModeTest.java
index f37f50e76ae5..7117ff95b401 100644
--- a/services/robotests/src/com/android/server/location/GnssPositionModeTest.java
+++ b/services/robotests/src/com/android/server/location/gnss/GnssPositionModeTest.java
@@ -1,4 +1,20 @@
-package com.android.server.location;
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.server.location.gnss;
import static com.google.common.truth.Truth.assertThat;
diff --git a/services/robotests/src/com/android/server/location/GnssSatelliteBlacklistHelperTest.java b/services/robotests/src/com/android/server/location/gnss/GnssSatelliteBlacklistHelperTest.java
index ba4a753e4813..7c73a2f92f71 100644
--- a/services/robotests/src/com/android/server/location/GnssSatelliteBlacklistHelperTest.java
+++ b/services/robotests/src/com/android/server/location/gnss/GnssSatelliteBlacklistHelperTest.java
@@ -1,4 +1,20 @@
-package com.android.server.location;
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.server.location.gnss;
import static com.google.common.truth.Truth.assertThat;
@@ -35,7 +51,8 @@ public class GnssSatelliteBlacklistHelperTest {
private ContentResolver mContentResolver;
@Mock
- private GnssSatelliteBlacklistHelper.GnssSatelliteBlacklistCallback mCallback;
+ private GnssSatelliteBlacklistHelper.GnssSatelliteBlacklistCallback
+ mCallback;
@Before
public void setUp() {
diff --git a/services/robotests/src/com/android/server/location/NtpTimeHelperTest.java b/services/robotests/src/com/android/server/location/gnss/NtpTimeHelperTest.java
index 9c5d4ad6ceeb..9b59aaddc4d4 100644
--- a/services/robotests/src/com/android/server/location/NtpTimeHelperTest.java
+++ b/services/robotests/src/com/android/server/location/gnss/NtpTimeHelperTest.java
@@ -1,4 +1,20 @@
-package com.android.server.location;
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.server.location.gnss;
import static com.google.common.truth.Truth.assertThat;
@@ -10,7 +26,7 @@ import android.os.SystemClock;
import android.platform.test.annotations.Presubmit;
import android.util.NtpTrustedTime;
-import com.android.server.location.NtpTimeHelper.InjectNtpTimeCallback;
+import com.android.server.location.gnss.NtpTimeHelper.InjectNtpTimeCallback;
import org.junit.Before;
import org.junit.Test;
diff --git a/services/tests/servicestests/src/com/android/server/location/gnss/GnssManagerServiceTest.java b/services/tests/servicestests/src/com/android/server/location/gnss/GnssManagerServiceTest.java
index a99c982753c5..be2a5c529181 100644
--- a/services/tests/servicestests/src/com/android/server/location/gnss/GnssManagerServiceTest.java
+++ b/services/tests/servicestests/src/com/android/server/location/gnss/GnssManagerServiceTest.java
@@ -61,17 +61,9 @@ import android.os.RemoteException;
import com.android.server.LocalServices;
import com.android.server.location.AppForegroundHelper;
-import com.android.server.location.GnssAntennaInfoProvider;
-import com.android.server.location.GnssAntennaInfoProvider.GnssAntennaInfoProviderNative;
-import com.android.server.location.GnssBatchingProvider;
-import com.android.server.location.GnssCapabilitiesProvider;
-import com.android.server.location.GnssLocationProvider;
-import com.android.server.location.GnssMeasurementCorrectionsProvider;
-import com.android.server.location.GnssMeasurementsProvider;
-import com.android.server.location.GnssMeasurementsProvider.GnssMeasurementProviderNative;
-import com.android.server.location.GnssNavigationMessageProvider;
-import com.android.server.location.GnssNavigationMessageProvider.GnssNavigationMessageProviderNative;
-import com.android.server.location.GnssStatusListenerHelper;
+import com.android.server.location.gnss.GnssAntennaInfoProvider.GnssAntennaInfoProviderNative;
+import com.android.server.location.gnss.GnssMeasurementsProvider.GnssMeasurementProviderNative;
+import com.android.server.location.gnss.GnssNavigationMessageProvider.GnssNavigationMessageProviderNative;
import com.android.server.location.LocationUsageLogger;
import com.android.server.location.SettingsHelper;