V3.1.7 - Added mute function from Garmin Data Source watch buttons.
This commit is contained in:
@@ -105,6 +105,7 @@ public class SdDataSourceGarmin extends SdDataSource {
|
||||
private short mFallThreshMin;
|
||||
private short mFallThreshMax;
|
||||
private short mFallWindow;
|
||||
private int mMute; // !=0 means muted by keypress on watch.
|
||||
|
||||
private int mAlarmCount;
|
||||
|
||||
@@ -376,6 +377,12 @@ public class SdDataSourceGarmin extends SdDataSource {
|
||||
// if we get 'null' HR (For example if the heart rate is not working)
|
||||
mSdData.mHR = -1;
|
||||
}
|
||||
try {
|
||||
mMute = dataObject.getInt("Mute");
|
||||
} catch (JSONException e) {
|
||||
// if we get 'null' HR (For example if the heart rate is not working)
|
||||
mMute = 0;
|
||||
}
|
||||
JSONArray accelVals = dataObject.getJSONArray("data");
|
||||
Log.v(TAG, "Received " + accelVals.length() + " acceleration values");
|
||||
int i;
|
||||
@@ -539,6 +546,10 @@ public class SdDataSourceGarmin extends SdDataSource {
|
||||
mSdData.fallAlarmStanding = true;
|
||||
return;
|
||||
}
|
||||
if (mMute != 0) {
|
||||
Log.v(TAG,"Mute Active - setting fall alarm to mute");
|
||||
mSdData.fallAlarmStanding = false;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
mSdData.mFallActive = false;
|
||||
@@ -647,6 +658,7 @@ public class SdDataSourceGarmin extends SdDataSource {
|
||||
mAlarmCount = 0;
|
||||
}
|
||||
}
|
||||
|
||||
Log.v(TAG, "inAlarm=" + inAlarm + ", alarmState = " + mSdData.alarmState + " alarmCount=" + mAlarmCount + " mAlarmTime=" + mAlarmTime);
|
||||
|
||||
/* Check Heart Rate against alarm settings */
|
||||
@@ -659,6 +671,12 @@ public class SdDataSourceGarmin extends SdDataSource {
|
||||
mSdData.mHRAlarmStanding = false;
|
||||
}
|
||||
}
|
||||
if (mMute != 0) {
|
||||
Log.v(TAG,"Mute Active - setting alarms to mute");
|
||||
mSdData.alarmState = 6;
|
||||
mSdData.alarmPhrase = "MUTE";
|
||||
mSdData.mHRAlarmStanding = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -767,14 +767,7 @@ public class SdServer extends Service implements SdDataReceiver {
|
||||
}
|
||||
} else {
|
||||
Log.i(TAG, "sendSMSAlarm() - Cancel Audible Active - not sending SMS");
|
||||
<<<<<<< HEAD
|
||||
mUtil.showToast("Cancel Audible Active - not sending SMS");
|
||||
=======
|
||||
Toast toast = Toast.makeText(getApplicationContext(),
|
||||
"Cancel Audible Active - not sending SMS",
|
||||
Toast.LENGTH_SHORT);
|
||||
toast.show();
|
||||
>>>>>>> 6c31fa8aea6a9815f626c17dd29b721c88e9a8c2
|
||||
}
|
||||
} else {
|
||||
Log.i(TAG, "sendSMSAlarm() - SMS Alarms Disabled - not doing anything!");
|
||||
|
||||
Reference in New Issue
Block a user