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

Commit 739adc6c authored by Nate Myren's avatar Nate Myren Committed by Automerger Merge Worker
Browse files

Merge "Add defaultSearchSelector config and default grant" into tm-dev am: 1e223738

parents 98323148 1e223738
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1864,6 +1864,11 @@
     -->
    <string name="config_defaultNetworkRecommendationProviderPackage" translatable="false"></string>

    <!-- The package name of the default search selector app. Must be granted the POST_NOTIFICATIONS
         permission.
    -->
    <string name="config_defaultSearchSelectorPackageName" 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
@@ -3413,6 +3413,9 @@
  <!-- Network Recommendation -->
  <java-symbol type="string" name="config_defaultNetworkRecommendationProviderPackage" />

  <!-- Search Selector -->
  <java-symbol type="string" name="config_defaultSearchSelectorPackageName" />

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

+8 −0
Original line number Diff line number Diff line
@@ -613,6 +613,10 @@ final class DefaultPermissionGrantPolicy {
                    pm, setupWizardPackage, userId, NEARBY_DEVICES_PERMISSIONS);
        }

        // SearchSelector
        grantPermissionsToSystemPackage(pm, getDefaultSearchSelectorPackage(), userId,
                NOTIFICATION_PERMISSIONS);

        // Camera
        grantPermissionsToSystemPackage(pm,
                getDefaultSystemHandlerActivityPackage(pm, MediaStore.ACTION_IMAGE_CAPTURE, userId),
@@ -941,6 +945,10 @@ final class DefaultPermissionGrantPolicy {
                new Intent(Intent.ACTION_MAIN).addCategory(category), userId);
    }

    private String getDefaultSearchSelectorPackage() {
        return mContext.getString(R.string.config_defaultSearchSelectorPackageName);
    }

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