fix lint error: Criteria.ACCURACY_FINE lint error on Android 12

This commit is contained in:
ZCShou 2022-06-17 15:26:24 +08:00
parent ca554c998d
commit 82b41447d1
No known key found for this signature in database
GPG Key ID: 1011EBCEDDDEB03A
2 changed files with 8 additions and 1 deletions

View File

@ -1,5 +1,6 @@
package com.zcshou.service;
import android.annotation.SuppressLint;
import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
@ -203,6 +204,8 @@ public class ServiceGo extends Service {
}
}
// 注意下面临时添加 @SuppressLint("wrongconstant") 以处理 addTestProvider 参数值的 lint 错误
@SuppressLint("wrongconstant")
private void addTestProviderGPS() {
try {
// 注意由于 android api 问题下面的参数会提示错误(以下参数是通过相关API获取的真实GPS参数不是随便写的)
@ -254,6 +257,8 @@ public class ServiceGo extends Service {
}
}
// 注意下面临时添加 @SuppressLint("wrongconstant") 以处理 addTestProvider 参数值的 lint 错误
@SuppressLint("wrongconstant")
private void addTestProviderNetwork() {
try {
// 注意由于 android api 问题下面的参数会提示错误(以下参数是通过相关API获取的真实NETWORK参数不是随便写的)

View File

@ -1,5 +1,6 @@
package com.zcshou.utils;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ApplicationInfo;
@ -77,7 +78,8 @@ public class GoUtils {
return locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER);
}
// 判断是否已在开发者选项中开启模拟位置权限
// 判断是否已在开发者选项中开启模拟位置权限注意下面临时添加 @SuppressLint("wrongconstant") 以处理 addTestProvider 参数值的 lint 错误
@SuppressLint("wrongconstant")
public static boolean isAllowMockLocation(Context context) {
boolean canMockPosition = false;
int index;