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

Commit 6e1a8a09 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Add Default grant for Captive Portal Login app" into tm-dev am: 5f951629

parents 8d670cef 5f951629
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1869,6 +1869,11 @@
    -->
    <string name="config_defaultSearchSelectorPackageName" translatable="false"></string>

    <!-- The package name of the default captive portal login app. Must be granted the
         POST_NOTIFICATIONS permission.
    -->
    <string name="config_defaultCaptivePortalLoginPackageName" translatable="false"></string>

    <!-- Whether to enable geocoder overlay which allows geocoder to be replaced
         by an app at run-time. When disabled, only the
         config_geocoderProviderPackageName package will be searched for
+3 −0
Original line number Diff line number Diff line
@@ -3424,6 +3424,9 @@
  <!-- Search Selector -->
  <java-symbol type="string" name="config_defaultSearchSelectorPackageName" />

  <!-- Captive Portal Login -->
  <java-symbol type="string" name="config_defaultCaptivePortalLoginPackageName" />

  <!-- Optional IPsec algorithms -->
  <java-symbol type="array" name="config_optionalIpSecAlgorithms" />

+8 −0
Original line number Diff line number Diff line
@@ -618,6 +618,10 @@ final class DefaultPermissionGrantPolicy {
        grantPermissionsToSystemPackage(pm, getDefaultSearchSelectorPackage(), userId,
                NOTIFICATION_PERMISSIONS);

        // Captive Portal Login
        grantPermissionsToSystemPackage(pm, getDefaultCaptivePortalLoginPackage(), userId,
                NOTIFICATION_PERMISSIONS);

        // Camera
        grantPermissionsToSystemPackage(pm,
                getDefaultSystemHandlerActivityPackage(pm, MediaStore.ACTION_IMAGE_CAPTURE, userId),
@@ -933,6 +937,10 @@ final class DefaultPermissionGrantPolicy {
        return mContext.getString(R.string.config_defaultSearchSelectorPackageName);
    }

    private String getDefaultCaptivePortalLoginPackage() {
        return mContext.getString(R.string.config_defaultCaptivePortalLoginPackageName);
    }

    @SafeVarargs
    private final void grantPermissionToEachSystemPackage(PackageManagerWrapper pm,
            ArrayList<String> packages, int userId, Set<String>... permissions) {