removed Log.d calls

remotes/origin/devel
yattoz 2019-12-30 23:39:40 +01:00
parent 6bbc958dce
commit 06c5b4dd1b
16 changed files with 45 additions and 45 deletions

View File

@ -13,7 +13,7 @@ class Async(val handler: (Any?) -> Any?, val post: (Any?) -> Unit = {},
execute() execute()
} catch (e: Exception) } catch (e: Exception)
{ {
Log.d(tag,e.toString()) //[REMOVE LOG CALLS]//[REMOVE LOG CALLS]Log.d(tag,e.toString())
} }
} }
@ -46,14 +46,14 @@ class Async(val handler: (Any?) -> Any?, val post: (Any?) -> Unit = {},
} }
Log.d(tag, "fallback for no network. Store reset : $storeReset") //[REMOVE LOG CALLS]Log.d(tag, "fallback for no network. Store reset : $storeReset")
} }
override fun doInBackground(vararg params: Any?): Any? { override fun doInBackground(vararg params: Any?): Any? {
try { try {
return handler(parameters) return handler(parameters)
} catch (e: Exception) { } catch (e: Exception) {
Log.d(tag,e.toString()) //[REMOVE LOG CALLS]Log.d(tag,e.toString())
onException(e) onException(e)
} }
return null return null
@ -63,7 +63,7 @@ class Async(val handler: (Any?) -> Any?, val post: (Any?) -> Unit = {},
try { try {
post(result) post(result)
} catch (e: Exception) { } catch (e: Exception) {
Log.d(tag,e.toString()) //[REMOVE LOG CALLS]Log.d(tag,e.toString())
onException(e) onException(e)
} }
} }

View File

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

View File

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

View File

@ -132,7 +132,7 @@ class MainActivity : BaseActivity() {
// Post-UI Launch // Post-UI Launch
if (PlayerStore.instance.isInitialized) if (PlayerStore.instance.isInitialized)
{ {
Log.d(tag, "skipped initialization") //[REMOVE LOG CALLS]Log.d(tag, "skipped initialization")
} else { } else {
// if the service is not started, start it in STOP mode. // if the service is not started, start it in STOP mode.
// 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). // 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() {
val i = Intent(this, RadioService::class.java) val i = Intent(this, RadioService::class.java)
i.putExtra("action", a.name) i.putExtra("action", a.name)
i.putExtra("value", v) i.putExtra("value", v)
Log.d(tag, "Sending intent ${a.name}") //[REMOVE LOG CALLS]Log.d(tag, "Sending intent ${a.name}")
startService(i) startService(i)
} }
@ -238,7 +238,7 @@ class MainActivity : BaseActivity() {
// File(getExternalFilesDir(Environment.DIRECTORY_DOCUMENTS) + "/MyPersonalAppFolder") // File(getExternalFilesDir(Environment.DIRECTORY_DOCUMENTS) + "/MyPersonalAppFolder")
val logDirectory = File("$appDirectory/log") val logDirectory = File("$appDirectory/log")
val logFile = File(logDirectory, "logcat" + System.currentTimeMillis() + ".txt") val logFile = File(logDirectory, "logcat" + System.currentTimeMillis() + ".txt")
Log.d( //[REMOVE LOG CALLS]Log.d(
tag, tag,
"appDirectory : $appDirectory, logDirectory : $logDirectory, logFile : $logFile" "appDirectory : $appDirectory, logDirectory : $logDirectory, logFile : $logFile"
) )
@ -246,20 +246,20 @@ class MainActivity : BaseActivity() {
// create app folder // create app folder
if (!appDirectory.exists()) { if (!appDirectory.exists()) {
appDirectory.mkdir() appDirectory.mkdir()
Log.d(tag, "$appDirectory created") //[REMOVE LOG CALLS]Log.d(tag, "$appDirectory created")
} }
// create log folder // create log folder
if (!logDirectory.exists()) { if (!logDirectory.exists()) {
logDirectory.mkdir() logDirectory.mkdir()
Log.d(tag, "$logDirectory created") //[REMOVE LOG CALLS]Log.d(tag, "$logDirectory created")
} }
// clear the previous logcat and then write the new one to the file // clear the previous logcat and then write the new one to the file
try { try {
Runtime.getRuntime().exec("logcat -c") Runtime.getRuntime().exec("logcat -c")
Runtime.getRuntime().exec("logcat -v time -f $logFile *:E $tag:V ") Runtime.getRuntime().exec("logcat -v time -f $logFile *:E $tag:V ")
Log.d(tag, "logcat started") //[REMOVE LOG CALLS]Log.d(tag, "logcat started")
} catch (e: IOException) { } catch (e: IOException) {
e.printStackTrace() e.printStackTrace()
} }

View File

@ -68,14 +68,14 @@ class RadioService : MediaBrowserServiceCompat() {
// This *should* work in any case... // This *should* work in any case...
when (intent.getIntExtra("state", -1)) { when (intent.getIntExtra("state", -1)) {
0 -> { 0 -> {
Log.d(tag, radioTag + "Headset is unplugged") //[REMOVE LOG CALLS]Log.d(tag, radioTag + "Headset is unplugged")
} }
1 -> { 1 -> {
Log.d(tag, radioTag + "Headset is plugged") //[REMOVE LOG CALLS]Log.d(tag, radioTag + "Headset is plugged")
headsetPluggedIn = true headsetPluggedIn = true
} }
else -> { else -> {
Log.d(tag, radioTag + "I have no idea what the headset state is") //[REMOVE LOG CALLS]Log.d(tag, radioTag + "I have no idea what the headset state is")
} }
} }
/* /*
@ -91,7 +91,7 @@ class RadioService : MediaBrowserServiceCompat() {
} }
else else
{ {
Log.d(tag, radioTag + "Can't get state?") //[REMOVE LOG CALLS]Log.d(tag, radioTag + "Can't get state?")
} }
*/ */
@ -205,7 +205,7 @@ class RadioService : MediaBrowserServiceCompat() {
startForeground(radioServiceId, nowPlayingNotification.notification) startForeground(radioServiceId, nowPlayingNotification.notification)
PlayerStore.instance.isServiceStarted.value = true PlayerStore.instance.isServiceStarted.value = true
Log.d(tag, radioTag + "created") //[REMOVE LOG CALLS]Log.d(tag, radioTag + "created")
} }
private val handler = Handler() private val handler = Handler()
@ -246,7 +246,7 @@ class RadioService : MediaBrowserServiceCompat() {
Actions.CANCEL_FADE_OUT.name -> { handler.removeCallbacks(lowerVolumeRunnable) } Actions.CANCEL_FADE_OUT.name -> { handler.removeCallbacks(lowerVolumeRunnable) }
Actions.SNOOZE.name -> { RadioAlarm.instance.snooze(this) } Actions.SNOOZE.name -> { RadioAlarm.instance.snooze(this) }
} }
Log.d(tag, radioTag + "intent received : " + intent.getStringExtra("action")) //[REMOVE LOG CALLS]Log.d(tag, radioTag + "intent received : " + intent.getStringExtra("action"))
super.onStartCommand(intent, flags, startId) super.onStartCommand(intent, flags, startId)
// 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. // 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.
return START_STICKY return START_STICKY
@ -258,7 +258,7 @@ class RadioService : MediaBrowserServiceCompat() {
stopSelf() stopSelf()
} }
super.onTaskRemoved(rootIntent) super.onTaskRemoved(rootIntent)
Log.d(tag, radioTag + "task removed") //[REMOVE LOG CALLS]Log.d(tag, radioTag + "task removed")
} }
override fun onDestroy() { override fun onDestroy() {
@ -290,7 +290,7 @@ class RadioService : MediaBrowserServiceCompat() {
} }
apiTicker.cancel() // stops the timer. apiTicker.cancel() // stops the timer.
Log.d(tag, radioTag + "destroyed") //[REMOVE LOG CALLS]Log.d(tag, radioTag + "destroyed")
// if the service is destroyed, the application had become useless. // if the service is destroyed, the application had become useless.
exitProcess(0) exitProcess(0)
} }
@ -361,10 +361,10 @@ class RadioService : MediaBrowserServiceCompat() {
for (i in 0 until it.length()) { for (i in 0 until it.length()) {
val entry = it.get(i) val entry = it.get(i)
if (entry is IcyHeaders) { if (entry is IcyHeaders) {
Log.d(tag, radioTag + "onMetadata: IcyHeaders $entry") //[REMOVE LOG CALLS]Log.d(tag, radioTag + "onMetadata: IcyHeaders $entry")
} }
if (entry is IcyInfo) { if (entry is IcyInfo) {
Log.d(tag, radioTag + "onMetadata: Title ----> ${entry.title}") //[REMOVE LOG CALLS]Log.d(tag, radioTag + "onMetadata: Title ----> ${entry.title}")
// Note : Kotlin supports UTF-8 by default. // Note : Kotlin supports UTF-8 by default.
numberOfSongs++ numberOfSongs++
val data = entry.title!! val data = entry.title!!
@ -439,7 +439,7 @@ class RadioService : MediaBrowserServiceCompat() {
{ {
Thread.sleep(1000) Thread.sleep(1000)
i++ i++
Log.d(tag, "$i, isAlarmStopped=$isAlarmStopped") //[REMOVE LOG CALLS]Log.d(tag, "$i, isAlarmStopped=$isAlarmStopped")
} }
} }
val post: (Any?) -> Unit = { val post: (Any?) -> Unit = {
@ -512,7 +512,7 @@ class RadioService : MediaBrowserServiceCompat() {
SystemClock.elapsedRealtime() SystemClock.elapsedRealtime()
) )
mediaSession.setPlaybackState(playbackStateBuilder.build()) mediaSession.setPlaybackState(playbackStateBuilder.build())
Log.d(tag, radioTag + "begin playing") //[REMOVE LOG CALLS]Log.d(tag, radioTag + "begin playing")
} }
private fun pausePlaying() private fun pausePlaying()
@ -541,7 +541,7 @@ class RadioService : MediaBrowserServiceCompat() {
1.0f, 1.0f,
SystemClock.elapsedRealtime() SystemClock.elapsedRealtime()
) )
Log.d(tag, radioTag + "stopped") //[REMOVE LOG CALLS]Log.d(tag, radioTag + "stopped")
mediaSession.setPlaybackState(playbackStateBuilder.build()) mediaSession.setPlaybackState(playbackStateBuilder.build())
} }
@ -629,7 +629,7 @@ class RadioService : MediaBrowserServiceCompat() {
Player.STATE_ENDED -> state = "Player.STATE_ENDED" Player.STATE_ENDED -> state = "Player.STATE_ENDED"
Player.STATE_READY -> state = "Player.STATE_READY" Player.STATE_READY -> state = "Player.STATE_READY"
} }
Log.d(tag, radioTag + "Player changed state: ${state}. numberOfSongs reset.") //[REMOVE LOG CALLS]Log.d(tag, radioTag + "Player changed state: ${state}. numberOfSongs reset.")
} }
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -43,9 +43,9 @@ class NewsFragment : Fragment() {
} }
newsViewModel.isWebViewLoaded = true newsViewModel.isWebViewLoaded = true
Log.d(tag, "webview created") //[REMOVE LOG CALLS]Log.d(tag, "webview created")
} else { } else {
Log.d(tag, "webview already created!?") //[REMOVE LOG CALLS]Log.d(tag, "webview already created!?")
} }
newsViewModel.root.addOnLayoutChangeListener(orientationLayoutListener) newsViewModel.root.addOnLayoutChangeListener(orientationLayoutListener)
@ -101,7 +101,7 @@ class NewsFragment : Fragment() {
ViewModelProviders.of(this).get(NewsViewModel::class.java) ViewModelProviders.of(this).get(NewsViewModel::class.java)
newsViewModel.fetch(c = context!!, isPreloading = true) newsViewModel.fetch(c = context!!, isPreloading = true)
Log.d(tag, "news fetched onCreate") //[REMOVE LOG CALLS]Log.d(tag, "news fetched onCreate")
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
} }
} }

View File

@ -43,14 +43,14 @@ class NewsViewModel : ViewModel() {
val maxNumberOfArticles = 5 val maxNumberOfArticles = 5
coroutineScope.launch(Dispatchers.Main) { coroutineScope.launch(Dispatchers.Main) {
Log.d(tag, "launching coroutine") //[REMOVE LOG CALLS]Log.d(tag, "launching coroutine")
val parser = Parser() val parser = Parser()
try { try {
val articleList = parser.getArticles(urlToScrape) val articleList = parser.getArticles(urlToScrape)
newsArray.clear() newsArray.clear()
for (i in 0 until min(articleList.size, maxNumberOfArticles)) { for (i in 0 until min(articleList.size, maxNumberOfArticles)) {
val item = articleList[i] val item = articleList[i]
Log.d(tag, "i = $i / ${articleList.size}") //[REMOVE LOG CALLS]Log.d(tag, "i = $i / ${articleList.size}")
val news = News() val news = News()
news.title = item.title ?: "" news.title = item.title ?: ""
news.link = item.link ?: urlToScrape news.link = item.link ?: urlToScrape
@ -60,7 +60,7 @@ class NewsViewModel : ViewModel() {
val formatter6 = SimpleDateFormat(newsDateTimePattern, Locale.ENGLISH) val formatter6 = SimpleDateFormat(newsDateTimePattern, Locale.ENGLISH)
val dateString = item.pubDate.toString() val dateString = item.pubDate.toString()
Log.d(tag, "$news --- $dateString") //[REMOVE LOG CALLS]Log.d(tag, "$news --- $dateString")
news.date = formatter6.parse(dateString) ?: Date(0) news.date = formatter6.parse(dateString) ?: Date(0)

View File

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

View File

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

View File

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

View File

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