Wear: remove tile debug log

This commit is contained in:
Andries Smit 2022-01-13 11:16:26 +01:00
parent ee27b07377
commit ad95626619
3 changed files with 3 additions and 21 deletions

View file

@ -558,15 +558,4 @@
<item quantity="other">%1$d minutes</item>
</plurals>
<!-- WEAR OS-->
<string name="wear_action_tempt_preset_error">Temptarget unknown preset: %1$s</string>
<string name="wear_action_tempt_cancel_message">Cancelling running Temp-Targets?</string>
<string name="wear_action_tempt_unit_error">Different units used on watch and phone!</string>
<string name="wear_action_tempt_zero_message">Zero-Temp-Target - cancelling running Temp-Targets?</string>
<string name="wear_action_tempt_min_bg_error">Min-BG out of range!</string>
<string name="wear_action_tempt_max_bg_error">Max-BG out of range!</string>
<string name="wear_action_tempt_manual_range_message">Temptarget:\nMin: %1$s\nMax: %2$s\nDuration: %3$s</string>
<string name="wear_action_tempt_manual_message">Temptarget:\nTarget: %1$s\nDuration: %2$s</string>
<string name="wear_action_tempt_preset_message">Temptarget:\Reason: %1$s\nTarget: %2$s\nDuration: %3$s</string>
</resources>

View file

@ -4,7 +4,6 @@ import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.wearable.view.GridPagerAdapter;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@ -48,7 +47,6 @@ public class TempTargetActivity extends ViewSelectorActivity {
String actionString = extras.getString("actionString", "");
boolean inBackground = extras.getBoolean("inBackground", false);
if (inBackground) {
Log.i("ASTAG", "TempTargetActivity.onCreate: " + actionString);
ListenerService.initiateAction(this, actionString);
confirmAction(this, R.string.action_tempt_confirmation);
finishAffinity();

View file

@ -1,6 +1,5 @@
package info.nightscout.androidaps.tile
import android.util.Log
import android.content.SharedPreferences
import androidx.annotation.DrawableRes
import androidx.annotation.StringRes
@ -80,7 +79,6 @@ abstract class TileBase : TileService() {
override fun onTileRequest(
requestParams: RequestBuilders.TileRequest
): ListenableFuture<Tile> = serviceScope.future {
Log.i(TAG, "onTileRequest: ")
val actionsSelected = getSelectedActions()
val wearControl = getWearControl()
@ -99,7 +97,6 @@ abstract class TileBase : TileService() {
override fun onResourcesRequest(
requestParams: ResourcesRequest
): ListenableFuture<Resources> = serviceScope.future {
Log.i(TAG, "onResourcesRequest: ")
Resources.Builder()
.setVersion(resourceVersion)
.apply {
@ -232,7 +229,9 @@ abstract class TileBase : TileService() {
private fun getWearControl(): WearControl {
val sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this)
if (!sharedPrefs.contains("wearcontrol")) return WearControl.NO_DATA;
if (!sharedPrefs.contains("wearcontrol")) {
return WearControl.NO_DATA
}
val wearControlPref = sharedPrefs.getBoolean("wearcontrol", false)
if (wearControlPref) {
return WearControl.ENABLED
@ -251,9 +250,7 @@ abstract class TileBase : TileService() {
actionList.add(action)
}
}
Log.i(TAG, this::class.java.name + ".getSelectedActions: " + actionList.size + " " + actionList.toString())
if (actionList.isEmpty()) {
Log.i(TAG, "getSelectedActions: default")
return source.getActions().take(4)
}
return actionList
@ -268,10 +265,8 @@ abstract class TileBase : TileService() {
val defaults = source.getDefaultConfig()
val firstKey = defaults.firstNotNullOf { settings -> settings.key }
if (!sharedPrefs.contains(firstKey)) {
Log.i(TAG, "setDefaultSettings: set defaults")
val editor = sharedPrefs.edit()
for ((key, value) in defaults) {
// println("$key = $value")
editor.putString(key, value)
}
editor.apply()