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

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

Snap for 6864616 from d3d88afe to rvc-qpr1-release

Change-Id: I107bc46efdeedeb792cbd03295aa0fd91fb76a3e
parents d79ddf85 d3d88afe
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1922,6 +1922,7 @@
            <intent-filter android:priority="1">
                <action android:name="android.settings.APPLICATION_DEVELOPMENT_SETTINGS" />
                <action android:name="com.android.settings.APPLICATION_DEVELOPMENT_SETTINGS" />
                <action android:name="android.service.quicksettings.action.QS_TILE_PREFERENCES"/>
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
            <intent-filter>
+1 −1
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:theme="@style/GlifV3Theme.Light"
    android:theme="@style/GlifV3Theme"
    android:icon="@drawable/ic_scan_32dp">

    <LinearLayout
+33 −0
Original line number Diff line number Diff line
@@ -18,6 +18,10 @@ package com.android.settings;

import static android.content.Intent.EXTRA_USER;
import static android.content.Intent.EXTRA_USER_ID;
import static android.media.MediaRoute2Info.TYPE_GROUP;
import static android.media.MediaRoute2Info.TYPE_REMOTE_SPEAKER;
import static android.media.MediaRoute2Info.TYPE_REMOTE_TV;
import static android.media.MediaRoute2Info.TYPE_UNKNOWN;
import static android.text.format.DateUtils.FORMAT_ABBREV_MONTH;
import static android.text.format.DateUtils.FORMAT_SHOW_DATE;

@@ -53,6 +57,8 @@ import android.graphics.drawable.Drawable;
import android.graphics.drawable.VectorDrawable;
import android.hardware.face.FaceManager;
import android.hardware.fingerprint.FingerprintManager;
import android.media.MediaRoute2Info;
import android.media.MediaRouter2Manager;
import android.net.ConnectivityManager;
import android.net.LinkProperties;
import android.net.Network;
@@ -1137,4 +1143,31 @@ public final class Utils extends com.android.settingslib.Utils {
        drawable.draw(canvas);
        return roundedBitmap;
    }

    /**
     * Returns {@code true} if needed to disable media output, otherwise returns {@code false}.
     */
    public static boolean isMediaOutputDisabled(
            MediaRouter2Manager router2Manager, String packageName) {
        boolean isMediaOutputDisabled = false;
        if (!TextUtils.isEmpty(packageName)) {
            final List<MediaRoute2Info> infos = router2Manager.getAvailableRoutes(packageName);
            if (infos.size() == 1) {
                final MediaRoute2Info info = infos.get(0);
                final int deviceType = info.getType();
                switch (deviceType) {
                    case TYPE_UNKNOWN:
                    case TYPE_REMOTE_TV:
                    case TYPE_REMOTE_SPEAKER:
                    case TYPE_GROUP:
                        isMediaOutputDisabled = true;
                        break;
                    default:
                        isMediaOutputDisabled = false;
                        break;
                }
            }
        }
        return isMediaOutputDisabled;
    }
}
+37 −0
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

package com.android.settings.development;

import static android.service.quicksettings.TileService.ACTION_QS_TILE_PREFERENCES;

import android.app.Activity;
import android.app.settings.SettingsEnums;
import android.bluetooth.BluetoothA2dp;
@@ -23,12 +25,14 @@ import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothCodecStatus;
import android.bluetooth.BluetoothProfile;
import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.os.SystemProperties;
import android.os.UserManager;
import android.text.TextUtils;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
@@ -41,6 +45,7 @@ import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import com.android.settings.R;
import com.android.settings.SettingsActivity;
import com.android.settings.Utils;
import com.android.settings.core.SubSettingLauncher;
import com.android.settings.dashboard.RestrictedDashboardFragment;
import com.android.settings.development.autofill.AutofillLoggingLevelPreferenceController;
import com.android.settings.development.autofill.AutofillResetOptionsPreferenceController;
@@ -52,6 +57,7 @@ import com.android.settings.development.bluetooth.BluetoothCodecDialogPreference
import com.android.settings.development.bluetooth.BluetoothHDAudioPreferenceController;
import com.android.settings.development.bluetooth.BluetoothQualityDialogPreferenceController;
import com.android.settings.development.bluetooth.BluetoothSampleRateDialogPreferenceController;
import com.android.settings.development.qstile.DevelopmentTiles;
import com.android.settings.development.storage.SharedDataPreferenceController;
import com.android.settings.search.BaseSearchIndexProvider;
import com.android.settings.widget.SwitchBar;
@@ -199,11 +205,42 @@ public class DevelopmentSettingsDashboardFragment extends RestrictedDashboardFra
        // Restore UI state based on whether developer options is enabled
        if (DevelopmentSettingsEnabler.isDevelopmentSettingsEnabled(getContext())) {
            enableDeveloperOptions();
            handleQsTileLongPressActionIfAny();
        } else {
            disableDeveloperOptions();
        }
    }

    /**
     * Long-pressing a developer options quick settings tile will by default (see
     * QS_TILE_PREFERENCES in the manifest) take you to the developer options page.
     * Some tiles may want to go into their own page within the developer options.
     */
    private void handleQsTileLongPressActionIfAny() {
        Intent intent = getActivity().getIntent();
        if (intent == null || !TextUtils.equals(ACTION_QS_TILE_PREFERENCES, intent.getAction())) {
            return;
        }

        Log.d(TAG, "Developer options started from qstile long-press");
        final ComponentName componentName = (ComponentName) intent.getParcelableExtra(
                Intent.EXTRA_COMPONENT_NAME);
        if (componentName == null) {
            return;
        }

        if (DevelopmentTiles.WirelessDebugging.class.getName().equals(
                componentName.getClassName()) && getDevelopmentOptionsController(
                    WirelessDebuggingPreferenceController.class).isAvailable()) {
            Log.d(TAG, "Long press from wireless debugging qstile");
            new SubSettingLauncher(getContext())
                    .setDestination(WirelessDebuggingFragment.class.getName())
                    .setSourceMetricsCategory(SettingsEnums.SETTINGS_ADB_WIRELESS)
                    .launch();
        }
        // Add other qstiles here
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
            Bundle savedInstanceState) {
+11 −2
Original line number Diff line number Diff line
@@ -266,6 +266,15 @@ public class ContextualCardManager implements ContextualCardLoader.CardContentLo
                    SettingsEnums.ACTION_CONTEXTUAL_CARD_LOAD_TIMEOUT,
                    SettingsEnums.SETTINGS_HOMEPAGE,
                    null /* key */, (int) loadTime /* value */);

            // display a card on timeout if the one-card space is pre-allocated
            if (!cards.isEmpty() && ContextualCardLoader.getCardCount(mContext) == 1) {
                onContextualCardUpdated(cards.stream()
                        .collect(groupingBy(ContextualCard::getCardType)));
                metricsFeatureProvider.action(mContext,
                        SettingsEnums.ACTION_CONTEXTUAL_CARD_SHOW,
                        ContextualCardLogUtils.buildCardListLog(cards));
            }
        }
        // only log homepage display upon a fresh launch
        final long totalTime = System.currentTimeMillis() - mStartTime;
Loading