Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix : Recording starts even when device not connected. #2295

Merged
merged 4 commits into from
Jan 17, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,16 @@ jobs:
build:

runs-on: ubuntu-latest
strategy:
apoorva-raj marked this conversation as resolved.
Show resolved Hide resolved
matrix:
java-version: [ 11 ]

steps:
- name: Download repository
uses: actions/checkout@v2

- name: Setup Java ${{ matrix.java-version }}
- name: Setup Java
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: ${{ matrix.java-version }}
distribution: 'adopt'
java-version: '11'

- name: Build with Gradle
run: bash ./gradlew build --stacktrace
Expand Down
11 changes: 10 additions & 1 deletion app/src/main/java/io/pslab/activity/AccelerometerActivity.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
package io.pslab.activity;

import android.content.SharedPreferences;
import androidx.fragment.app.Fragment;
import android.hardware.Sensor;
import android.hardware.SensorManager;

import androidx.fragment.app.Fragment;
import androidx.preference.PreferenceManager;

import io.pslab.R;
import io.pslab.fragment.AccelerometerDataFragment;
import io.pslab.fragment.AccelerometerSettingsFragment;
Expand Down Expand Up @@ -102,6 +105,12 @@ public void getDataFromDataLogger() {
}
}

@Override
public boolean sensorNotFound() {
SensorManager sensorManager = (SensorManager) getSystemService(SENSOR_SERVICE);
return sensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER) == null;
}

/**
* Once settings have been changed, those changes can be captured from onResume method.
*/
Expand Down
10 changes: 9 additions & 1 deletion app/src/main/java/io/pslab/activity/BarometerActivity.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package io.pslab.activity;

import android.content.SharedPreferences;
import androidx.fragment.app.Fragment;
import android.hardware.Sensor;
import android.hardware.SensorManager;

import androidx.fragment.app.Fragment;
import androidx.preference.PreferenceManager;

import io.pslab.R;
Expand Down Expand Up @@ -105,6 +107,12 @@ public void getDataFromDataLogger() {
}
}

@Override
public boolean sensorNotFound() {
SensorManager sensorManager = (SensorManager) getSystemService(SENSOR_SERVICE);
return sensorManager.getDefaultSensor(Sensor.TYPE_PRESSURE) == null;
}

@Override
protected void onResume() {
super.onResume();
Expand Down
10 changes: 9 additions & 1 deletion app/src/main/java/io/pslab/activity/CompassActivity.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package io.pslab.activity;

import android.content.SharedPreferences;
import androidx.fragment.app.Fragment;
import android.hardware.Sensor;
import android.hardware.SensorManager;

import androidx.fragment.app.Fragment;
import androidx.preference.PreferenceManager;

import io.pslab.R;
Expand Down Expand Up @@ -101,6 +103,12 @@ public void getDataFromDataLogger() {
}
}

@Override
public boolean sensorNotFound() {
SensorManager sensorManager = (SensorManager) getSystemService(SENSOR_SERVICE);
return sensorManager.getDefaultSensor(Sensor.TYPE_ORIENTATION) == null;
}

@Override
protected void onResume() {
super.onResume();
Expand Down
7 changes: 6 additions & 1 deletion app/src/main/java/io/pslab/activity/DustSensorActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import androidx.fragment.app.Fragment;

import androidx.fragment.app.Fragment;

import io.pslab.R;
import io.pslab.fragment.DustSensorDataFragment;
Expand Down Expand Up @@ -133,4 +133,9 @@ public void getDataFromDataLogger() {
getSupportActionBar().setTitle(title);
}
}

@Override
public boolean sensorNotFound() {
return true;
}
}
6 changes: 5 additions & 1 deletion app/src/main/java/io/pslab/activity/GasSensorActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import android.content.SharedPreferences;
import androidx.fragment.app.Fragment;


import io.pslab.R;
import io.pslab.fragment.GasSensorDataFragment;
import io.pslab.models.GasSensorData;
Expand Down Expand Up @@ -98,4 +97,9 @@ public void getDataFromDataLogger() {
getSupportActionBar().setTitle(title);
}
}

@Override
public boolean sensorNotFound() {
return true;
}
}
10 changes: 9 additions & 1 deletion app/src/main/java/io/pslab/activity/GyroscopeActivity.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package io.pslab.activity;

import android.content.SharedPreferences;
import androidx.fragment.app.Fragment;
import android.hardware.Sensor;
import android.hardware.SensorManager;

import androidx.fragment.app.Fragment;
import androidx.preference.PreferenceManager;

import io.pslab.R;
Expand Down Expand Up @@ -101,6 +103,12 @@ public void getDataFromDataLogger() {
}
}

@Override
public boolean sensorNotFound() {
SensorManager sensorManager = (SensorManager) getSystemService(SENSOR_SERVICE);
return sensorManager.getDefaultSensor(Sensor.TYPE_GYROSCOPE) == null;
}

@Override
protected void onResume() {
super.onResume();
Expand Down
10 changes: 9 additions & 1 deletion app/src/main/java/io/pslab/activity/LuxMeterActivity.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package io.pslab.activity;

import android.content.SharedPreferences;
import androidx.fragment.app.Fragment;
import android.hardware.Sensor;
import android.hardware.SensorManager;

import androidx.fragment.app.Fragment;
import androidx.preference.PreferenceManager;

import io.pslab.R;
Expand Down Expand Up @@ -102,6 +104,12 @@ public void getDataFromDataLogger() {
}
}

@Override
public boolean sensorNotFound() {
SensorManager sensorManager = (SensorManager) getSystemService(SENSOR_SERVICE);
return sensorManager.getDefaultSensor(Sensor.TYPE_LIGHT) == null;
}

/**
* Once settings have been changed, those changes can be captured from onResume method.
* reinstateConfigurations() will update the logs with new settings
Expand Down
Loading