在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.


  1. publicObjectgetSystemService(Stringname){
  2. if(WINDOW_SERVICE.equals(name)){
  3. returnWindowManagerImpl.getDefault();
  4. }elseif(LAYOUT_INFLATER_SERVICE.equals(name)){
  5. synchronized(mSync){
  6. LayoutInflaterinflater=mLayoutInflater;
  7. if(inflater!=null){
  8. returninflater;
  9. }
  10. mLayoutInflater=inflater=
  11. PolicyManager.makeNewLayoutInflater(getOuterContext());
  12. returninflater;
  13. }
  14. }elseif(ACTIVITY_SERVICE.equals(name)){
  15. returngetActivityManager();
  16. }elseif(INPUT_METHOD_SERVICE.equals(name)){
  17. returnInputMethodManager.getInstance(this);
  18. }elseif(ALARM_SERVICE.equals(name)){
  19. returngetAlarmManager();
  20. }elseif(ACCOUNT_SERVICE.equals(name)){
  21. returngetAccountManager();
  22. }elseif(POWER_SERVICE.equals(name)){
  23. returngetPowerManager();
  24. }elseif(CONNECTIVITY_SERVICE.equals(name)){
  25. returngetConnectivityManager();
  26. }elseif(THROTTLE_SERVICE.equals(name)){
  27. returngetThrottleManager();
  28. }elseif(WIFI_SERVICE.equals(name)){
  29. returngetWifiManager();
  30. }elseif(NOTIFICATION_SERVICE.equals(name)){
  31. returngetNotificationManager();
  32. }elseif(KEYGUARD_SERVICE.equals(name)){
  33. returnnewKeyguardManager();
  34. }elseif(ACCESSIBILITY_SERVICE.equals(name)){
  35. returnAccessibilityManager.getInstance(this);
  36. }elseif(LOCATION_SERVICE.equals(name)){
  37. returngetLocationManager();
  38. }elseif(SEARCH_SERVICE.equals(name)){
  39. returngetSearchManager();
  40. }elseif(SENSOR_SERVICE.equals(name)){
  41. returngetSensorManager();
  42. }elseif(STORAGE_SERVICE.equals(name)){
  43. returngetStorageManager();
  44. }elseif(VIBRATOR_SERVICE.equals(name)){
  45. returngetVibrator();
  46. }elseif(STATUS_BAR_SERVICE.equals(name)){
  47. synchronized(mSync){
  48. if(mStatusBarManager==null){
  49. mStatusBarManager=newStatusBarManager(getOuterContext());
  50. }
  51. returnmStatusBarManager;
  52. }
  53. }elseif(AUDIO_SERVICE.equals(name)){
  54. returngetAudioManager();
  55. }elseif(TELEPHONY_SERVICE.equals(name)){
  56. returngetTelephonyManager();
  57. }elseif(CLIPBOARD_SERVICE.equals(name)){
  58. returngetClipboardManager();
  59. }elseif(WALLPAPER_SERVICE.equals(name)){
  60. returngetWallpaperManager();
  61. }elseif(DROPBOX_SERVICE.equals(name)){
  62. returngetDropBoxManager();
  63. }elseif(DEVICE_POLICY_SERVICE.equals(name)){
  64. returngetDevicePolicyManager();
  65. }elseif(UI_MODE_SERVICE.equals(name)){
  66. returngetUiModeManager();
  67. }
  68. returnnull;
  69. }



更多相关文章

  1. 【Android】Fragment将废弃onActivityCreated
  2. [Java][Android][Process] 暴力的服务可以解决一切,暴力的方式执
  3. Android(安卓)Fragments 详细使用详细介绍
  4. [Java][Android][Process] 暴力的服务可以解决一切,暴力的方式执
  5. Android(安卓)手机模拟游戏手柄(USB,C#,winio)
  6. Android我还可以相信你多少系列文章四之悬浮窗
  7. Android我还可以相信你多少系列文章五之存储卡
  8. Android开发人员必须掌握的10 个开发工具+应该深入学习的10个开
  9. Android数据库ORMlite框架翻译系列(第一章)

随机推荐

  1. Linux 下Android安装过程
  2. android native 调试 打印调用栈
  3. Android 消息窗口
  4. Android视频采集编码颜色格式选择
  5. android 使用SQLite对数据进行增删改查、
  6. Android 手势类型与识别
  7. Android 的事件分发机制
  8. android自定义Toast之-弹出消息
  9. SeekBar的使用和自定义
  10. [置顶] 电源管理之android内核suspend to