Svet Ganov | adc1cf4 | 2015-06-15 16:36:24 -0700 | [diff] [blame] | 1 | /* |
| 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 | |
| 17 | package android.content.pm; |
| 18 | |
| 19 | import android.annotation.NonNull; |
| 20 | |
| 21 | /** |
| 22 | * Package manager local system service interface. |
| 23 | * |
| 24 | * @hide Only for use within the system server. |
| 25 | */ |
| 26 | public abstract class PackageManagerInternal { |
| 27 | |
| 28 | /** |
| 29 | * Provider for package names. |
| 30 | */ |
| 31 | public interface PackagesProvider { |
| 32 | |
| 33 | /** |
| 34 | * Gets the packages for a given user. |
| 35 | * @param userId The user id. |
| 36 | * @return The package names. |
| 37 | */ |
| 38 | public String[] getPackages(int userId); |
| 39 | } |
| 40 | |
| 41 | /** |
Svetoslav | 0010b70 | 2015-06-30 18:05:26 -0700 | [diff] [blame^] | 42 | * Provider for package names. |
| 43 | */ |
| 44 | public interface SyncAdapterPackagesProvider { |
| 45 | |
| 46 | /** |
| 47 | * Gets the sync adapter packages for given authority and user. |
| 48 | * @param authority The authority. |
| 49 | * @param userId The user id. |
| 50 | * @return The package names. |
| 51 | */ |
| 52 | public String[] getPackages(String authority, int userId); |
| 53 | } |
| 54 | |
| 55 | /** |
Svet Ganov | adc1cf4 | 2015-06-15 16:36:24 -0700 | [diff] [blame] | 56 | * Sets the location provider packages provider. |
| 57 | * @param provider The packages provider. |
| 58 | */ |
| 59 | public abstract void setLocationPackagesProvider(PackagesProvider provider); |
| 60 | |
| 61 | /** |
| 62 | * Sets the input method packages provider. |
| 63 | * @param provider The packages provider. |
| 64 | */ |
| 65 | public abstract void setImePackagesProvider(PackagesProvider provider); |
| 66 | |
| 67 | /** |
| 68 | * Sets the voice interaction packages provider. |
| 69 | * @param provider The packages provider. |
| 70 | */ |
| 71 | public abstract void setVoiceInteractionPackagesProvider(PackagesProvider provider); |
Svetoslav | cdfd230 | 2015-06-25 19:07:31 -0700 | [diff] [blame] | 72 | |
| 73 | /** |
| 74 | * Sets the SMS packages provider. |
| 75 | * @param provider The packages provider. |
| 76 | */ |
| 77 | public abstract void setSmsAppPackagesProvider(PackagesProvider provider); |
| 78 | |
| 79 | /** |
| 80 | * Sets the dialer packages provider. |
| 81 | * @param provider The packages provider. |
| 82 | */ |
| 83 | public abstract void setDialerAppPackagesProvider(PackagesProvider provider); |
| 84 | |
| 85 | /** |
Svetoslav | 0010b70 | 2015-06-30 18:05:26 -0700 | [diff] [blame^] | 86 | * Sets the sync adapter packages provider. |
| 87 | * @param provider The provider. |
| 88 | */ |
| 89 | public abstract void setSyncAdapterPackagesprovider(SyncAdapterPackagesProvider provider); |
| 90 | |
| 91 | /** |
Svetoslav | cdfd230 | 2015-06-25 19:07:31 -0700 | [diff] [blame] | 92 | * Requests granting of the default permissions to the current default SMS app. |
| 93 | * @param packageName The default SMS package name. |
| 94 | * @param userId The user for which to grant the permissions. |
| 95 | */ |
| 96 | public abstract void grantDefaultPermissionsToDefaultSmsApp(String packageName, int userId); |
| 97 | |
| 98 | /** |
| 99 | * Requests granting of the default permissions to the current default dialer app. |
| 100 | * @param packageName The default dialer package name. |
| 101 | * @param userId The user for which to grant the permissions. |
| 102 | */ |
| 103 | public abstract void grantDefaultPermissionsToDefaultDialerApp(String packageName, int userId); |
Svet Ganov | adc1cf4 | 2015-06-15 16:36:24 -0700 | [diff] [blame] | 104 | } |