From 817ec49e7991d4cac50b2308cd7cf5f8641e1e29 Mon Sep 17 00:00:00 2001 From: Amith Yamasani Date: Fri, 20 Dec 2013 13:27:30 -0800 Subject: 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 --- .../server/backup/BackupManagerService.java | 4 ++- .../server/backup/BackupManagerSystemService.java | 36 ++++++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 services/backup/java/com/android/server/backup/BackupManagerSystemService.java (limited to 'services/backup') diff --git a/services/backup/java/com/android/server/backup/BackupManagerService.java b/services/backup/java/com/android/server/backup/BackupManagerService.java index c2b0d10..c6dc5e6 100644 --- a/services/backup/java/com/android/server/backup/BackupManagerService.java +++ b/services/backup/java/com/android/server/backup/BackupManagerService.java @@ -84,6 +84,7 @@ import com.android.internal.backup.IBackupTransport; import com.android.internal.backup.IObbBackupService; import com.android.internal.backup.LocalTransport; import com.android.server.EventLogTags; +import com.android.server.SystemService; import com.android.server.backup.PackageManagerBackupAgent.Metadata; import java.io.BufferedInputStream; @@ -137,6 +138,7 @@ import javax.crypto.spec.PBEKeySpec; import javax.crypto.spec.SecretKeySpec; public class BackupManagerService extends IBackupManager.Stub { + private static final String TAG = "BackupManagerService"; private static final boolean DEBUG = true; private static final boolean MORE_DEBUG = false; @@ -6089,7 +6091,7 @@ public class BackupManagerService extends IBackupManager.Stub { } } - // clean up the BackupManagerService side of the bookkeeping + // clean up the BackupManagerImpl side of the bookkeeping // and cancel any pending timeout message mBackupManager.clearRestoreSession(mSession); } diff --git a/services/backup/java/com/android/server/backup/BackupManagerSystemService.java b/services/backup/java/com/android/server/backup/BackupManagerSystemService.java new file mode 100644 index 0000000..db2c94a --- /dev/null +++ b/services/backup/java/com/android/server/backup/BackupManagerSystemService.java @@ -0,0 +1,36 @@ +/* + * 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.backup; + +import android.content.Context; + +import com.android.server.SystemService; + +public class BackupManagerSystemService extends SystemService { + private BackupManagerService mBackupManagerImpl; + + @Override + public void onCreate(Context context) { + mBackupManagerImpl = new BackupManagerService(context); + } + + @Override + public void onStart() { + publishBinderService(Context.BACKUP_SERVICE, mBackupManagerImpl); + } +} + -- cgit v1.1