mirror of
https://github.com/ZCShou/GoGoGo.git
synced 2026-06-05 21:00:50 +08:00
fix lint error: Criteria.ACCURACY_FINE lint error on Android 12
This commit is contained in:
parent
ca554c998d
commit
82b41447d1
@ -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参数,不是随便写的)
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user