Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 33d42a39 authored by tibbi's avatar tibbi
Browse files

make isOnMainThread really universal, not a context extension

parent ed37968b
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
package com.simplemobiletools.commons.helpers

import android.content.Context
import android.os.Build
import android.os.Looper

@@ -150,7 +149,7 @@ const val EVERY_DAY_BIT = MONDAY_BIT or TUESDAY_BIT or WEDNESDAY_BIT or THURSDAY
const val WEEK_DAYS_BIT = MONDAY_BIT or TUESDAY_BIT or WEDNESDAY_BIT or THURSDAY_BIT or FRIDAY_BIT
const val WEEKENDS_BIT = SATURDAY_BIT or SUNDAY_BIT

fun Context.isOnMainThread() = Looper.myLooper() == Looper.getMainLooper()
fun isOnMainThread() = Looper.myLooper() == Looper.getMainLooper()

fun isJellyBean1Plus() = Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1
fun isAndroidFour() = Build.VERSION.SDK_INT <= Build.VERSION_CODES.KITKAT_WATCH