// INSPECTION_CLASS: com.android.tools.idea.lint.AndroidLintServiceCastInspection import android.content.ClipboardManager import android.app.Activity import android.app.WallpaperManager import android.content.Context import android.hardware.display.DisplayManager import android.service.wallpaper.WallpaperService @Suppress("UsePropertyAccessSyntax", "UNUSED_VARIABLE", "unused", "UNUSED_PARAMETER", "DEPRECATION") class SystemServiceTest : Activity() { fun test1() { val displayServiceOk = getSystemService(DISPLAY_SERVICE) as DisplayManager val displayServiceWrong = getSystemService(DEVICE_POLICY_SERVICE) as DisplayManager val wallPaperWrong = getSystemService(WALLPAPER_SERVICE) as WallpaperService val wallPaperOk = getSystemService(WALLPAPER_SERVICE) as WallpaperManager } fun test2(context: Context) { val displayServiceOk = context.getSystemService(DISPLAY_SERVICE) as DisplayManager val displayServiceWrong = context.getSystemService(DEVICE_POLICY_SERVICE) as DisplayManager } fun clipboard(context: Context) { val clipboard = context.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager val clipboard2 = context.getSystemService(Context.CLIPBOARD_SERVICE) as android.content.ClipboardManager } }