2 * Copyright (C) 2007 The Android Open Source Project
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 package android.content.pm;
19 import android.os.Parcel;
20 import android.os.Parcelable;
21 import android.util.Printer;
24 * Information you can retrieve about a particular application
25 * service. This corresponds to information collected from the
26 * AndroidManifest.xml's <service> tags.
28 public class ServiceInfo extends ComponentInfo
29 implements Parcelable {
31 * Optional name of a permission required to be able to access this
32 * Service. From the "permission" attribute.
34 public String permission;
36 public ServiceInfo() {
39 public ServiceInfo(ServiceInfo orig) {
41 permission = orig.permission;
44 public void dump(Printer pw, String prefix) {
45 super.dumpFront(pw, prefix);
46 pw.println(prefix + "permission=" + permission);
49 public String toString() {
51 + Integer.toHexString(System.identityHashCode(this))
55 public int describeContents() {
59 public void writeToParcel(Parcel dest, int parcelableFlags) {
60 super.writeToParcel(dest, parcelableFlags);
61 dest.writeString(permission);
64 public static final Creator<ServiceInfo> CREATOR =
65 new Creator<ServiceInfo>() {
66 public ServiceInfo createFromParcel(Parcel source) {
67 return new ServiceInfo(source);
69 public ServiceInfo[] newArray(int size) {
70 return new ServiceInfo[size];
74 private ServiceInfo(Parcel source) {
76 permission = source.readString();