Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8cc759a5 authored by Aravind Akella's avatar Aravind Akella Committed by Android Git Automerger
Browse files

am adaa79d7: Merge "Remove flag mDataInjectionMode." into mnc-dev

* commit 'adaa79d7':
  Remove flag mDataInjectionMode.
parents ef024af4 adaa79d7
Loading
Loading
Loading
Loading
+1 −4
Original line number Original line Diff line number Diff line
@@ -47,7 +47,6 @@ public class SystemSensorManager extends SensorManager {


    private static boolean sSensorModuleInitialized = false;
    private static boolean sSensorModuleInitialized = false;
    private static InjectEventQueue mInjectEventQueue = null;
    private static InjectEventQueue mInjectEventQueue = null;
    private static boolean mDataInjectionMode = false;


    private final Object mLock = new Object();
    private final Object mLock = new Object();


@@ -235,7 +234,6 @@ public class SystemSensorManager extends SensorManager {
                    Log.e(TAG, "Data Injection mode not enabled");
                    Log.e(TAG, "Data Injection mode not enabled");
                    return false;
                    return false;
                }
                }
                mDataInjectionMode = true;
                // Initialize a client for data_injection.
                // Initialize a client for data_injection.
                if (mInjectEventQueue == null) {
                if (mInjectEventQueue == null) {
                    mInjectEventQueue = new InjectEventQueue(mMainLooper, this);
                    mInjectEventQueue = new InjectEventQueue(mMainLooper, this);
@@ -254,7 +252,7 @@ public class SystemSensorManager extends SensorManager {
    protected boolean injectSensorDataImpl(Sensor sensor, float[] values, int accuracy,
    protected boolean injectSensorDataImpl(Sensor sensor, float[] values, int accuracy,
            long timestamp) {
            long timestamp) {
        synchronized (mLock) {
        synchronized (mLock) {
            if (!mDataInjectionMode) {
            if (mInjectEventQueue == null) {
                Log.e(TAG, "Data injection mode not activated before calling injectSensorData");
                Log.e(TAG, "Data injection mode not activated before calling injectSensorData");
                return false;
                return false;
            }
            }
@@ -264,7 +262,6 @@ public class SystemSensorManager extends SensorManager {
            if (ret != 0) {
            if (ret != 0) {
                mInjectEventQueue.dispose();
                mInjectEventQueue.dispose();
                mInjectEventQueue = null;
                mInjectEventQueue = null;
                mDataInjectionMode = false;
            }
            }
            return ret == 0;
            return ret == 0;
        }
        }