安装 android 应用程序时的权限对话框

Permission dialog when installing android app

我正在使用 Unity3d 开发 Android 游戏。 当我使用 Unity 生成 .apk 文件,然后在我的 phone 上安装应用程序时,在安装对话框中显示 "apllication does not require any special permissions"。但是,在我的 android 清单中,我拥有互联网和位置权限。

据我了解,如果 targetSdk > 23,互联网权限将被视为正常权限,因此不会提示权限对话框。但是,一旦我启动应用程序,它就会要求访问设备位置。这对我来说很好,我认为这是它应该工作的方式。

我的问题是:为什么安装对话框声明该应用程序不需要任何特殊权限?难道不应该至少在安装对话框中说明位置权限吗?

我的清单如下所示:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.DiogoMelo.Exergame" android:versionName="1.0" android:versionCode="1" android:installLocation="preferExternal">
  <application android:icon="@drawable/app_icon" android:label="@string/app_name" android:isGame="true" android:banner="@drawable/app_banner">
    <activity android:name="com.yusufolokoba.pedometer.PedometerActivity" android:label="@string/app_name" android:screenOrientation="sensorLandscape" android:launchMode="singleTask" android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale|layoutDirection|density">
      <meta-data android:name="unityplayer.UnityActivity" android:value="true" />
      <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
        <category android:name="android.intent.category.LEANBACK_LAUNCHER" />
      </intent-filter>
    </activity>
    <meta-data android:name="unity.build-id" android:value="fe7aacd9-9aed-4446-a3d2-45a1f1474bda" />
    <meta-data android:name="unity.splash-mode" android:value="0" />
    <meta-data android:name="unity.splash-enable" android:value="True" />
    <meta-data android:name="android.max_aspect" android:value="2.1" />
  </application>
  <uses-sdk android:minSdkVersion="16" android:targetSdkVersion="25" />
  <uses-feature android:glEsVersion="0x00020000" />
  <uses-permission android:name="android.permission.INTERNET" />
  <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
  <uses-feature android:name="android.hardware.location.gps" android:required="false" />
  <uses-feature android:name="android.hardware.location" android:required="false" />
  <uses-feature android:name="android.hardware.touchscreen" android:required="false" />
  <uses-feature android:name="android.hardware.touchscreen.multitouch" android:required="false" />
  <uses-feature android:name="android.hardware.touchscreen.multitouch.distinct" android:required="false" />
</manifest>

权限在 android sdk 23 中发生了重大变化,之前必须在安装时授予所有权限。自 23 起,权限仅在运行时请求,理想情况下仅在需要时请求。对于 Unity,我认为权限总是在第一次启动时直接被询问,以使事情变得更容易。

我终于有时间在 phone 运行 Android 5.1 上进行测试,安装对话框显示了所需的权限。所以没有问题,只是取决于运行的android版本。