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

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

Merge "Allow Wear Fitness tracker app to request for permissions."

parents 1f6275fd 0998c789
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -4522,4 +4522,7 @@

    <!-- If true, hide the display cutout with display area -->
    <bool name="config_hideDisplayCutoutWithDisplayArea">false</bool>

    <!-- Indicates that default fitness tracker app needs to request sensor and location permissions. -->
    <bool name="config_trackerAppNeedsPermissions">false</bool>
</resources>
+3 −0
Original line number Diff line number Diff line
@@ -4103,4 +4103,7 @@
  <java-symbol type="string" name="window_magnification_prompt_content" />
  <java-symbol type="string" name="turn_on_magnification_settings_action" />
  <java-symbol type="string" name="dismiss_action" />

  <java-symbol type="bool" name="config_trackerAppNeedsPermissions"/>

</resources>
+7 −1
Original line number Diff line number Diff line
@@ -63,6 +63,7 @@ import android.util.SparseArray;
import android.util.TypedXmlPullParser;
import android.util.Xml;

import com.android.internal.R;
import com.android.internal.util.ArrayUtils;
import com.android.internal.util.XmlUtils;
import com.android.server.LocalServices;
@@ -766,10 +767,15 @@ public final class DefaultPermissionGrantPolicy {
            grantSystemFixedPermissionsToSystemPackage(pm, wearPackage, userId, PHONE_PERMISSIONS);

            // Fitness tracking on watches
            if (mContext.getResources().getBoolean(R.bool.config_trackerAppNeedsPermissions)) {
                Log.d(TAG, "Wear: Skipping permission grant for Default fitness tracker app : "
                        + wearPackage);
            } else {
                grantPermissionsToSystemPackage(pm,
                    getDefaultSystemHandlerActivityPackage(pm, ACTION_TRACK, userId), userId,
                    SENSORS_PERMISSIONS, ALWAYS_LOCATION_PERMISSIONS);
            }
        }

        // Print Spooler
        grantSystemFixedPermissionsToSystemPackage(pm, PrintManager.PRINT_SPOOLER_PACKAGE_NAME,