mirror of
https://github.com/YTVanced/VancedManager
synced 2024-11-26 21:13:01 +00:00
exception handling test 4
This commit is contained in:
parent
34dbc0ea74
commit
68790d5012
3 changed files with 21 additions and 1 deletions
|
@ -17,6 +17,8 @@ import com.vanced.manager.utils.InternetTools.getFileNameFromUrl
|
||||||
import com.vanced.manager.utils.NotificationHelper
|
import com.vanced.manager.utils.NotificationHelper
|
||||||
import com.vanced.manager.utils.NotificationHelper.cancelNotif
|
import com.vanced.manager.utils.NotificationHelper.cancelNotif
|
||||||
import com.vanced.manager.utils.NotificationHelper.createBasicNotif
|
import com.vanced.manager.utils.NotificationHelper.createBasicNotif
|
||||||
|
import java.lang.IllegalStateException
|
||||||
|
import java.lang.RuntimeException
|
||||||
import java.util.concurrent.ExecutionException
|
import java.util.concurrent.ExecutionException
|
||||||
|
|
||||||
class MicrogDownloadService: Service() {
|
class MicrogDownloadService: Service() {
|
||||||
|
@ -37,6 +39,10 @@ class MicrogDownloadService: Service() {
|
||||||
""
|
""
|
||||||
} catch (e: InterruptedException) {
|
} catch (e: InterruptedException) {
|
||||||
""
|
""
|
||||||
|
} catch (e: IllegalStateException) {
|
||||||
|
""
|
||||||
|
} catch (e: RuntimeException) {
|
||||||
|
""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,6 @@ import android.content.Context
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
import android.os.IBinder
|
import android.os.IBinder
|
||||||
import android.widget.Toast
|
|
||||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager
|
import androidx.localbroadcastmanager.content.LocalBroadcastManager
|
||||||
import androidx.preference.PreferenceManager
|
import androidx.preference.PreferenceManager
|
||||||
import com.dezlum.codelabs.getjson.GetJson
|
import com.dezlum.codelabs.getjson.GetJson
|
||||||
|
@ -22,6 +21,8 @@ import com.vanced.manager.utils.InternetTools.getFileNameFromUrl
|
||||||
import com.vanced.manager.utils.NotificationHelper.cancelNotif
|
import com.vanced.manager.utils.NotificationHelper.cancelNotif
|
||||||
import com.vanced.manager.utils.NotificationHelper.createBasicNotif
|
import com.vanced.manager.utils.NotificationHelper.createBasicNotif
|
||||||
import com.vanced.manager.utils.NotificationHelper.displayDownloadNotif
|
import com.vanced.manager.utils.NotificationHelper.displayDownloadNotif
|
||||||
|
import java.lang.IllegalStateException
|
||||||
|
import java.lang.RuntimeException
|
||||||
import java.util.concurrent.ExecutionException
|
import java.util.concurrent.ExecutionException
|
||||||
|
|
||||||
class VancedDownloadService: Service() {
|
class VancedDownloadService: Service() {
|
||||||
|
@ -44,6 +45,10 @@ class VancedDownloadService: Service() {
|
||||||
""
|
""
|
||||||
} catch (e: InterruptedException) {
|
} catch (e: InterruptedException) {
|
||||||
""
|
""
|
||||||
|
} catch (e: IllegalStateException) {
|
||||||
|
""
|
||||||
|
} catch (e: RuntimeException) {
|
||||||
|
""
|
||||||
}
|
}
|
||||||
|
|
||||||
val prefs = getSharedPreferences("installPrefs", Context.MODE_PRIVATE)
|
val prefs = getSharedPreferences("installPrefs", Context.MODE_PRIVATE)
|
||||||
|
|
|
@ -10,6 +10,7 @@ import com.vanced.manager.BuildConfig
|
||||||
import com.vanced.manager.R
|
import com.vanced.manager.R
|
||||||
import java.lang.Exception
|
import java.lang.Exception
|
||||||
import java.lang.IllegalStateException
|
import java.lang.IllegalStateException
|
||||||
|
import java.lang.RuntimeException
|
||||||
import java.util.concurrent.ExecutionException
|
import java.util.concurrent.ExecutionException
|
||||||
|
|
||||||
object InternetTools {
|
object InternetTools {
|
||||||
|
@ -31,6 +32,10 @@ object InternetTools {
|
||||||
context.getString(R.string.unavailable)
|
context.getString(R.string.unavailable)
|
||||||
} catch (e: InterruptedException) {
|
} catch (e: InterruptedException) {
|
||||||
context.getString(R.string.unavailable)
|
context.getString(R.string.unavailable)
|
||||||
|
} catch (e: IllegalStateException) {
|
||||||
|
context.getString(R.string.unavailable)
|
||||||
|
} catch (e: RuntimeException) {
|
||||||
|
context.getString(R.string.unavailable)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,6 +47,10 @@ object InternetTools {
|
||||||
0
|
0
|
||||||
} catch (e: InterruptedException) {
|
} catch (e: InterruptedException) {
|
||||||
0
|
0
|
||||||
|
} catch (e: IllegalStateException) {
|
||||||
|
0
|
||||||
|
} catch (e: RuntimeException) {
|
||||||
|
0
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue