Merge "Move gnss files to server/location/gnss" into rvc-dev

This commit is contained in:
Sasha Kuznetsov
2020-03-27 06:03:00 +00:00
committed by Android (Google) Code Review
29 changed files with 316 additions and 145 deletions

View File

@@ -273,7 +273,7 @@ public abstract class RemoteListenerHelper<TRequest, TListener extends IInterfac
} }
@Nullable @Nullable
protected TRequest getRequest() { public TRequest getRequest() {
return mRequest; return mRequest;
} }
} }

View File

@@ -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. * A simple implementation of exponential backoff.

View File

@@ -14,7 +14,7 @@
* 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.content.Context;
import android.location.GnssAntennaInfo; import android.location.GnssAntennaInfo;
@@ -23,6 +23,8 @@ import android.os.Handler;
import android.util.Log; import android.util.Log;
import com.android.internal.annotations.VisibleForTesting; import com.android.internal.annotations.VisibleForTesting;
import com.android.server.location.CallerIdentity;
import com.android.server.location.RemoteListenerHelper;
import java.util.List; import java.util.List;

View File

@@ -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; import android.util.Log;

View File

@@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package com.android.server.location; package com.android.server.location.gnss;
import android.location.GnssCapabilities; import android.location.GnssCapabilities;
import android.util.Log; import android.util.Log;

View File

@@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
* 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.content.Context;
import android.os.PersistableBundle; import android.os.PersistableBundle;

View File

@@ -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.location.IGpsGeofenceHardware;
import android.util.Log; import android.util.Log;

View File

@@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package com.android.server.location; package com.android.server.location.gnss;
import android.app.AlarmManager; import android.app.AlarmManager;
import android.app.AppOpsManager; import android.app.AppOpsManager;
@@ -78,8 +78,9 @@ import com.android.internal.util.FrameworkStatsLog;
import com.android.server.DeviceIdleInternal; import com.android.server.DeviceIdleInternal;
import com.android.server.FgThread; import com.android.server.FgThread;
import com.android.server.LocalServices; import com.android.server.LocalServices;
import com.android.server.location.GnssSatelliteBlacklistHelper.GnssSatelliteBlacklistCallback; import com.android.server.location.AbstractLocationProvider;
import com.android.server.location.NtpTimeHelper.InjectNtpTimeCallback; import com.android.server.location.gnss.NtpTimeHelper.InjectNtpTimeCallback;
import com.android.server.location.gnss.GnssSatelliteBlacklistHelper.GnssSatelliteBlacklistCallback;
import java.io.FileDescriptor; import java.io.FileDescriptor;
import java.io.PrintWriter; import java.io.PrintWriter;

View File

@@ -55,14 +55,6 @@ import com.android.server.LocationManagerServiceUtils.LinkedListener;
import com.android.server.LocationManagerServiceUtils.LinkedListenerBase; import com.android.server.LocationManagerServiceUtils.LinkedListenerBase;
import com.android.server.location.AppForegroundHelper; import com.android.server.location.AppForegroundHelper;
import com.android.server.location.CallerIdentity; 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.LocationUsageLogger;
import com.android.server.location.RemoteListenerHelper; import com.android.server.location.RemoteListenerHelper;
import com.android.server.location.SettingsHelper; import com.android.server.location.SettingsHelper;

View File

@@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package com.android.server.location; package com.android.server.location.gnss;
import android.location.GnssMeasurementCorrections; import android.location.GnssMeasurementCorrections;
import android.os.Handler; import android.os.Handler;

View File

@@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
* 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.content.Context;
import android.location.GnssMeasurementsEvent; import android.location.GnssMeasurementsEvent;
@@ -26,6 +26,8 @@ import android.provider.Settings;
import android.util.Log; import android.util.Log;
import com.android.internal.annotations.VisibleForTesting; 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 * An base implementation for GPS measurements provider. It abstracts out the responsibility of

View File

@@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
* 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.content.Context;
import android.location.GnssNavigationMessage; import android.location.GnssNavigationMessage;
@@ -24,6 +24,8 @@ import android.os.RemoteException;
import android.util.Log; import android.util.Log;
import com.android.internal.annotations.VisibleForTesting; 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. * An base implementation for GPS navigation messages provider.

View File

@@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
* 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.content.Context;
import android.database.Cursor; import android.database.Cursor;

View File

@@ -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; import java.util.Arrays;

View File

@@ -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.ContentResolver;
import android.content.Context; import android.content.Context;

View File

@@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with 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, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * 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.content.Context;
import android.location.IGnssStatusListener; import android.location.IGnssStatusListener;
import android.os.Handler; import android.os.Handler;
import android.util.Log; import android.util.Log;
import com.android.server.location.CallerIdentity;
import com.android.server.location.RemoteListenerHelper;
/** /**
* Implementation of a handler for {@link IGnssStatusListener}. * Implementation of a handler for {@link IGnssStatusListener}.
*/ */

View File

@@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package com.android.server.location; package com.android.server.location.gnss;
import android.annotation.Nullable; import android.annotation.Nullable;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;

View File

@@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package com.android.server.location; package com.android.server.location.gnss;
import android.net.TrafficStats; import android.net.TrafficStats;
import android.text.TextUtils; import android.text.TextUtils;

View File

@@ -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.content.Context;
import android.net.ConnectivityManager; import android.net.ConnectivityManager;
@@ -12,6 +28,7 @@ import android.util.NtpTrustedTime;
import com.android.internal.annotations.GuardedBy; import com.android.internal.annotations.GuardedBy;
import com.android.internal.annotations.VisibleForTesting; import com.android.internal.annotations.VisibleForTesting;
import com.android.server.location.gnss.ExponentialBackOff;
import java.util.Date; import java.util.Date;

View File

@@ -2068,8 +2068,8 @@ static void android_location_GnssLocationProvider_class_init_native(JNIEnv* env,
class_gnssClock = (jclass) env->NewGlobalRef(gnssClockClass); class_gnssClock = (jclass) env->NewGlobalRef(gnssClockClass);
method_gnssClockCtor = env->GetMethodID(class_gnssClock, "<init>", "()V"); method_gnssClockCtor = env->GetMethodID(class_gnssClock, "<init>", "()V");
jclass gnssConfiguration_halInterfaceVersionClass = jclass gnssConfiguration_halInterfaceVersionClass = env->FindClass(
env->FindClass("com/android/server/location/GnssConfiguration$HalInterfaceVersion"); "com/android/server/location/gnss/GnssConfiguration$HalInterfaceVersion");
class_gnssConfiguration_halInterfaceVersion = class_gnssConfiguration_halInterfaceVersion =
(jclass) env->NewGlobalRef(gnssConfiguration_halInterfaceVersionClass); (jclass) env->NewGlobalRef(gnssConfiguration_halInterfaceVersionClass);
method_halInterfaceVersionCtor = method_halInterfaceVersionCtor =
@@ -3738,39 +3738,29 @@ static const JNINativeMethod sNetworkConnectivityMethods[] = {
}; };
static const JNINativeMethod sConfigurationMethods[] = { static const JNINativeMethod sConfigurationMethods[] = {
/* name, signature, funcPtr */ /* name, signature, funcPtr */
{"native_get_gnss_configuration_version", {"native_get_gnss_configuration_version",
"()Lcom/android/server/location/GnssConfiguration$HalInterfaceVersion;", "()Lcom/android/server/location/gnss/GnssConfiguration$HalInterfaceVersion;",
reinterpret_cast<void *>( reinterpret_cast<void*>(
android_location_GnssConfiguration_get_gnss_configuration_version)}, android_location_GnssConfiguration_get_gnss_configuration_version)},
{"native_set_supl_es", {"native_set_supl_es", "(I)Z",
"(I)Z", reinterpret_cast<void*>(android_location_GnssConfiguration_set_supl_es)},
reinterpret_cast<void *>(android_location_GnssConfiguration_set_supl_es)}, {"native_set_supl_version", "(I)Z",
{"native_set_supl_version", reinterpret_cast<void*>(android_location_GnssConfiguration_set_supl_version)},
"(I)Z", {"native_set_supl_mode", "(I)Z",
reinterpret_cast<void *>(android_location_GnssConfiguration_set_supl_version)}, reinterpret_cast<void*>(android_location_GnssConfiguration_set_supl_mode)},
{"native_set_supl_mode", {"native_set_lpp_profile", "(I)Z",
"(I)Z", reinterpret_cast<void*>(android_location_GnssConfiguration_set_lpp_profile)},
reinterpret_cast<void *>(android_location_GnssConfiguration_set_supl_mode)}, {"native_set_gnss_pos_protocol_select", "(I)Z",
{"native_set_lpp_profile", reinterpret_cast<void*>(android_location_GnssConfiguration_set_gnss_pos_protocol_select)},
"(I)Z", {"native_set_gps_lock", "(I)Z",
reinterpret_cast<void *>(android_location_GnssConfiguration_set_lpp_profile)}, reinterpret_cast<void*>(android_location_GnssConfiguration_set_gps_lock)},
{"native_set_gnss_pos_protocol_select", {"native_set_emergency_supl_pdn", "(I)Z",
"(I)Z", reinterpret_cast<void*>(android_location_GnssConfiguration_set_emergency_supl_pdn)},
reinterpret_cast<void *>( {"native_set_satellite_blacklist", "([I[I)Z",
android_location_GnssConfiguration_set_gnss_pos_protocol_select)}, reinterpret_cast<void*>(android_location_GnssConfiguration_set_satellite_blacklist)},
{"native_set_gps_lock", {"native_set_es_extension_sec", "(I)Z",
"(I)Z", reinterpret_cast<void*>(android_location_GnssConfiguration_set_es_extension_sec)},
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[] = { static const JNINativeMethod sVisibilityControlMethods[] = {
@@ -3782,53 +3772,27 @@ static const JNINativeMethod sVisibilityControlMethods[] = {
}; };
int register_android_server_location_GnssLocationProvider(JNIEnv* env) { 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)); sAntennaInfoMethods, NELEM(sAntennaInfoMethods));
jniRegisterNativeMethods( jniRegisterNativeMethods(env, "com/android/server/location/gnss/GnssBatchingProvider",
env, sMethodsBatching, NELEM(sMethodsBatching));
"com/android/server/location/GnssBatchingProvider", jniRegisterNativeMethods(env, "com/android/server/location/gnss/GnssGeofenceProvider",
sMethodsBatching, sGeofenceMethods, NELEM(sGeofenceMethods));
NELEM(sMethodsBatching)); jniRegisterNativeMethods(env, "com/android/server/location/gnss/GnssMeasurementsProvider",
jniRegisterNativeMethods( sMeasurementMethods, NELEM(sMeasurementMethods));
env, jniRegisterNativeMethods(env,
"com/android/server/location/GnssGeofenceProvider", "com/android/server/location/gnss/GnssMeasurementCorrectionsProvider",
sGeofenceMethods, sMeasurementCorrectionsMethods, NELEM(sMeasurementCorrectionsMethods));
NELEM(sGeofenceMethods)); jniRegisterNativeMethods(env, "com/android/server/location/gnss/GnssNavigationMessageProvider",
jniRegisterNativeMethods( sNavigationMessageMethods, NELEM(sNavigationMessageMethods));
env, jniRegisterNativeMethods(env, "com/android/server/location/gnss/GnssNetworkConnectivityHandler",
"com/android/server/location/GnssMeasurementsProvider", sNetworkConnectivityMethods, NELEM(sNetworkConnectivityMethods));
sMeasurementMethods, jniRegisterNativeMethods(env, "com/android/server/location/gnss/GnssConfiguration",
NELEM(sMeasurementMethods)); sConfigurationMethods, NELEM(sConfigurationMethods));
jniRegisterNativeMethods( jniRegisterNativeMethods(env, "com/android/server/location/gnss/GnssVisibilityControl",
env, sVisibilityControlMethods, NELEM(sVisibilityControlMethods));
"com/android/server/location/GnssMeasurementCorrectionsProvider", return jniRegisterNativeMethods(env, "com/android/server/location/gnss/GnssLocationProvider",
sMeasurementCorrectionsMethods, sMethods, NELEM(sMethods));
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));
} }
} /* namespace android */ } /* namespace android */

View File

@@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package com.android.server.location; package com.android.server.location.gnss;
import static com.google.common.truth.Truth.assertThat; import static com.google.common.truth.Truth.assertThat;
@@ -41,7 +41,8 @@ import org.robolectric.RuntimeEnvironment;
@Presubmit @Presubmit
public class GnssAntennaInfoProviderTest { public class GnssAntennaInfoProviderTest {
@Mock @Mock
private GnssAntennaInfoProvider.GnssAntennaInfoProviderNative mMockNative; private GnssAntennaInfoProvider.GnssAntennaInfoProviderNative
mMockNative;
private GnssAntennaInfoProvider mTestProvider; private GnssAntennaInfoProvider mTestProvider;
/** Setup. */ /** Setup. */

View File

@@ -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; 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 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.Before;
import org.junit.Test; import org.junit.Test;

View File

@@ -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.anyDouble;
import static org.mockito.ArgumentMatchers.anyInt; import static org.mockito.ArgumentMatchers.anyInt;

View File

@@ -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; import static com.google.common.truth.Truth.assertThat;
@@ -26,7 +42,8 @@ import org.robolectric.RuntimeEnvironment;
@Presubmit @Presubmit
public class GnssMeasurementsProviderTest { public class GnssMeasurementsProviderTest {
@Mock @Mock
private GnssMeasurementsProvider.GnssMeasurementProviderNative mMockNative; private GnssMeasurementsProvider.GnssMeasurementProviderNative
mMockNative;
private GnssMeasurementsProvider mTestProvider; private GnssMeasurementsProvider mTestProvider;
@Before @Before

View File

@@ -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; import static com.google.common.truth.Truth.assertThat;
@@ -25,7 +41,8 @@ import org.robolectric.RuntimeEnvironment;
@Presubmit @Presubmit
public class GnssNavigationMessageProviderTest { public class GnssNavigationMessageProviderTest {
@Mock @Mock
private GnssNavigationMessageProvider.GnssNavigationMessageProviderNative mMockNative; private GnssNavigationMessageProvider.GnssNavigationMessageProviderNative
mMockNative;
private GnssNavigationMessageProvider mTestProvider; private GnssNavigationMessageProvider mTestProvider;
@Before @Before

View File

@@ -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; import static com.google.common.truth.Truth.assertThat;

View File

@@ -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; import static com.google.common.truth.Truth.assertThat;
@@ -35,7 +51,8 @@ public class GnssSatelliteBlacklistHelperTest {
private ContentResolver mContentResolver; private ContentResolver mContentResolver;
@Mock @Mock
private GnssSatelliteBlacklistHelper.GnssSatelliteBlacklistCallback mCallback; private GnssSatelliteBlacklistHelper.GnssSatelliteBlacklistCallback
mCallback;
@Before @Before
public void setUp() { public void setUp() {

View File

@@ -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; import static com.google.common.truth.Truth.assertThat;
@@ -10,7 +26,7 @@ import android.os.SystemClock;
import android.platform.test.annotations.Presubmit; import android.platform.test.annotations.Presubmit;
import android.util.NtpTrustedTime; 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.Before;
import org.junit.Test; import org.junit.Test;

View File

@@ -61,17 +61,9 @@ import android.os.RemoteException;
import com.android.server.LocalServices; import com.android.server.LocalServices;
import com.android.server.location.AppForegroundHelper; import com.android.server.location.AppForegroundHelper;
import com.android.server.location.GnssAntennaInfoProvider; import com.android.server.location.gnss.GnssAntennaInfoProvider.GnssAntennaInfoProviderNative;
import com.android.server.location.GnssAntennaInfoProvider.GnssAntennaInfoProviderNative; import com.android.server.location.gnss.GnssMeasurementsProvider.GnssMeasurementProviderNative;
import com.android.server.location.GnssBatchingProvider; import com.android.server.location.gnss.GnssNavigationMessageProvider.GnssNavigationMessageProviderNative;
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.LocationUsageLogger; import com.android.server.location.LocationUsageLogger;
import com.android.server.location.SettingsHelper; import com.android.server.location.SettingsHelper;