在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. |
- public Object getSystemService(String name) {
- if (WINDOW_SERVICE.equals(name)) {
- return WindowManagerImpl.getDefault();
- } else if (LAYOUT_INFLATER_SERVICE.equals(name)) {
- synchronized (mSync) {
- LayoutInflater inflater = mLayoutInflater;
- if (inflater != null) {
- return inflater;
- }
- mLayoutInflater = inflater =
- PolicyManager.makeNewLayoutInflater(getOuterContext());
- return inflater;
- }
- } else if (ACTIVITY_SERVICE.equals(name)) {
- return getActivityManager();
- } else if (INPUT_METHOD_SERVICE.equals(name)) {
- return InputMethodManager.getInstance(this);
- } else if (ALARM_SERVICE.equals(name)) {
- return getAlarmManager();
- } else if (ACCOUNT_SERVICE.equals(name)) {
- return getAccountManager();
- } else if (POWER_SERVICE.equals(name)) {
- return getPowerManager();
- } else if (CONNECTIVITY_SERVICE.equals(name)) {
- return getConnectivityManager();
- } else if (THROTTLE_SERVICE.equals(name)) {
- return getThrottleManager();
- } else if (WIFI_SERVICE.equals(name)) {
- return getWifiManager();
- } else if (NOTIFICATION_SERVICE.equals(name)) {
- return getNotificationManager();
- } else if (KEYGUARD_SERVICE.equals(name)) {
- return new KeyguardManager();
- } else if (ACCESSIBILITY_SERVICE.equals(name)) {
- return AccessibilityManager.getInstance(this);
- } else if (LOCATION_SERVICE.equals(name)) {
- return getLocationManager();
- } else if (SEARCH_SERVICE.equals(name)) {
- return getSearchManager();
- } else if (SENSOR_SERVICE.equals(name)) {
- return getSensorManager();
- } else if (STORAGE_SERVICE.equals(name)) {
- return getStorageManager();
- } else if (VIBRATOR_SERVICE.equals(name)) {
- return getVibrator();
- } else if (STATUS_BAR_SERVICE.equals(name)) {
- synchronized (mSync) {
- if (mStatusBarManager == null) {
- mStatusBarManager = new StatusBarManager(getOuterContext());
- }
- return mStatusBarManager;
- }
- } else if (AUDIO_SERVICE.equals(name)) {
- return getAudioManager();
- } else if (TELEPHONY_SERVICE.equals(name)) {
- return getTelephonyManager();
- } else if (CLIPBOARD_SERVICE.equals(name)) {
- return getClipboardManager();
- } else if (WALLPAPER_SERVICE.equals(name)) {
- return getWallpaperManager();
- } else if (DROPBOX_SERVICE.equals(name)) {
- return getDropBoxManager();
- } else if (DEVICE_POLICY_SERVICE.equals(name)) {
- return getDevicePolicyManager();
- } else if (UI_MODE_SERVICE.equals(name)) {
- return getUiModeManager();
- }
- return null;
- }