Merge changes from topic "step_event_permission" into qt-dev
* changes: Update Step Detector and Step Counter docstring Add support for retrieving targetSdkVersion
This commit is contained in:
committed by
Android (Google) Code Review
commit
76d9f44133
@@ -364,6 +364,8 @@ public final class Sensor {
|
||||
* count steps if it is not activated. This sensor is ideal for fitness tracking applications.
|
||||
* It is defined as an {@link Sensor#REPORTING_MODE_ON_CHANGE} sensor.
|
||||
* <p>
|
||||
* This sensor requires permission {@code android.permission.ACTIVITY_RECOGNITION}.
|
||||
* <p>
|
||||
* See {@link android.hardware.SensorEvent#values SensorEvent.values} for more details.
|
||||
*/
|
||||
public static final int TYPE_STEP_COUNTER = 19;
|
||||
@@ -382,6 +384,8 @@ public final class Sensor {
|
||||
* gyroscope. This sensor uses lower power than the other rotation vectors, because it doesn't
|
||||
* use the gyroscope. However, it is more noisy and will work best outdoors.
|
||||
* <p>
|
||||
* This sensor requires permission {@code android.permission.ACTIVITY_RECOGNITION}.
|
||||
* <p>
|
||||
* See {@link android.hardware.SensorEvent#values SensorEvent.values} for more details.
|
||||
*/
|
||||
public static final int TYPE_GEOMAGNETIC_ROTATION_VECTOR = 20;
|
||||
|
||||
@@ -23936,6 +23936,18 @@ public class PackageManagerService extends IPackageManager.Stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTargetSdkVersionForPackage(String packageName)
|
||||
throws RemoteException {
|
||||
int callingUser = UserHandle.getUserId(Binder.getCallingUid());
|
||||
ApplicationInfo info = getApplicationInfo(packageName, 0, callingUser);
|
||||
if (info == null) {
|
||||
throw new RemoteException(
|
||||
"Couldn't get ApplicationInfo for package " + packageName);
|
||||
}
|
||||
return info.targetSdkVersion;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean[] isAudioPlaybackCaptureAllowed(String[] packageNames)
|
||||
throws RemoteException {
|
||||
|
||||
Reference in New Issue
Block a user