Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c3edd4a6 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge changes from topic "providers"

* changes:
  Move few remaining permission methods
  Move providers to permission manager
parents 89b73fe7 c5b0e860
Loading
Loading
Loading
Loading
+7 −6
Original line number Original line Diff line number Diff line
@@ -635,7 +635,7 @@ public class ApplicationPackageManager extends PackageManager {
    @Override
    @Override
    public boolean isPermissionRevokedByPolicy(String permName, String pkgName) {
    public boolean isPermissionRevokedByPolicy(String permName, String pkgName) {
        try {
        try {
            return mPM.isPermissionRevokedByPolicy(permName, pkgName, getUserId());
            return mPermissionManager.isPermissionRevokedByPolicy(permName, pkgName, getUserId());
        } catch (RemoteException e) {
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
            throw e.rethrowFromSystemServer();
        }
        }
@@ -795,10 +795,11 @@ public class ApplicationPackageManager extends PackageManager {


    @Override
    @Override
    @UnsupportedAppUsage
    @UnsupportedAppUsage
    public boolean shouldShowRequestPermissionRationale(String permission) {
    public boolean shouldShowRequestPermissionRationale(String permName) {
        try {
        try {
            return mPM.shouldShowRequestPermissionRationale(permission,
            final String packageName = mContext.getPackageName();
                    mContext.getPackageName(), getUserId());
            return mPermissionManager
                    .shouldShowRequestPermissionRationale(permName, packageName, getUserId());
        } catch (RemoteException e) {
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
            throw e.rethrowFromSystemServer();
        }
        }
@@ -2049,7 +2050,7 @@ public class ApplicationPackageManager extends PackageManager {
    @Override
    @Override
    public String getDefaultBrowserPackageNameAsUser(int userId) {
    public String getDefaultBrowserPackageNameAsUser(int userId) {
        try {
        try {
            return mPM.getDefaultBrowserPackageName(userId);
            return mPermissionManager.getDefaultBrowser(userId);
        } catch (RemoteException e) {
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
            throw e.rethrowFromSystemServer();
        }
        }
@@ -2058,7 +2059,7 @@ public class ApplicationPackageManager extends PackageManager {
    @Override
    @Override
    public boolean setDefaultBrowserPackageNameAsUser(String packageName, int userId) {
    public boolean setDefaultBrowserPackageNameAsUser(String packageName, int userId) {
        try {
        try {
            return mPM.setDefaultBrowserPackageName(packageName, userId);
            return mPermissionManager.setDefaultBrowser(packageName, userId);
        } catch (RemoteException e) {
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
            throw e.rethrowFromSystemServer();
        }
        }
+0 −19
Original line number Original line Diff line number Diff line
@@ -94,8 +94,6 @@ interface IPackageManager {


    @UnsupportedAppUsage
    @UnsupportedAppUsage
    ProviderInfo getProviderInfo(in ComponentName className, int flags, int userId);
    ProviderInfo getProviderInfo(in ComponentName className, int flags, int userId);
    boolean shouldShowRequestPermissionRationale(String permName,
            String packageName, int userId);


    boolean isProtectedBroadcast(String actionName);
    boolean isProtectedBroadcast(String actionName);


@@ -594,18 +592,12 @@ interface IPackageManager {
    ParceledListSlice getIntentFilterVerifications(String packageName);
    ParceledListSlice getIntentFilterVerifications(String packageName);
    ParceledListSlice getAllIntentFilters(String packageName);
    ParceledListSlice getAllIntentFilters(String packageName);


    boolean setDefaultBrowserPackageName(String packageName, int userId);
    String getDefaultBrowserPackageName(int userId);

    VerifierDeviceIdentity getVerifierDeviceIdentity();
    VerifierDeviceIdentity getVerifierDeviceIdentity();


    boolean isFirstBoot();
    boolean isFirstBoot();
    boolean isOnlyCoreApps();
    boolean isOnlyCoreApps();
    boolean isDeviceUpgrading();
    boolean isDeviceUpgrading();


    void setPermissionEnforced(String permission, boolean enforced);
    boolean isPermissionEnforced(String permission);

    /** Reflects current DeviceStorageMonitorService state */
    /** Reflects current DeviceStorageMonitorService state */
    @UnsupportedAppUsage
    @UnsupportedAppUsage
    boolean isStorageLow();
    boolean isStorageLow();
@@ -629,17 +621,6 @@ interface IPackageManager {
    boolean isPackageSignedByKeySet(String packageName, in KeySet ks);
    boolean isPackageSignedByKeySet(String packageName, in KeySet ks);
    boolean isPackageSignedByKeySetExactly(String packageName, in KeySet ks);
    boolean isPackageSignedByKeySetExactly(String packageName, in KeySet ks);


    void grantDefaultPermissionsToEnabledCarrierApps(in String[] packageNames, int userId);
    void grantDefaultPermissionsToEnabledImsServices(in String[] packageNames, int userId);
    void grantDefaultPermissionsToEnabledTelephonyDataServices(
            in String[] packageNames, int userId);
    void revokeDefaultPermissionsFromDisabledTelephonyDataServices(
            in String[] packageNames, int userId);
    void grantDefaultPermissionsToActiveLuiApp(in String packageName, int userId);
    void revokeDefaultPermissionsFromLuiApps(in String[] packageNames, int userId);

    boolean isPermissionRevokedByPolicy(String permission, String packageName, int userId);

    @UnsupportedAppUsage
    @UnsupportedAppUsage
    String getPermissionControllerPackageName();
    String getPermissionControllerPackageName();


+24 −24
Original line number Original line Diff line number Diff line
@@ -3571,7 +3571,7 @@ public abstract class PackageManager {
    /**
    /**
     * Retrieve all of the information we know about a particular permission.
     * Retrieve all of the information we know about a particular permission.
     *
     *
     * @param permissionName The fully qualified name (i.e. com.google.permission.LOGIN)
     * @param permName The fully qualified name (i.e. com.google.permission.LOGIN)
     *            of the permission you are interested in.
     *            of the permission you are interested in.
     * @param flags Additional option flags to modify the data returned.
     * @param flags Additional option flags to modify the data returned.
     * @return Returns a {@link PermissionInfo} containing information about the
     * @return Returns a {@link PermissionInfo} containing information about the
@@ -3579,7 +3579,7 @@ public abstract class PackageManager {
     * @throws NameNotFoundException if a package with the given name cannot be
     * @throws NameNotFoundException if a package with the given name cannot be
     *             found on the system.
     *             found on the system.
     */
     */
    public abstract PermissionInfo getPermissionInfo(@NonNull String permissionName,
    public abstract PermissionInfo getPermissionInfo(@NonNull String permName,
            @PermissionInfoFlags int flags) throws NameNotFoundException;
            @PermissionInfoFlags int flags) throws NameNotFoundException;


    /**
    /**
@@ -3620,7 +3620,7 @@ public abstract class PackageManager {
     * Retrieve all of the information we know about a particular group of
     * Retrieve all of the information we know about a particular group of
     * permissions.
     * permissions.
     *
     *
     * @param permissionName The fully qualified name (i.e.
     * @param permName The fully qualified name (i.e.
     *            com.google.permission_group.APPS) of the permission you are
     *            com.google.permission_group.APPS) of the permission you are
     *            interested in.
     *            interested in.
     * @param flags Additional option flags to modify the data returned.
     * @param flags Additional option flags to modify the data returned.
@@ -3630,7 +3630,7 @@ public abstract class PackageManager {
     *             found on the system.
     *             found on the system.
     */
     */
    @NonNull
    @NonNull
    public abstract PermissionGroupInfo getPermissionGroupInfo(@NonNull String permissionName,
    public abstract PermissionGroupInfo getPermissionGroupInfo(@NonNull String permName,
            @PermissionGroupInfoFlags int flags) throws NameNotFoundException;
            @PermissionGroupInfoFlags int flags) throws NameNotFoundException;


    /**
    /**
@@ -3858,7 +3858,7 @@ public abstract class PackageManager {
     * Check whether a particular package has been granted a particular
     * Check whether a particular package has been granted a particular
     * permission.
     * permission.
     *
     *
     * @param permissionName The name of the permission you are checking for.
     * @param permName The name of the permission you are checking for.
     * @param packageName The name of the package you are checking against.
     * @param packageName The name of the package you are checking against.
     *
     *
     * @return If the package has the permission, PERMISSION_GRANTED is
     * @return If the package has the permission, PERMISSION_GRANTED is
@@ -3870,7 +3870,7 @@ public abstract class PackageManager {
     */
     */
    @CheckResult
    @CheckResult
    @PermissionResult
    @PermissionResult
    public abstract int checkPermission(@NonNull String permissionName,
    public abstract int checkPermission(@NonNull String permName,
            @NonNull String packageName);
            @NonNull String packageName);


    /**
    /**
@@ -3880,13 +3880,13 @@ public abstract class PackageManager {
     * permissions, hence the only way for an app to get such a permission
     * permissions, hence the only way for an app to get such a permission
     * is by a policy change.
     * is by a policy change.
     *
     *
     * @param permissionName The name of the permission you are checking for.
     * @param permName The name of the permission you are checking for.
     * @param packageName The name of the package you are checking against.
     * @param packageName The name of the package you are checking against.
     *
     *
     * @return Whether the permission is restricted by policy.
     * @return Whether the permission is restricted by policy.
     */
     */
    @CheckResult
    @CheckResult
    public abstract boolean isPermissionRevokedByPolicy(@NonNull String permissionName,
    public abstract boolean isPermissionRevokedByPolicy(@NonNull String permName,
            @NonNull String packageName);
            @NonNull String packageName);


    /**
    /**
@@ -3949,14 +3949,14 @@ public abstract class PackageManager {
     * -- you are only allowed to remove permissions that you are allowed
     * -- you are only allowed to remove permissions that you are allowed
     * to add.
     * to add.
     *
     *
     * @param permissionName The name of the permission to remove.
     * @param permName The name of the permission to remove.
     *
     *
     * @throws SecurityException if you are not allowed to remove the
     * @throws SecurityException if you are not allowed to remove the
     * given permission name.
     * given permission name.
     *
     *
     * @see #addPermission(PermissionInfo)
     * @see #addPermission(PermissionInfo)
     */
     */
    public abstract void removePermission(@NonNull String permissionName);
    public abstract void removePermission(@NonNull String permName);


    /**
    /**
     * Permission flags set when granting or revoking a permission.
     * Permission flags set when granting or revoking a permission.
@@ -3998,7 +3998,7 @@ public abstract class PackageManager {
     * </p>
     * </p>
     *
     *
     * @param packageName The package to which to grant the permission.
     * @param packageName The package to which to grant the permission.
     * @param permissionName The permission name to grant.
     * @param permName The permission name to grant.
     * @param user The user for which to grant the permission.
     * @param user The user for which to grant the permission.
     *
     *
     * @see #revokeRuntimePermission(String, String, android.os.UserHandle)
     * @see #revokeRuntimePermission(String, String, android.os.UserHandle)
@@ -4009,7 +4009,7 @@ public abstract class PackageManager {
    @SystemApi
    @SystemApi
    @RequiresPermission(android.Manifest.permission.GRANT_RUNTIME_PERMISSIONS)
    @RequiresPermission(android.Manifest.permission.GRANT_RUNTIME_PERMISSIONS)
    public abstract void grantRuntimePermission(@NonNull String packageName,
    public abstract void grantRuntimePermission(@NonNull String packageName,
            @NonNull String permissionName, @NonNull UserHandle user);
            @NonNull String permName, @NonNull UserHandle user);


    /**
    /**
     * Revoke a runtime permission that was previously granted by {@link
     * Revoke a runtime permission that was previously granted by {@link
@@ -4025,7 +4025,7 @@ public abstract class PackageManager {
     * </p>
     * </p>
     *
     *
     * @param packageName The package from which to revoke the permission.
     * @param packageName The package from which to revoke the permission.
     * @param permissionName The permission name to revoke.
     * @param permName The permission name to revoke.
     * @param user The user for which to revoke the permission.
     * @param user The user for which to revoke the permission.
     *
     *
     * @see #grantRuntimePermission(String, String, android.os.UserHandle)
     * @see #grantRuntimePermission(String, String, android.os.UserHandle)
@@ -4036,12 +4036,12 @@ public abstract class PackageManager {
    @SystemApi
    @SystemApi
    @RequiresPermission(android.Manifest.permission.REVOKE_RUNTIME_PERMISSIONS)
    @RequiresPermission(android.Manifest.permission.REVOKE_RUNTIME_PERMISSIONS)
    public abstract void revokeRuntimePermission(@NonNull String packageName,
    public abstract void revokeRuntimePermission(@NonNull String packageName,
            @NonNull String permissionName, @NonNull UserHandle user);
            @NonNull String permName, @NonNull UserHandle user);


    /**
    /**
     * Gets the state flags associated with a permission.
     * Gets the state flags associated with a permission.
     *
     *
     * @param permissionName The permission for which to get the flags.
     * @param permName The permission for which to get the flags.
     * @param packageName The package name for which to get the flags.
     * @param packageName The package name for which to get the flags.
     * @param user The user for which to get permission flags.
     * @param user The user for which to get permission flags.
     * @return The permission flags.
     * @return The permission flags.
@@ -4056,14 +4056,14 @@ public abstract class PackageManager {
            android.Manifest.permission.GET_RUNTIME_PERMISSIONS
            android.Manifest.permission.GET_RUNTIME_PERMISSIONS
    })
    })
    @PermissionFlags
    @PermissionFlags
    public abstract int getPermissionFlags(@NonNull String permissionName,
    public abstract int getPermissionFlags(@NonNull String permName,
            @NonNull String packageName, @NonNull UserHandle user);
            @NonNull String packageName, @NonNull UserHandle user);


    /**
    /**
     * Updates the flags associated with a permission by replacing the flags in
     * Updates the flags associated with a permission by replacing the flags in
     * the specified mask with the provided flag values.
     * the specified mask with the provided flag values.
     *
     *
     * @param permissionName The permission for which to update the flags.
     * @param permName The permission for which to update the flags.
     * @param packageName The package name for which to update the flags.
     * @param packageName The package name for which to update the flags.
     * @param flagMask The flags which to replace.
     * @param flagMask The flags which to replace.
     * @param flagValues The flags with which to replace.
     * @param flagValues The flags with which to replace.
@@ -4077,7 +4077,7 @@ public abstract class PackageManager {
            android.Manifest.permission.GRANT_RUNTIME_PERMISSIONS,
            android.Manifest.permission.GRANT_RUNTIME_PERMISSIONS,
            android.Manifest.permission.REVOKE_RUNTIME_PERMISSIONS
            android.Manifest.permission.REVOKE_RUNTIME_PERMISSIONS
    })
    })
    public abstract void updatePermissionFlags(@NonNull String permissionName,
    public abstract void updatePermissionFlags(@NonNull String permName,
            @NonNull String packageName, @PermissionFlags int flagMask,
            @NonNull String packageName, @PermissionFlags int flagMask,
            @PermissionFlags int flagValues, @NonNull UserHandle user);
            @PermissionFlags int flagValues, @NonNull UserHandle user);


@@ -4164,7 +4164,7 @@ public abstract class PackageManager {
     * provided ones.
     * provided ones.
     *
     *
     * @param packageName The app for which to get whitelisted permissions.
     * @param packageName The app for which to get whitelisted permissions.
     * @param permission The whitelisted permission to add.
     * @param permName The whitelisted permission to add.
     * @param whitelistFlags The whitelists to which to add. Passing multiple flags
     * @param whitelistFlags The whitelists to which to add. Passing multiple flags
     * updates all specified whitelists.
     * updates all specified whitelists.
     * @return Whether the permission was added to the whitelist.
     * @return Whether the permission was added to the whitelist.
@@ -4180,7 +4180,7 @@ public abstract class PackageManager {
    @RequiresPermission(value = Manifest.permission.WHITELIST_RESTRICTED_PERMISSIONS,
    @RequiresPermission(value = Manifest.permission.WHITELIST_RESTRICTED_PERMISSIONS,
            conditional = true)
            conditional = true)
    public boolean addWhitelistedRestrictedPermission(@NonNull String packageName,
    public boolean addWhitelistedRestrictedPermission(@NonNull String packageName,
            @NonNull String permission, @PermissionWhitelistFlags int whitelistFlags) {
            @NonNull String permName, @PermissionWhitelistFlags int whitelistFlags) {
        return false;
        return false;
    }
    }


@@ -4218,7 +4218,7 @@ public abstract class PackageManager {
     * provided ones.
     * provided ones.
     *
     *
     * @param packageName The app for which to get whitelisted permissions.
     * @param packageName The app for which to get whitelisted permissions.
     * @param permission The whitelisted permission to remove.
     * @param permName The whitelisted permission to remove.
     * @param whitelistFlags The whitelists from which to remove. Passing multiple flags
     * @param whitelistFlags The whitelists from which to remove. Passing multiple flags
     * updates all specified whitelists.
     * updates all specified whitelists.
     * @return Whether the permission was removed from the whitelist.
     * @return Whether the permission was removed from the whitelist.
@@ -4234,7 +4234,7 @@ public abstract class PackageManager {
    @RequiresPermission(value = Manifest.permission.WHITELIST_RESTRICTED_PERMISSIONS,
    @RequiresPermission(value = Manifest.permission.WHITELIST_RESTRICTED_PERMISSIONS,
        conditional = true)
        conditional = true)
    public boolean removeWhitelistedRestrictedPermission(@NonNull String packageName,
    public boolean removeWhitelistedRestrictedPermission(@NonNull String packageName,
        @NonNull String permission, @PermissionWhitelistFlags int whitelistFlags) {
            @NonNull String permName, @PermissionWhitelistFlags int whitelistFlags) {
        return false;
        return false;
    }
    }


@@ -4244,13 +4244,13 @@ public abstract class PackageManager {
     * which the permission is requested does not clearly communicate to the user
     * which the permission is requested does not clearly communicate to the user
     * what would be the benefit from grating this permission.
     * what would be the benefit from grating this permission.
     *
     *
     * @param permissionName A permission your app wants to request.
     * @param permName A permission your app wants to request.
     * @return Whether you can show permission rationale UI.
     * @return Whether you can show permission rationale UI.
     *
     *
     * @hide
     * @hide
     */
     */
    @UnsupportedAppUsage
    @UnsupportedAppUsage
    public abstract boolean shouldShowRequestPermissionRationale(@NonNull String permissionName);
    public abstract boolean shouldShowRequestPermissionRationale(@NonNull String permName);


    /**
    /**
     * Returns an {@link android.content.Intent} suitable for passing to
     * Returns an {@link android.content.Intent} suitable for passing to
+15 −172
Original line number Original line Diff line number Diff line
@@ -83,139 +83,6 @@ public abstract class PackageManagerInternal {
        void onPackageRemoved(@NonNull String packageName, int uid);
        void onPackageRemoved(@NonNull String packageName, int uid);
    }
    }


    /**
     * Provider for package names.
     */
    public interface PackagesProvider {

        /**
         * Gets the packages for a given user.
         * @param userId The user id.
         * @return The package names.
         */
        public String[] getPackages(int userId);
    }

    /**
     * Provider for package names.
     */
    public interface SyncAdapterPackagesProvider {

        /**
         * Gets the sync adapter packages for given authority and user.
         * @param authority The authority.
         * @param userId The user id.
         * @return The package names.
         */
        public String[] getPackages(String authority, int userId);
    }

    /**
     * Provider for default browser
     */
    public interface DefaultBrowserProvider {

        /**
         * Get the package name of the default browser.
         *
         * @param userId the user id
         *
         * @return the package name of the default browser, or {@code null} if none
         */
        @Nullable
        String getDefaultBrowser(@UserIdInt int userId);

        /**
         * Set the package name of the default browser.
         *
         * @param packageName package name of the default browser, or {@code null} to remove
         * @param userId the user id
         *
         * @return whether the default browser was successfully set.
         */
        boolean setDefaultBrowser(@Nullable String packageName, @UserIdInt int userId);

        /**
         * Set the package name of the default browser asynchronously.
         *
         * @param packageName package name of the default browser, or {@code null} to remove
         * @param userId the user id
         */
        void setDefaultBrowserAsync(@Nullable String packageName, @UserIdInt int userId);
    }

    /**
     * Provider for default dialer
     */
    public interface DefaultDialerProvider {

        /**
         * Get the package name of the default dialer.
         *
         * @param userId the user id
         *
         * @return the package name of the default dialer, or {@code null} if none
         */
        @Nullable
        String getDefaultDialer(@UserIdInt int userId);
    }

    /**
     * Provider for default home
     */
    public interface DefaultHomeProvider {

        /**
         * Get the package name of the default home.
         *
         * @param userId the user id
         *
         * @return the package name of the default home, or {@code null} if none
         */
        @Nullable
        String getDefaultHome(@UserIdInt int userId);

        /**
         * Set the package name of the default home.
         *
         * @param packageName package name of the default home, or {@code null} to remove
         * @param userId the user id
         * @param callback the callback made after the default home as been updated
         */
        void setDefaultHomeAsync(@Nullable String packageName, @UserIdInt int userId,
                @NonNull Consumer<Boolean> callback);
    }

    /**
     * Sets the location provider packages provider.
     * @param provider The packages provider.
     */
    public abstract void setLocationPackagesProvider(PackagesProvider provider);

    /**
     * Set the location extra packages provider.
     * @param provider The packages provider.
     */
    public abstract  void setLocationExtraPackagesProvider(PackagesProvider provider);

    /**
     * Sets the voice interaction packages provider.
     * @param provider The packages provider.
     */
    public abstract void setVoiceInteractionPackagesProvider(PackagesProvider provider);

    /**
     * Sets the Use Open Wifi packages provider.
     * @param provider The packages provider.
     */
    public abstract void setUseOpenWifiAppPackagesProvider(PackagesProvider provider);

    /**
     * Sets the sync adapter packages provider.
     * @param provider The provider.
     */
    public abstract void setSyncAdapterPackagesprovider(SyncAdapterPackagesProvider provider);

    /**
    /**
     * Called when the package for the default SMS handler changed
     * Called when the package for the default SMS handler changed
     *
     *
@@ -232,14 +99,6 @@ public abstract class PackageManagerInternal {
     */
     */
    public void onDefaultSimCallManagerAppChanged(String packageName, int userId) {}
    public void onDefaultSimCallManagerAppChanged(String packageName, int userId) {}


    /**
     * Requests granting of the default permissions to the current default Use Open Wifi app.
     * @param packageName The default use open wifi package name.
     * @param userId The user for which to grant the permissions.
     */
    public abstract void grantDefaultPermissionsToDefaultUseOpenWifiApp(String packageName,
            int userId);

    /**
    /**
     * Sets a list of apps to keep in PM's internal data structures and as APKs even if no user has
     * Sets a list of apps to keep in PM's internal data structures and as APKs even if no user has
     * currently installed it. The apps are not preloaded.
     * currently installed it. The apps are not preloaded.
@@ -697,7 +556,15 @@ public abstract class PackageManagerInternal {
     * @see #canAccessInstantApps
     * @see #canAccessInstantApps
     */
     */
    public abstract boolean filterAppAccess(
    public abstract boolean filterAppAccess(
            @Nullable PackageParser.Package pkg, int callingUid, int userId);
            @NonNull PackageParser.Package pkg, int callingUid, int userId);

    /**
     * Returns whether or not access to the application should be filtered.
     *
     * @see #filterAppAccess(android.content.pm.PackageParser.Package, int, int)
     */
    public abstract boolean filterAppAccess(
            @NonNull String packageName, int callingUid, int userId);


    /** Returns whether the given package was signed by the platform */
    /** Returns whether the given package was signed by the platform */
    public abstract boolean isPlatformSigned(String pkg);
    public abstract boolean isPlatformSigned(String pkg);
@@ -871,27 +738,6 @@ public abstract class PackageManagerInternal {
    @Nullable
    @Nullable
    public abstract String removeLegacyDefaultBrowserPackageName(int userId);
    public abstract String removeLegacyDefaultBrowserPackageName(int userId);


    /**
     * Sets the default browser provider.
     *
     * @param provider the provider
     */
    public abstract void setDefaultBrowserProvider(@NonNull DefaultBrowserProvider provider);

    /**
     * Sets the default dialer provider.
     *
     * @param provider the provider
     */
    public abstract void setDefaultDialerProvider(@NonNull DefaultDialerProvider provider);

    /**
     * Sets the default home provider.
     *
     * @param provider the provider
     */
    public abstract void setDefaultHomeProvider(@NonNull DefaultHomeProvider provider);

    /**
    /**
     * Returns {@code true} if given {@code packageName} is an apex package.
     * Returns {@code true} if given {@code packageName} is an apex package.
     */
     */
@@ -909,15 +755,6 @@ public abstract class PackageManagerInternal {
    public abstract void uninstallApex(String packageName, long versionCode, int userId,
    public abstract void uninstallApex(String packageName, long versionCode, int userId,
            IntentSender intentSender);
            IntentSender intentSender);


    /**
     * Whether default permission grants have been performed for a user
     * since the device booted.
     *
     * @param userId The user id.
     * @return true if default permissions
     */
    public abstract boolean wereDefaultPermissionsGrantedSinceBoot(int userId);

    /**
    /**
     * Get fingerprint of build that updated the runtime permissions for a user.
     * Get fingerprint of build that updated the runtime permissions for a user.
     *
     *
@@ -960,4 +797,10 @@ public abstract class PackageManagerInternal {
     */
     */
    public abstract boolean isCallerInstallerOfRecord(
    public abstract boolean isCallerInstallerOfRecord(
            @NonNull PackageParser.Package pkg, int callingUid);
            @NonNull PackageParser.Package pkg, int callingUid);

    /** Returns whether or not default runtime permissions are granted for the given user */
    public abstract boolean areDefaultRuntimePermissionsGranted(@UserIdInt int userId);

    /** Sets the enforcement of reading external storage */
    public abstract void setReadExternalStorageEnforced(boolean enforced);
}
}
+27 −0
Original line number Original line Diff line number Diff line
@@ -70,4 +70,31 @@ interface IPermissionManager {
    void revokeRuntimePermission(String packageName, String permName, int userId);
    void revokeRuntimePermission(String packageName, String permName, int userId);


    void resetRuntimePermissions();
    void resetRuntimePermissions();

    boolean setDefaultBrowser(String packageName, int userId);

    String getDefaultBrowser(int userId);

    void grantDefaultPermissionsToEnabledCarrierApps(in String[] packageNames, int userId);

    void grantDefaultPermissionsToEnabledImsServices(in String[] packageNames, int userId);

    void grantDefaultPermissionsToEnabledTelephonyDataServices(
            in String[] packageNames, int userId);

    void revokeDefaultPermissionsFromDisabledTelephonyDataServices(
            in String[] packageNames, int userId);

    void grantDefaultPermissionsToActiveLuiApp(in String packageName, int userId);

    void revokeDefaultPermissionsFromLuiApps(in String[] packageNames, int userId);

    void setPermissionEnforced(String permName, boolean enforced);

    boolean isPermissionEnforced(String permName);

    boolean shouldShowRequestPermissionRationale(String permName,
            String packageName, int userId);

    boolean isPermissionRevokedByPolicy(String permName, String packageName, int userId);
}
}
Loading