am 0d07846f: Merge "Use LOCATION_HARDWARE permission for data injection." into mnc-dev
* commit '0d07846f0f111bc7afa5a153aa67a12022263a38': Use LOCATION_HARDWARE permission for data injection.
This commit is contained in:
@@ -1577,7 +1577,7 @@ public abstract class SensorManager {
|
||||
* Significant Motion, Step Counter etc.
|
||||
*
|
||||
* The tests which call this API need to have {@code
|
||||
* android.permission.HARDWARE_TEST} permission which isn't
|
||||
* android.permission.LOCATION_HADWARE} permission which isn't
|
||||
* available for third party applications.
|
||||
*
|
||||
* @param enable True to set the HAL in DATA_INJECTION mode.
|
||||
@@ -1607,7 +1607,7 @@ public abstract class SensorManager {
|
||||
* the HAL is already in data injection mode.
|
||||
*
|
||||
* The tests which call this API need to have {@code
|
||||
* android.permission.HARDWARE_TEST} permission which isn't
|
||||
* android.permission.LOCATION_HARDWARE} permission which isn't
|
||||
* available for third party applications.
|
||||
*
|
||||
* @param sensor The sensor to inject.
|
||||
|
||||
@@ -80,7 +80,7 @@ public class SystemSensorManager extends SensorManager {
|
||||
nativeClassInit();
|
||||
}
|
||||
mHasDataInjectionPermissions = context.checkSelfPermission(
|
||||
Manifest.permission.HARDWARE_TEST) == PackageManager.PERMISSION_GRANTED;
|
||||
Manifest.permission.LOCATION_HARDWARE) == PackageManager.PERMISSION_GRANTED;
|
||||
}
|
||||
|
||||
// initialize the sensor list
|
||||
@@ -233,7 +233,7 @@ public class SystemSensorManager extends SensorManager {
|
||||
protected boolean enableDataInjectionImpl(boolean enable) {
|
||||
if (!mHasDataInjectionPermissions) {
|
||||
throw new SecurityException("Permission denial. Calling enableDataInjection without "
|
||||
+ Manifest.permission.HARDWARE_TEST);
|
||||
+ Manifest.permission.LOCATION_HARDWARE);
|
||||
}
|
||||
synchronized (mLock) {
|
||||
int ret = nativeEnableDataInjection(mNativeInstance, enable);
|
||||
@@ -256,7 +256,7 @@ public class SystemSensorManager extends SensorManager {
|
||||
long timestamp) {
|
||||
if (!mHasDataInjectionPermissions) {
|
||||
throw new SecurityException("Permission denial. Calling injectSensorData without "
|
||||
+ Manifest.permission.HARDWARE_TEST);
|
||||
+ Manifest.permission.LOCATION_HARDWARE);
|
||||
}
|
||||
synchronized (mLock) {
|
||||
if (!mDataInjectionMode) {
|
||||
|
||||
Reference in New Issue
Block a user