Android要点:过多的Wi-Fi扫描(后台),每小时进行0次Wi-Fi扫描

时间:2019-04-03 19:17:25

标签: android location

在Google Play控制台的Android vitals概述中,我收到一条有关“ Wi-Fi扫描过多(背景)”的消息:

enter image description here

但是详细视图显示,对于所有受影响的会话,每小时的Wi-Fi扫描次数均为0:

enter image description here

从我的研究中,我发现它可能与位置有关,但是我的间隔似乎是合理的:


 sampleModule = {
      "xsd":"https://ibm.com/daas/module/1.0/module.xsd",
      "source": {
        "id": "StringID",
        "srcUrl": {
 "sourceUrl": 'https://developer.ibm.com/static/site-id/141/ddeCSVSample.csv',
          "mimeType": "text/csv",
          "property": [
            {
              "name": "headers",
              "value": [
                {
                  "name": "x-header-1",
                  "value": "someheadervalue"
                },
                {
                  "name": "x-header-2",
                  "value": "someotherheadervalue"
                }
              ]
            }
          ]
        }
      },
      "table": {
        "name": "TableName",
        "column": [
          {
            "datatype": "BIGINT",
            "nullable": true,
            "name": "Year_",
            "description": "Year",
            "label": "Year",
            "usage": "attribute",
            "regularAggregate": "none",
            "taxonomyFamily": "cYear"
          },
          {
            "datatype": "NVARCHAR(20)",
            "nullable": true,
            "name": "Product_type",
            "description": "Product type",
            "label": "Product type",
            "usage": "attribute",
            "regularAggregate": "none"
          },
          {
            "datatype": "NVARCHAR(17)",
            "nullable": true,
            "name": "Order_method_type",
            "description": "Order method type",
            "label": "Order method type",
            "usage": "attribute",
            "regularAggregate": "none"
          },
          {
            "name": "Retailer_country",
            "datatype": "NVARCHAR(16)",
            "nullable": true,
            "description": "Retailer country",
            "label": "Retailer country",
            "usage": "attribute",
            "regularAggregate": "none",
            "taxonomyFamily": "cCountry"
          },
          {
            "datatype": "DOUBLE",
            "nullable": true,
            "name": "Revenue",
            "description": "Revenue",
            "label": "Revenue",
            "usage": "fact",
            "regularAggregate": "total"
          },
          {
            "datatype": "DECIMAL(38, 0)",
            "nullable": true,
            "name": "Quantity",
            "description": "Quantity",
            "label": "Quantity",
            "usage": "fact",
            "regularAggregate": "total"
          }
        ]
      },
      "label": "Module Name",
      "identifier": "moduleId"
    }

我请求位置在简历上对其进行更新:

// Set Up a Location Request
locationRequest = LocationRequest.create();
locationRequest.setInterval(1000 * 60 * 30);
locationRequest.setFastestInterval(1000 * 60 * 5);
locationRequest.setPriority(LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY);

但是一旦暂停活动,就始终停止位置扫描:

@Override
protected void onResume()
{
    super.onResume();
    fusedLocationClient.requestLocationUpdates(locationRequest, locationCallback, null /* Looper */);
    ...

我的清单具有以下权限和功能:

@Override
public void onPause()
{
    super.onPause();
    fusedLocationClient.removeLocationUpdates(locationCallback);
    ...

该位置相关吗?我需要做其他任何事情来在后台停止位置请求吗?

0 个答案:

没有答案