diff options
author | Amith Yamasani <yamasani@google.com> | 2013-12-20 13:27:30 -0800 |
---|---|---|
committer | Amith Yamasani <yamasani@google.com> | 2013-12-20 14:46:56 -0800 |
commit | 817ec49e7991d4cac50b2308cd7cf5f8641e1e29 (patch) | |
tree | 173ef0eb001119a0d093f0398769a3c0a0f5a369 /services/devicepolicy | |
parent | 9158825f9c41869689d6b1786d7c7aa8bdd524ce (diff) | |
download | frameworks_base-817ec49e7991d4cac50b2308cd7cf5f8641e1e29.zip frameworks_base-817ec49e7991d4cac50b2308cd7cf5f8641e1e29.tar.gz frameworks_base-817ec49e7991d4cac50b2308cd7cf5f8641e1e29.tar.bz2 |
Wrap some services into a SystemService
These services can now be excluded by modifying the list of REQUIRED_SERVICES (TB renamed)
Changed appwidget, devicepolicy, backup and print services.
Change-Id: Id8e2855d5c045cd57bdb02dca9ed75172803bce7
Diffstat (limited to 'services/devicepolicy')
-rw-r--r-- | services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerSystemService.java | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerSystemService.java b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerSystemService.java new file mode 100644 index 0000000..160aa39 --- /dev/null +++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerSystemService.java @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.server.devicepolicy; + +import android.content.Context; + +import com.android.server.SystemService; + +/** + * SystemService wrapper for the DevicePolicyManager implementation. Publishes + * Context.DEVICE_POLICY_SERVICE. + */ +public final class DevicePolicyManagerSystemService extends SystemService { + private DevicePolicyManagerService mDevicePolicyManagerImpl; + + @Override + public void onCreate(Context context) { + mDevicePolicyManagerImpl = new DevicePolicyManagerService(context); + } + + @Override + public void onStart() { + publishBinderService(Context.DEVICE_POLICY_SERVICE, mDevicePolicyManagerImpl); + } + + @Override + public void onBootPhase(int phase) { + if (phase == PHASE_LOCK_SETTINGS_READY) { + mDevicePolicyManagerImpl.systemReady(); + } + } +}
\ No newline at end of file |