Android STEP_COUNTER sensor is null (Samsung Z Flip)

151 Views Asked by At

I am currently developing a Application to track Steps.

In order to track steps i am using the following Sensor of the phone: Sensor.TYPE_STEP_COUNTER

This worked fine for all devices I tested it with. But, it started to fail after updating "ONE UI" and "ANDROID 13" for the phone(SM-F711N) that worked well.

Phone has FEATURE_SENSOR_STEP_COUNTER but default sensor is null What is Problem? Does anyone know the solution to this problem?

Here's my logging code and result

Log.e("test","hasSystemFeature - SENSOR-STEP-COUNTER" + packageManager.hasSystemFeature(PackageManager.FEATURE_SENSOR_STEP_COUNTER));

Log.e("test","step sensor list: ${mSensorManager.getSensorList(Sensor.TYPE_STEP_COUNTER)}")
Log.e("test", "step counter default sensor: ${mSensorManager.getDefaultSensor(Sensor.TYPE_STEP_COUNTER)}" )

enter image description here

0

There are 0 best solutions below