家长使用功能 android.hardware.location

Parent uses-feature android.hardware.location

在 AndroidManifest.xml 中使用父功能(对于 uses-feature 标记)是否与所有启用的子功能相同?

比如是下面的块

<uses-feature android:name="android.hardware.location" android:required="false" />

等于

<uses-feature android:name="android.hardware.location.gps" android:required="false" />
<uses-feature android:name="android.hardware.location.network" android:required="false" />

Does the usage of parent feature (for uses-feature tag) in AndroidManifest.xml mean the same as all enabled child features?

没有。您显示的 2 个块不相等。然而,情况恰恰相反:如果您声明 android.hardware.location.gps,则自动暗示您也声明了 android.hardware.location

有关详细信息,请参阅 the documentation。我复制了相关部分并用粗体强调:

android.hardware.location
The app uses one or more features on the device for determining location, such as GPS location, network location, or cell location.


android.hardware.location.gps
The app uses precise location coordinates obtained from a Global Positioning System (GPS) receiver on the device.

By using this feature, an app implies that it also uses the android.hardware.location feature, unless this parent feature is declared with the attribute android:required="false".


android.hardware.location.network
The app uses coarse location coordinates obtained from a network-based geolocation system supported on the device.

By using this feature, an app implies that it also uses the android.hardware.location feature, unless this parent feature is declared with the attribute android:required="false".