Android(安卓)getSystemService
16lz
2021-12-04
在android中有一些服务是得通过系统来得的,下面一整个的SystemService ,
在android的官方文档中大家 可以到
Context这个类下去找,
Summary
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | ACCESSIBILITY_SERVICE | Use with getSystemService(String) to retrieve a AccessibilityManager for giving the user feedback for UI events through the registered event listeners. | |||||||||
String | ACCOUNT_SERVICE | Use with getSystemService(String) to retrieve a AccountManager for receiving intents at a time of your choosing. | |||||||||
String | ACTIVITY_SERVICE | Use with getSystemService(String) to retrieve a ActivityManager for interacting with the global system state. | |||||||||
String | ALARM_SERVICE | Use with getSystemService(String) to retrieve a AlarmManager for receiving intents at a time of your choosing. | |||||||||
String | AUDIO_SERVICE | Use with getSystemService(String) to retrieve a AudioManager for handling management of volume, ringer modes and audio routing. | |||||||||
int | BIND_ABOVE_CLIENT | Flag for bindService(Intent, ServiceConnection, int) : indicates that the client application binding to this service considers the service to be more important than the app itself. | |||||||||
int | BIND_ADJUST_WITH_ACTIVITY | Flag for bindService(Intent, ServiceConnection, int) : If binding from an activity, allow the target service's process importance to be raised based on whether the activity is visible to the user, regardless whether another flag is used to reduce the amount that the client process's overall importance is used to impact it. | |||||||||
int | BIND_ALLOW_OOM_MANAGEMENT | Flag for bindService(Intent, ServiceConnection, int) : allow the process hosting the bound service to go through its normal memory management. | |||||||||
int | BIND_AUTO_CREATE | Flag for bindService(Intent, ServiceConnection, int) : automatically create the service as long as the binding exists. | |||||||||
int | BIND_DEBUG_UNBIND | Flag for bindService(Intent, ServiceConnection, int) : include debugging help for mismatched calls to unbind. | |||||||||
int | BIND_IMPORTANT | Flag for bindService(Intent, ServiceConnection, int) : this service is very important to the client, so should be brought to the foreground process level when the client is. | |||||||||
int | BIND_NOT_FOREGROUND | Flag for bindService(Intent, ServiceConnection, int) : don't allow this binding to raise the target service's process to the foreground scheduling priority. | |||||||||
int | BIND_WAIVE_PRIORITY | Flag for bindService(Intent, ServiceConnection, int) : don't impact the scheduling or memory management priority of the target service's hosting process. | |||||||||
String | CLIPBOARD_SERVICE | Use with getSystemService(String) to retrieve a ClipboardManager for accessing and modifying the contents of the global clipboard. | |||||||||
String | CONNECTIVITY_SERVICE | Use with getSystemService(String) to retrieve a ConnectivityManager for handling management of network connections. | |||||||||
int | CONTEXT_IGNORE_SECURITY | Flag for use with createPackageContext(String, int) : ignore any security restrictions on the Context being requested, allowing it to always be loaded. | |||||||||
int | CONTEXT_INCLUDE_CODE | Flag for use with createPackageContext(String, int) : include the application code with the context. | |||||||||
int | CONTEXT_RESTRICTED | Flag for use with createPackageContext(String, int) : a restricted context may disable specific features. | |||||||||
String | DEVICE_POLICY_SERVICE | Use with getSystemService(String) to retrieve a DevicePolicyManager for working with global device policy management. | |||||||||
String | DOWNLOAD_SERVICE | Use with getSystemService(String) to retrieve a DownloadManager for requesting HTTP downloads. | |||||||||
String | DROPBOX_SERVICE | Use with getSystemService(String) to retrieve a DropBoxManager instance for recording diagnostic logs. | |||||||||
String | INPUT_METHOD_SERVICE | Use with getSystemService(String) to retrieve a InputMethodManager for accessing input methods. | |||||||||
String | KEYGUARD_SERVICE | Use with getSystemService(String) to retrieve a NotificationManager for controlling keyguard. | |||||||||
String | LAYOUT_INFLATER_SERVICE | Use with getSystemService(String) to retrieve a LayoutInflater for inflating layout resources in this context. | |||||||||
String | LOCATION_SERVICE | Use with getSystemService(String) to retrieve a LocationManager for controlling location updates. | |||||||||
int | MODE_APPEND | File creation mode: for use with openFileOutput(String, int) , if the file already exists then write data to the end of the existing file instead of erasing it. | |||||||||
int | MODE_MULTI_PROCESS | SharedPreference loading flag: when set, the file on disk will be checked for modification even if the shared preferences instance is already loaded in this process. | |||||||||
int | MODE_PRIVATE | File creation mode: the default mode, where the created file can only be accessed by the calling application (or all applications sharing the same user ID). | |||||||||
int | MODE_WORLD_READABLE | File creation mode: allow all other applications to have read access to the created file. | |||||||||
int | MODE_WORLD_WRITEABLE | File creation mode: allow all other applications to have write access to the created file. | |||||||||
String | NFC_SERVICE | Use with getSystemService(String) to retrieve a NfcManager for using NFC. | |||||||||
String | NOTIFICATION_SERVICE | Use with getSystemService(String) to retrieve a NotificationManager for informing the user of background events. | |||||||||
String | POWER_SERVICE | Use with getSystemService(String) to retrieve a PowerManager for controlling power management, including "wake locks," which let you keep the device on while you're running long tasks. | |||||||||
String | SEARCH_SERVICE | Use with getSystemService(String) to retrieve a SearchManager for handling searches. | |||||||||
String | SENSOR_SERVICE | Use with getSystemService(String) to retrieve a SensorManager for accessing sensors. | |||||||||
String | STORAGE_SERVICE | Use with getSystemService(String) to retrieve a StorageManager for accessing system storage functions. | |||||||||
String | TELEPHONY_SERVICE | Use with getSystemService(String) to retrieve a TelephonyManager for handling management the telephony features of the device. | |||||||||
String | TEXT_SERVICES_MANAGER_SERVICE | Use with getSystemService(String) to retrieve a TextServicesManager for accessing text services. | |||||||||
String | UI_MODE_SERVICE | Use with getSystemService(String) to retrieve a UiModeManager for controlling UI modes. | |||||||||
String | USB_SERVICE | Use with getSystemService(String) to retrieve a UsbManager for access to USB devices (as a USB host) and for controlling this device's behavior as a USB device. | |||||||||
String | VIBRATOR_SERVICE | Use with getSystemService(String) to retrieve a Vibrator for interacting with the vibration hardware. | |||||||||
String | WALLPAPER_SERVICE | Use with getSystemService(String) to retrieve a com.android.server.WallpaperService for accessing wallpapers. | |||||||||
String | WIFI_P2P_SERVICE | Use with getSystemService(String) to retrieve a WifiP2pManager for handling management of Wi-Fi peer-to-peer connections. | |||||||||
String | WIFI_SERVICE | Use with getSystemService(String) to retrieve a WifiManager for handling management of Wi-Fi access. | |||||||||
String | WINDOW_SERVICE | Use with getSystemService(String) to retrieve a WindowManager for accessing the system's window manager. |
- publicObjectgetSystemService(Stringname){
- if(WINDOW_SERVICE.equals(name)){
- returnWindowManagerImpl.getDefault();
- }elseif(LAYOUT_INFLATER_SERVICE.equals(name)){
- synchronized(mSync){
- LayoutInflaterinflater=mLayoutInflater;
- if(inflater!=null){
- returninflater;
- }
- mLayoutInflater=inflater=
- PolicyManager.makeNewLayoutInflater(getOuterContext());
- returninflater;
- }
- }elseif(ACTIVITY_SERVICE.equals(name)){
- returngetActivityManager();
- }elseif(INPUT_METHOD_SERVICE.equals(name)){
- returnInputMethodManager.getInstance(this);
- }elseif(ALARM_SERVICE.equals(name)){
- returngetAlarmManager();
- }elseif(ACCOUNT_SERVICE.equals(name)){
- returngetAccountManager();
- }elseif(POWER_SERVICE.equals(name)){
- returngetPowerManager();
- }elseif(CONNECTIVITY_SERVICE.equals(name)){
- returngetConnectivityManager();
- }elseif(THROTTLE_SERVICE.equals(name)){
- returngetThrottleManager();
- }elseif(WIFI_SERVICE.equals(name)){
- returngetWifiManager();
- }elseif(NOTIFICATION_SERVICE.equals(name)){
- returngetNotificationManager();
- }elseif(KEYGUARD_SERVICE.equals(name)){
- returnnewKeyguardManager();
- }elseif(ACCESSIBILITY_SERVICE.equals(name)){
- returnAccessibilityManager.getInstance(this);
- }elseif(LOCATION_SERVICE.equals(name)){
- returngetLocationManager();
- }elseif(SEARCH_SERVICE.equals(name)){
- returngetSearchManager();
- }elseif(SENSOR_SERVICE.equals(name)){
- returngetSensorManager();
- }elseif(STORAGE_SERVICE.equals(name)){
- returngetStorageManager();
- }elseif(VIBRATOR_SERVICE.equals(name)){
- returngetVibrator();
- }elseif(STATUS_BAR_SERVICE.equals(name)){
- synchronized(mSync){
- if(mStatusBarManager==null){
- mStatusBarManager=newStatusBarManager(getOuterContext());
- }
- returnmStatusBarManager;
- }
- }elseif(AUDIO_SERVICE.equals(name)){
- returngetAudioManager();
- }elseif(TELEPHONY_SERVICE.equals(name)){
- returngetTelephonyManager();
- }elseif(CLIPBOARD_SERVICE.equals(name)){
- returngetClipboardManager();
- }elseif(WALLPAPER_SERVICE.equals(name)){
- returngetWallpaperManager();
- }elseif(DROPBOX_SERVICE.equals(name)){
- returngetDropBoxManager();
- }elseif(DEVICE_POLICY_SERVICE.equals(name)){
- returngetDevicePolicyManager();
- }elseif(UI_MODE_SERVICE.equals(name)){
- returngetUiModeManager();
- }
- returnnull;
- }
更多相关文章
- 【Android】Fragment将废弃onActivityCreated
- [Java][Android][Process] 暴力的服务可以解决一切,暴力的方式执
- Android(安卓)Fragments 详细使用详细介绍
- [Java][Android][Process] 暴力的服务可以解决一切,暴力的方式执
- Android(安卓)手机模拟游戏手柄(USB,C#,winio)
- Android我还可以相信你多少系列文章四之悬浮窗
- Android我还可以相信你多少系列文章五之存储卡
- Android开发人员必须掌握的10 个开发工具+应该深入学习的10个开
- Android数据库ORMlite框架翻译系列(第一章)