blob: 13ebb823bd7875235ea9826ba3f93a0d8f43b623 [file] [log] [blame]
Svet Ganovadc1cf42015-06-15 16:36:24 -07001/*
2 * Copyright (C) 2015 The Android Open Source Project
3 *
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
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
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.
15 */
16
17package android.content.pm;
18
Makoto Onuki2d5b4652016-03-11 16:09:54 -080019import android.content.ComponentName;
Todd Kennedy39bfee52016-02-24 10:28:21 -080020import android.content.pm.PackageManager.NameNotFoundException;
21
Fyodor Kupolovcb6fd802015-11-05 14:27:06 -080022import java.util.List;
Svet Ganovadc1cf42015-06-15 16:36:24 -070023
24/**
25 * Package manager local system service interface.
26 *
27 * @hide Only for use within the system server.
28 */
29public abstract class PackageManagerInternal {
30
31 /**
32 * Provider for package names.
33 */
34 public interface PackagesProvider {
35
36 /**
37 * Gets the packages for a given user.
38 * @param userId The user id.
39 * @return The package names.
40 */
41 public String[] getPackages(int userId);
42 }
43
44 /**
Svetoslav0010b702015-06-30 18:05:26 -070045 * Provider for package names.
46 */
47 public interface SyncAdapterPackagesProvider {
48
49 /**
50 * Gets the sync adapter packages for given authority and user.
51 * @param authority The authority.
52 * @param userId The user id.
53 * @return The package names.
54 */
55 public String[] getPackages(String authority, int userId);
56 }
57
58 /**
Svet Ganovadc1cf42015-06-15 16:36:24 -070059 * Sets the location provider packages provider.
60 * @param provider The packages provider.
61 */
62 public abstract void setLocationPackagesProvider(PackagesProvider provider);
63
64 /**
Svet Ganovadc1cf42015-06-15 16:36:24 -070065 * Sets the voice interaction packages provider.
66 * @param provider The packages provider.
67 */
68 public abstract void setVoiceInteractionPackagesProvider(PackagesProvider provider);
Svetoslavcdfd2302015-06-25 19:07:31 -070069
70 /**
71 * Sets the SMS packages provider.
72 * @param provider The packages provider.
73 */
74 public abstract void setSmsAppPackagesProvider(PackagesProvider provider);
75
76 /**
77 * Sets the dialer packages provider.
78 * @param provider The packages provider.
79 */
80 public abstract void setDialerAppPackagesProvider(PackagesProvider provider);
81
82 /**
Sailesh Nepalcf855622015-07-28 19:22:14 -070083 * Sets the sim call manager packages provider.
84 * @param provider The packages provider.
85 */
86 public abstract void setSimCallManagerPackagesProvider(PackagesProvider provider);
87
88 /**
Svetoslav0010b702015-06-30 18:05:26 -070089 * Sets the sync adapter packages provider.
90 * @param provider The provider.
91 */
92 public abstract void setSyncAdapterPackagesprovider(SyncAdapterPackagesProvider provider);
93
94 /**
Svetoslavcdfd2302015-06-25 19:07:31 -070095 * Requests granting of the default permissions to the current default SMS app.
96 * @param packageName The default SMS package name.
97 * @param userId The user for which to grant the permissions.
98 */
99 public abstract void grantDefaultPermissionsToDefaultSmsApp(String packageName, int userId);
100
101 /**
102 * Requests granting of the default permissions to the current default dialer app.
103 * @param packageName The default dialer package name.
104 * @param userId The user for which to grant the permissions.
105 */
106 public abstract void grantDefaultPermissionsToDefaultDialerApp(String packageName, int userId);
Sailesh Nepalcf855622015-07-28 19:22:14 -0700107
108 /**
109 * Requests granting of the default permissions to the current default sim call manager.
110 * @param packageName The default sim call manager package name.
111 * @param userId The user for which to grant the permissions.
112 */
113 public abstract void grantDefaultPermissionsToDefaultSimCallManager(String packageName,
114 int userId);
Fyodor Kupolovcb6fd802015-11-05 14:27:06 -0800115
116 /**
117 * Sets a list of apps to keep in PM's internal data structures and as APKs even if no user has
118 * currently installed it. The apps are not preloaded.
119 * @param packageList List of package names to keep cached.
120 */
121 public abstract void setKeepUninstalledPackages(List<String> packageList);
Svet Ganov9c165d72015-12-01 19:52:26 -0800122
123 /**
124 * Gets whether some of the permissions used by this package require a user
125 * review before any of the app components can run.
126 * @param packageName The package name for which to check.
127 * @param userId The user under which to check.
128 * @return True a permissions review is required.
129 */
130 public abstract boolean isPermissionsReviewRequired(String packageName, int userId);
Todd Kennedy39bfee52016-02-24 10:28:21 -0800131
132 /**
133 * Gets all of the information we know about a particular package.
134 *
135 * @param packageName The package name to find.
136 * @param userId The user under which to check.
137 *
138 * @return An {@link ApplicationInfo} containing information about the
139 * package.
140 * @throws NameNotFoundException if a package with the given name cannot be
141 * found on the system.
142 */
143 public abstract ApplicationInfo getApplicationInfo(String packageName, int userId);
Makoto Onuki2d5b4652016-03-11 16:09:54 -0800144
145 /**
146 * Interface to {@link com.android.server.pm.PackageManagerService#getHomeActivitiesAsUser}.
147 */
148 public abstract ComponentName getHomeActivitiesAsUser(List<ResolveInfo> allHomeCandidates,
149 int userId);
Svet Ganovadc1cf42015-06-15 16:36:24 -0700150}