Browse Source

removed Log.d calls

yattoz 4 years ago
parent
commit
06c5b4dd1b

+ 4 - 4
app/src/main/java/fr/forum_thalie/tsumugi/Async.kt View File

@@ -13,7 +13,7 @@ class Async(val handler: (Any?) -> Any?, val post: (Any?) -> Unit = {},
13 13
             execute()
14 14
         } catch (e: Exception)
15 15
         {
16
-            Log.d(tag,e.toString())
16
+            //[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag,e.toString())
17 17
         }
18 18
     }
19 19
 
@@ -46,14 +46,14 @@ class Async(val handler: (Any?) -> Any?, val post: (Any?) -> Unit = {},
46 46
         }
47 47
 
48 48
 
49
-        Log.d(tag, "fallback for no network. Store reset : $storeReset")
49
+        //[REMOVE LOG CALLS]Log.d(tag, "fallback for no network. Store reset : $storeReset")
50 50
     }
51 51
 
52 52
     override fun doInBackground(vararg params: Any?): Any? {
53 53
         try {
54 54
             return handler(parameters)
55 55
         } catch (e: Exception) {
56
-            Log.d(tag,e.toString())
56
+            //[REMOVE LOG CALLS]Log.d(tag,e.toString())
57 57
             onException(e)
58 58
         }
59 59
         return null
@@ -63,7 +63,7 @@ class Async(val handler: (Any?) -> Any?, val post: (Any?) -> Unit = {},
63 63
         try {
64 64
             post(result)
65 65
         } catch (e: Exception) {
66
-            Log.d(tag,e.toString())
66
+            //[REMOVE LOG CALLS]Log.d(tag,e.toString())
67 67
             onException(e)
68 68
         }
69 69
     }

+ 3 - 3
app/src/main/java/fr/forum_thalie/tsumugi/BaseActivity.kt View File

@@ -21,7 +21,7 @@ abstract class BaseActivity : AppCompatActivity() {
21 21
         val height =  ((rootLayout?.height ?: 0))
22 22
         val width =  ((rootLayout?.width ?: 0))
23 23
 
24
-        Log.d(tag, "$viewWidth, $viewHeight, $width, $height, ${viewHeight.toDouble()/viewWidth.toDouble()}, ${height.toDouble()/width.toDouble()}")
24
+        //[REMOVE LOG CALLS]Log.d(tag, "$viewWidth, $viewHeight, $width, $height, ${viewHeight.toDouble()/viewWidth.toDouble()}, ${height.toDouble()/width.toDouble()}")
25 25
 
26 26
         val broadcastManager = LocalBroadcastManager.getInstance(this@BaseActivity)
27 27
         if(height <= viewHeight * 2 / 3 /*height.toDouble()/width.toDouble() < 1.20 */){
@@ -49,14 +49,14 @@ abstract class BaseActivity : AppCompatActivity() {
49 49
         // do things when keyboard is shown
50 50
         val bottomNavigationView = findViewById<BottomNavigationView>(R.id.bottom_nav)
51 51
         bottomNavigationView.visibility = View.GONE
52
-        Log.d(tag, "bottomNav visibility set to GONE (height $keyboardHeight)")
52
+        //[REMOVE LOG CALLS]Log.d(tag, "bottomNav visibility set to GONE (height $keyboardHeight)")
53 53
     }
54 54
 
55 55
      private fun onHideKeyboard() {
56 56
         // do things when keyboard is hidden
57 57
         val bottomNavigationView = findViewById<BottomNavigationView>(R.id.bottom_nav)
58 58
         bottomNavigationView.visibility = View.VISIBLE
59
-        Log.d(tag, "bottomNav visibility set to VISIBLE")
59
+        //[REMOVE LOG CALLS]Log.d(tag, "bottomNav visibility set to VISIBLE")
60 60
     }
61 61
 
62 62
     protected fun attachKeyboardListeners() {

+ 1 - 1
app/src/main/java/fr/forum_thalie/tsumugi/BootBroadcastReceiver.kt View File

@@ -12,7 +12,7 @@ import fr.forum_thalie.tsumugi.playerstore.PlayerStore
12 12
 class BootBroadcastReceiver : BroadcastReceiver(){
13 13
 
14 14
     override fun onReceive(context: Context, arg1: Intent) {
15
-        Log.d(tag, "Broadcast Receiver received $arg1")
15
+        //[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag, "Broadcast Receiver received $arg1")
16 16
         // define preferenceStore for places of the program that needs to access Preferences without a context
17 17
         preferenceStore = PreferenceManager.getDefaultSharedPreferences(context)
18 18
 

+ 6 - 6
app/src/main/java/fr/forum_thalie/tsumugi/MainActivity.kt View File

@@ -132,7 +132,7 @@ class MainActivity : BaseActivity() {
132 132
         // Post-UI Launch
133 133
         if (PlayerStore.instance.isInitialized)
134 134
         {
135
-            Log.d(tag, "skipped initialization")
135
+            //[REMOVE LOG CALLS]Log.d(tag, "skipped initialization")
136 136
         } else {
137 137
             // if the service is not started, start it in STOP mode.
138 138
             // It's not a dummy action : with STOP mode, the player does not buffer audio (and does not use data connection without the user's consent).
@@ -193,7 +193,7 @@ class MainActivity : BaseActivity() {
193 193
             val i = Intent(this, RadioService::class.java)
194 194
             i.putExtra("action", a.name)
195 195
             i.putExtra("value", v)
196
-            Log.d(tag, "Sending intent ${a.name}")
196
+            //[REMOVE LOG CALLS]Log.d(tag, "Sending intent ${a.name}")
197 197
             startService(i)
198 198
     }
199 199
 
@@ -238,7 +238,7 @@ class MainActivity : BaseActivity() {
238 238
                 // File(getExternalFilesDir(Environment.DIRECTORY_DOCUMENTS) + "/MyPersonalAppFolder")
239 239
                 val logDirectory = File("$appDirectory/log")
240 240
                 val logFile = File(logDirectory, "logcat" + System.currentTimeMillis() + ".txt")
241
-                Log.d(
241
+                //[REMOVE LOG CALLS]Log.d(
242 242
                     tag,
243 243
                     "appDirectory : $appDirectory, logDirectory : $logDirectory, logFile : $logFile"
244 244
                 )
@@ -246,20 +246,20 @@ class MainActivity : BaseActivity() {
246 246
                 // create app folder
247 247
                 if (!appDirectory.exists()) {
248 248
                     appDirectory.mkdir()
249
-                    Log.d(tag, "$appDirectory created")
249
+                    //[REMOVE LOG CALLS]Log.d(tag, "$appDirectory created")
250 250
                 }
251 251
 
252 252
                 // create log folder
253 253
                 if (!logDirectory.exists()) {
254 254
                     logDirectory.mkdir()
255
-                    Log.d(tag, "$logDirectory created")
255
+                    //[REMOVE LOG CALLS]Log.d(tag, "$logDirectory created")
256 256
                 }
257 257
 
258 258
                 // clear the previous logcat and then write the new one to the file
259 259
                 try {
260 260
                     Runtime.getRuntime().exec("logcat -c")
261 261
                     Runtime.getRuntime().exec("logcat -v time -f $logFile *:E $tag:V ")
262
-                    Log.d(tag, "logcat started")
262
+                    //[REMOVE LOG CALLS]Log.d(tag, "logcat started")
263 263
                 } catch (e: IOException) {
264 264
                     e.printStackTrace()
265 265
                 }

+ 14 - 14
app/src/main/java/fr/forum_thalie/tsumugi/RadioService.kt View File

@@ -68,14 +68,14 @@ class RadioService : MediaBrowserServiceCompat() {
68 68
                 // This *should* work in any case...
69 69
                 when (intent.getIntExtra("state", -1)) {
70 70
                 0 -> {
71
-                    Log.d(tag, radioTag + "Headset is unplugged")
71
+                    //[REMOVE LOG CALLS]Log.d(tag, radioTag + "Headset is unplugged")
72 72
                 }
73 73
                 1 -> {
74
-                    Log.d(tag, radioTag + "Headset is plugged")
74
+                    //[REMOVE LOG CALLS]Log.d(tag, radioTag + "Headset is plugged")
75 75
                     headsetPluggedIn = true
76 76
                 }
77 77
                 else -> {
78
-                    Log.d(tag, radioTag + "I have no idea what the headset state is")
78
+                    //[REMOVE LOG CALLS]Log.d(tag, radioTag + "I have no idea what the headset state is")
79 79
                 }
80 80
                 }
81 81
                 /*
@@ -91,7 +91,7 @@ class RadioService : MediaBrowserServiceCompat() {
91 91
                 }
92 92
                 else
93 93
                 {
94
-                    Log.d(tag, radioTag + "Can't get state?")
94
+                    //[REMOVE LOG CALLS]Log.d(tag, radioTag + "Can't get state?")
95 95
                 }
96 96
 
97 97
                  */
@@ -205,7 +205,7 @@ class RadioService : MediaBrowserServiceCompat() {
205 205
         startForeground(radioServiceId, nowPlayingNotification.notification)
206 206
 
207 207
         PlayerStore.instance.isServiceStarted.value = true
208
-        Log.d(tag, radioTag + "created")
208
+        //[REMOVE LOG CALLS]Log.d(tag, radioTag + "created")
209 209
     }
210 210
 
211 211
     private val handler = Handler()
@@ -246,7 +246,7 @@ class RadioService : MediaBrowserServiceCompat() {
246 246
             Actions.CANCEL_FADE_OUT.name -> { handler.removeCallbacks(lowerVolumeRunnable) }
247 247
             Actions.SNOOZE.name -> { RadioAlarm.instance.snooze(this) }
248 248
         }
249
-        Log.d(tag, radioTag + "intent received : " + intent.getStringExtra("action"))
249
+        //[REMOVE LOG CALLS]Log.d(tag, radioTag + "intent received : " + intent.getStringExtra("action"))
250 250
         super.onStartCommand(intent, flags, startId)
251 251
         // The service must be re-created if it is destroyed by the system. This allows the user to keep actions like Bluetooth and headphones plug available.
252 252
         return START_STICKY
@@ -258,7 +258,7 @@ class RadioService : MediaBrowserServiceCompat() {
258 258
             stopSelf()
259 259
         }
260 260
         super.onTaskRemoved(rootIntent)
261
-        Log.d(tag, radioTag + "task removed")
261
+        //[REMOVE LOG CALLS]Log.d(tag, radioTag + "task removed")
262 262
     }
263 263
 
264 264
     override fun onDestroy() {
@@ -290,7 +290,7 @@ class RadioService : MediaBrowserServiceCompat() {
290 290
         }
291 291
 
292 292
         apiTicker.cancel() // stops the timer.
293
-        Log.d(tag, radioTag + "destroyed")
293
+        //[REMOVE LOG CALLS]Log.d(tag, radioTag + "destroyed")
294 294
         // if the service is destroyed, the application had become useless.
295 295
         exitProcess(0)
296 296
     }
@@ -361,10 +361,10 @@ class RadioService : MediaBrowserServiceCompat() {
361 361
             for (i in 0 until it.length()) {
362 362
                 val entry  = it.get(i)
363 363
                 if (entry is IcyHeaders) {
364
-                    Log.d(tag, radioTag + "onMetadata: IcyHeaders $entry")
364
+                    //[REMOVE LOG CALLS]Log.d(tag, radioTag + "onMetadata: IcyHeaders $entry")
365 365
                 }
366 366
                 if (entry is IcyInfo) {
367
-                    Log.d(tag, radioTag + "onMetadata: Title ----> ${entry.title}")
367
+                    //[REMOVE LOG CALLS]Log.d(tag, radioTag + "onMetadata: Title ----> ${entry.title}")
368 368
                     // Note : Kotlin supports UTF-8 by default.
369 369
                     numberOfSongs++
370 370
                     val data = entry.title!!
@@ -439,7 +439,7 @@ class RadioService : MediaBrowserServiceCompat() {
439 439
             {
440 440
                 Thread.sleep(1000)
441 441
                 i++
442
-                Log.d(tag, "$i, isAlarmStopped=$isAlarmStopped")
442
+                //[REMOVE LOG CALLS]Log.d(tag, "$i, isAlarmStopped=$isAlarmStopped")
443 443
             }
444 444
         }
445 445
         val post: (Any?) -> Unit = {
@@ -512,7 +512,7 @@ class RadioService : MediaBrowserServiceCompat() {
512 512
             SystemClock.elapsedRealtime()
513 513
         )
514 514
         mediaSession.setPlaybackState(playbackStateBuilder.build())
515
-        Log.d(tag, radioTag + "begin playing")
515
+        //[REMOVE LOG CALLS]Log.d(tag, radioTag + "begin playing")
516 516
     }
517 517
 
518 518
     private fun pausePlaying()
@@ -541,7 +541,7 @@ class RadioService : MediaBrowserServiceCompat() {
541 541
             1.0f,
542 542
             SystemClock.elapsedRealtime()
543 543
         )
544
-        Log.d(tag, radioTag + "stopped")
544
+        //[REMOVE LOG CALLS]Log.d(tag, radioTag + "stopped")
545 545
 
546 546
         mediaSession.setPlaybackState(playbackStateBuilder.build())
547 547
     }
@@ -629,7 +629,7 @@ class RadioService : MediaBrowserServiceCompat() {
629 629
                 Player.STATE_ENDED -> state = "Player.STATE_ENDED"
630 630
                 Player.STATE_READY -> state = "Player.STATE_READY"
631 631
             }
632
-            Log.d(tag, radioTag + "Player changed state: ${state}. numberOfSongs reset.")
632
+            //[REMOVE LOG CALLS]Log.d(tag, radioTag + "Player changed state: ${state}. numberOfSongs reset.")
633 633
         }
634 634
     }
635 635
 

+ 1 - 1
app/src/main/java/fr/forum_thalie/tsumugi/alarm/RadioAlarm.kt View File

@@ -97,7 +97,7 @@ class RadioAlarm {
97 97
         calendar.isLenient = true
98 98
         calendar.set(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH), calendar.get(Calendar.DAY_OF_MONTH) + i, hourOfDay, minute)
99 99
 
100
-        Log.d(tag, calendar.toString())
100
+        //[REMOVE LOG CALLS]Log.d(tag, calendar.toString())
101 101
 
102 102
 
103 103
         return calendar.timeInMillis

+ 2 - 2
app/src/main/java/fr/forum_thalie/tsumugi/alarm/RadioSleeper.kt View File

@@ -61,7 +61,7 @@ class RadioSleeper {
61 61
 
62 62
             AlarmManagerCompat.setExactAndAllowWhileIdle(alarmManager, AlarmManager.RTC_WAKEUP, currentMillis + (minutes * 60 * 1000) - (1 * 60 * 1000), fadeOutIntent)
63 63
             sleepAtMillis.value = System.currentTimeMillis() + (minutes * 60 * 1000) - 1 // this -1 allows to round the division for display at the right integer
64
-            Log.d(tag, "set sleep to $minutes minutes")
64
+            //[REMOVE LOG CALLS]Log.d(tag, "set sleep to $minutes minutes")
65 65
         }
66 66
     }
67 67
 
@@ -79,7 +79,7 @@ class RadioSleeper {
79 79
             c.startService(cancelFadeOutIntent)
80 80
         }
81 81
 
82
-        Log.d(tag, "cancelled sleep")
82
+        //[REMOVE LOG CALLS]Log.d(tag, "cancelled sleep")
83 83
         sleepAtMillis.value = null
84 84
     }
85 85
 }

+ 2 - 2
app/src/main/java/fr/forum_thalie/tsumugi/planning/Programme.kt View File

@@ -35,7 +35,7 @@ class Programme (val title: String, private val periodicity: Int, private val ho
35 35
         val isSpanningOverNight =
36 36
             (((0b1000000 shr ((currentDay - 1) % 7) and (periodicity)) != 0) && hourEnd < hourBegin)
37 37
 
38
-        Log.d(tag, "$title is today: $isToday or spanning $isSpanningOverNight")
38
+        //[REMOVE LOG CALLS]Log.d(tag, "$title is today: $isToday or spanning $isSpanningOverNight")
39 39
         // shr = shift-right. It's a binary mask.
40 40
 
41 41
         // if the program started yesterday, and spanned over night, it means that there could be a chance that it's still active.
@@ -87,6 +87,6 @@ class Programme (val title: String, private val periodicity: Int, private val ho
87 87
      */
88 88
 
89 89
     init {
90
-        Log.d(tag, this.toString())
90
+        //[REMOVE LOG CALLS]Log.d(tag, this.toString())
91 91
     }
92 92
 }

+ 1 - 1
app/src/main/java/fr/forum_thalie/tsumugi/playerstore/PlayerStore.kt View File

@@ -56,7 +56,7 @@ class PlayerStore {
56 56
                 lp.add(0, n)
57 57
             currentSongBackup.copy(currentSong)
58 58
             isLpUpdated.value = true
59
-            Log.d(tag, playerStoreTag +  lp.toString())
59
+            //[REMOVE LOG CALLS]Log.d(tag, playerStoreTag +  lp.toString())
60 60
         //}
61 61
     }
62 62
 

+ 1 - 1
app/src/main/java/fr/forum_thalie/tsumugi/ui/news/NewsAdapter.kt View File

@@ -40,7 +40,7 @@ class ImageGetterAsyncTask(
40 40
     override fun doInBackground(vararg params: TextView?): Bitmap? {
41 41
         t = params[0]
42 42
         return try {
43
-            //Log.d(LOG_CAT, "Downloading the image from: $source")
43
+            ////[REMOVE LOG CALLS]Log.d(LOG_CAT, "Downloading the image from: $source")
44 44
             var k: InputStream? = null
45 45
             var pic: Bitmap? = null
46 46
             try {

+ 3 - 3
app/src/main/java/fr/forum_thalie/tsumugi/ui/news/NewsFragment.kt View File

@@ -43,9 +43,9 @@ class NewsFragment : Fragment() {
43 43
                 }
44 44
 
45 45
                 newsViewModel.isWebViewLoaded = true
46
-                Log.d(tag, "webview created")
46
+                //[REMOVE LOG CALLS]Log.d(tag, "webview created")
47 47
             } else {
48
-                Log.d(tag, "webview already created!?")
48
+                //[REMOVE LOG CALLS]Log.d(tag, "webview already created!?")
49 49
             }
50 50
 
51 51
             newsViewModel.root.addOnLayoutChangeListener(orientationLayoutListener)
@@ -101,7 +101,7 @@ class NewsFragment : Fragment() {
101 101
             ViewModelProviders.of(this).get(NewsViewModel::class.java)
102 102
 
103 103
         newsViewModel.fetch(c = context!!, isPreloading = true)
104
-        Log.d(tag, "news fetched onCreate")
104
+        //[REMOVE LOG CALLS]Log.d(tag, "news fetched onCreate")
105 105
         super.onCreate(savedInstanceState)
106 106
     }
107 107
 }

+ 3 - 3
app/src/main/java/fr/forum_thalie/tsumugi/ui/news/NewsViewModel.kt View File

@@ -43,14 +43,14 @@ class NewsViewModel : ViewModel() {
43 43
 
44 44
         val maxNumberOfArticles = 5
45 45
         coroutineScope.launch(Dispatchers.Main) {
46
-            Log.d(tag, "launching coroutine")
46
+            //[REMOVE LOG CALLS]Log.d(tag, "launching coroutine")
47 47
                 val parser = Parser()
48 48
             try {
49 49
                 val articleList = parser.getArticles(urlToScrape)
50 50
                 newsArray.clear()
51 51
                 for (i in 0 until min(articleList.size, maxNumberOfArticles)) {
52 52
                     val item = articleList[i]
53
-                    Log.d(tag, "i = $i / ${articleList.size}")
53
+                    //[REMOVE LOG CALLS]Log.d(tag, "i = $i / ${articleList.size}")
54 54
                     val news = News()
55 55
                     news.title = item.title ?: ""
56 56
                     news.link = item.link ?: urlToScrape
@@ -60,7 +60,7 @@ class NewsViewModel : ViewModel() {
60 60
 
61 61
                     val formatter6 = SimpleDateFormat(newsDateTimePattern, Locale.ENGLISH)
62 62
                     val dateString = item.pubDate.toString()
63
-                    Log.d(tag, "$news --- $dateString")
63
+                    //[REMOVE LOG CALLS]Log.d(tag, "$news --- $dateString")
64 64
 
65 65
                     news.date = formatter6.parse(dateString) ?: Date(0)
66 66
 

+ 1 - 1
app/src/main/java/fr/forum_thalie/tsumugi/ui/nowplaying/NowPlayingFragment.kt View File

@@ -273,7 +273,7 @@ class NowPlayingFragment : Fragment() {
273 273
                 (viewHeight*100)/viewWidth
274 274
         else
275 275
             100
276
-        Log.d(tag, "orientation set")
276
+        //[REMOVE LOG CALLS]Log.d(tag, "orientation set")
277 277
     }
278 278
 
279 279
     override fun onResume() {

+ 1 - 1
app/src/main/java/fr/forum_thalie/tsumugi/ui/programme/ProgrammeFragment.kt View File

@@ -41,7 +41,7 @@ class ProgrammeFragment : Fragment() {
41 41
 
42 42
         val tabLayout : TabLayout = root.findViewById(R.id.dayTabLayout)
43 43
         tabLayout.setupWithViewPager(viewPager)
44
-        Log.d(tag, "SongFragment view created")
44
+        //[REMOVE LOG CALLS]Log.d(tag, "SongFragment view created")
45 45
 
46 46
         return root
47 47
     }

+ 1 - 1
app/src/main/java/fr/forum_thalie/tsumugi/ui/songs/SongsFragment.kt View File

@@ -39,7 +39,7 @@ class SongsFragment : Fragment() {
39 39
 
40 40
         val tabLayout : TabLayout = root.findViewById(R.id.tabLayout)
41 41
         tabLayout.setupWithViewPager(viewPager)
42
-        Log.d(tag, "SongFragment view created")
42
+        //[REMOVE LOG CALLS]Log.d(tag, "SongFragment view created")
43 43
 
44 44
         return root
45 45
     }

+ 1 - 1
app/src/main/java/fr/forum_thalie/tsumugi/ui/songs/queuelp/LastPlayedFragment.kt View File

@@ -31,7 +31,7 @@ class LastPlayedFragment : Fragment() {
31 31
 
32 32
 
33 33
     private val queueObserver = Observer<Boolean> {
34
-        Log.d(tag, lastPlayedFragmentTag + "queue changed")
34
+        //[REMOVE LOG CALLS]Log.d(tag, lastPlayedFragmentTag + "queue changed")
35 35
         viewAdapter.notifyDataSetChanged()
36 36
     }
37 37