package luyao.util.ktx.ext import android.app.* import android.app.job.JobScheduler import android.content.ClipboardManager import android.content.Context import android.hardware.SensorManager import android.location.LocationManager import android.media.AudioManager import android.media.MediaRouter import android.net.ConnectivityManager import android.net.wifi.WifiManager import android.os.BatteryManager import android.os.PowerManager import android.os.Vibrator import android.os.storage.StorageManager import android.telephony.CarrierConfigManager import android.telephony.SubscriptionManager import android.telephony.TelephonyManager import android.view.LayoutInflater import android.view.WindowManager import android.view.accessibility.AccessibilityManager import android.view.inputmethod.InputMethodManager import androidx.core.content.ContextCompat /** * Created by luyao * on 2019/7/9 9:17 */ /** * Return system service which type is [T] */ inline fun Context.getSystemService(): T? = ContextCompat.getSystemService(this, T::class.java) val Context.windowManager get() = getSystemService() val Context.clipboardManager get() = getSystemService() val Context.layoutInflater get() = getSystemService() val Context.activityManager get() = getSystemService() val Context.powerManager get() = getSystemService() val Context.alarmManager get() = getSystemService() val Context.notificationManager get() = getSystemService() val Context.keyguardManager get() = getSystemService() val Context.locationManager get() = getSystemService() val Context.searchManager get() = getSystemService() val Context.storageManager get() = getSystemService() val Context.vibrator get() = getSystemService() val Context.connectivityManager get() = getSystemService() val Context.wifiManager get() = getSystemService() val Context.audioManager get() = getSystemService() val Context.mediaRouter get() = getSystemService() val Context.telephonyManager get() = getSystemService() val Context.sensorManager get() = getSystemService() val Context.subscriptionManager get() = getSystemService() val Context.carrierConfigManager get() = getSystemService() val Context.inputMethodManager get() = getSystemService() val Context.uiModeManager get() = getSystemService() val Context.downloadManager get() = getSystemService() val Context.batteryManager get() = getSystemService() val Context.jobScheduler get() = getSystemService() val Context.accessibilityManager get() = getSystemService()