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

Commit 5cd368b4 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 5606001 from 41c7a484 to qt-qpr1-release

Change-Id: I54ef397faded1e4910523b17ac39c884b0847987
parents 95701515 41c7a484
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -743,7 +743,6 @@
    <!-- Title for page of managing default apps. [CHAR LIMIT=30] -->
    <string name="default_apps">Default apps</string>

    <!-- TODO: STOPSHIP: I cannot find its value in Settings. -->
    <!-- Help URI, default apps [DO NOT TRANSLATE] -->
    <string name="help_uri_default_apps" translatable="false"></string>

@@ -780,7 +779,6 @@
    <!-- Title for page of managing special app access. [CHAR LIMIT=30] -->
    <string name="special_app_access">Special app access</string>

    <!-- TODO: STOPSHIP: I cannot find its value in Settings. -->
    <!-- Help URI, special app access [DO NOT TRANSLATE] -->
    <string name="help_uri_special_app_access" translatable="false"></string>

+0 −1
Original line number Diff line number Diff line
@@ -52,7 +52,6 @@
            parent="@android:style/Theme.DeviceDefault.Settings">
    </style>

    <!-- TODO: STOPSHIP: Make themeable? -->
    <style name="RequestRole" parent="android:Theme.DeviceDefault.Settings">
        <item name="android:colorBackgroundCacheHint">@null</item>
        <item name="android:navigationBarColor">@android:color/transparent</item>
+10 −3
Original line number Diff line number Diff line
@@ -109,7 +109,6 @@
            -->
        </required-components>
        <permissions>
            <!-- STOPSHIP: Allow to only enable permissions, but not grant them -->
            <permission-set name="sms" />
            <permission name="android.permission.READ_CALL_LOG" />
        </permissions>
@@ -198,6 +197,16 @@
            <app-op name="android:run_any_in_background" mode="allowed" />
        </app-ops>
        <preferred-activities>
            <preferred-activity>
                <activity>
                    <intent-filter>
                        <action name="android.intent.action.DIAL" />
                    </intent-filter>
                </activity>
                <intent-filter>
                    <action name="android.intent.action.DIAL" />
                </intent-filter>
            </preferred-activity>
            <preferred-activity>
                <activity>
                    <intent-filter>
@@ -205,7 +214,6 @@
                        <data scheme="tel" />
                    </intent-filter>
                </activity>
                <!-- TODO: STOPSHIP: Set preferred? -->
                <intent-filter>
                    <action name="android.intent.action.DIAL" />
                    <data scheme="tel" />
@@ -300,7 +308,6 @@
        </preferred-activities>
    </role>

    <!-- TODO: STOPSHIP: Intent action sometimes changing dynamically in com.android.phone.EmergencyAssistanceHelper.getIntentAction -->
    <!---
      ~ @see com.android.settings.applications.defaultapps.DefaultEmergencyPreferenceController
      ~ @see com.android.settings.applications.defaultapps.DefaultEmergencyPicker
+61 −23
Original line number Diff line number Diff line
@@ -38,7 +38,7 @@ class RuntimePermissionsUpgradeController {
    private static final String LOG_TAG = RuntimePermissionsUpgradeController.class.getSimpleName();

    // The latest version of the runtime permissions database
    private static final int LATEST_VERSION = 3;
    private static final int LATEST_VERSION = 4;

    private RuntimePermissionsUpgradeController() {
        /* do nothing - hide constructor */
@@ -78,7 +78,18 @@ class RuntimePermissionsUpgradeController {
                        | PackageManager.GET_PERMISSIONS);
        final int appCount = apps.size();

        if (currentVersion <= 0) {
        final boolean sdkUpgradedFromP;
        if (currentVersion <= -1) {
            Log.i(LOG_TAG, "Upgrading from Android P");

            sdkUpgradedFromP = true;

            currentVersion = 0;
        } else {
            sdkUpgradedFromP = false;
        }

        if (currentVersion == 0) {
            Log.i(LOG_TAG, "Grandfathering SMS and CallLog permissions");

            final List<String> smsPermissions = Utils.getPlatformPermissionNamesOfGroup(
@@ -105,6 +116,7 @@ class RuntimePermissionsUpgradeController {
        }

        if (currentVersion == 1) {
            if (sdkUpgradedFromP) {
                Log.i(LOG_TAG, "Expanding location permissions");

                for (int i = 0; i < appCount; i++) {
@@ -120,8 +132,8 @@ class RuntimePermissionsUpgradeController {
                            continue;
                        }

                    final AppPermissionGroup group = AppPermissionGroup.create(context, app, perm,
                            false);
                        final AppPermissionGroup group = AppPermissionGroup.create(context, app,
                                perm, false);
                        final AppPermissionGroup bgGroup = group.getBackgroundPermissions();

                        if (group.areRuntimePermissionsGranted()
@@ -134,6 +146,10 @@ class RuntimePermissionsUpgradeController {
                        break;
                    }
                }
            } else {
                Log.i(LOG_TAG, "Not expanding location permissions as this is not an upgrade "
                        + "from Android P");
            }

            currentVersion = 2;
        }
@@ -163,6 +179,28 @@ class RuntimePermissionsUpgradeController {
            currentVersion = 3;
        }

        if (currentVersion == 3) {
            Log.i(LOG_TAG, "Grandfathering location background permissions");

            for (int i = 0; i < appCount; i++) {
                final PackageInfo app = apps.get(i);
                if (app.requestedPermissions == null) {
                    continue;
                }

                for (String requestedPermission : app.requestedPermissions) {
                    if (requestedPermission.equals(
                            Manifest.permission.ACCESS_BACKGROUND_LOCATION)) {
                        context.getPackageManager().addWhitelistedRestrictedPermission(
                                app.packageName, Manifest.permission.ACCESS_BACKGROUND_LOCATION,
                                PackageManager.FLAG_PERMISSION_WHITELIST_UPGRADE);
                        break;
                    }
                }
            }
            currentVersion = 4;
        }

        // XXX: Add new upgrade steps above this point.

        return currentVersion;
+9 −3
Original line number Diff line number Diff line
@@ -51,7 +51,9 @@ public class SmsRoleBehavior implements RoleBehavior {
            return false;
        }
        TelephonyManager telephonyManager = context.getSystemService(TelephonyManager.class);
        if (!telephonyManager.isSmsCapable()) {
        if (!telephonyManager.isSmsCapable()
                // Ensure sms role is present on car despite !isSmsCapable config (b/132972702)
                && getDefaultHolder(role, context) == null) {
            return false;
        }
        return true;
@@ -60,8 +62,7 @@ public class SmsRoleBehavior implements RoleBehavior {
    @Nullable
    @Override
    public String getFallbackHolder(@NonNull Role role, @NonNull Context context) {
        String defaultPackageName = ExclusiveDefaultHolderMixin.getDefaultHolder(role,
                "config_defaultSms", context);
        String defaultPackageName = getDefaultHolder(role, context);
        if (defaultPackageName != null) {
            return defaultPackageName;
        }
@@ -74,6 +75,11 @@ public class SmsRoleBehavior implements RoleBehavior {
        return CollectionUtils.firstOrNull(qualifyingPackageNames);
    }

    @Nullable
    private static String getDefaultHolder(@NonNull Role role, @NonNull Context context) {
        return ExclusiveDefaultHolderMixin.getDefaultHolder(role, "config_defaultSms", context);
    }

    @Nullable
    @Override
    public CharSequence getConfirmationMessage(@NonNull Role role, @NonNull String packageName,