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

Commit 6ae5b0c7 authored by Etienne Ruffieux's avatar Etienne Ruffieux Committed by Android (Google) Code Review
Browse files

Merge "Removing last BluetoothManagerService hidden APIs"

parents f2f23108 fdd95b2b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -22,10 +22,10 @@ import static android.Manifest.permission.BLUETOOTH_ADVERTISE;
import static android.Manifest.permission.BLUETOOTH_CONNECT;
import static android.Manifest.permission.BLUETOOTH_SCAN;
import static android.Manifest.permission.RENOUNCE_PERMISSIONS;
import static android.content.PermissionChecker.PERMISSION_HARD_DENIED;
import static android.content.pm.PackageManager.GET_PERMISSIONS;
import static android.content.pm.PackageManager.PERMISSION_GRANTED;
import static android.os.PowerExemptionManager.TEMPORARY_ALLOW_LIST_TYPE_FOREGROUND_SERVICE_ALLOWED;
import static android.permission.PermissionManager.PERMISSION_HARD_DENIED;

import android.Manifest;
import android.annotation.NonNull;
+2 −8
Original line number Diff line number Diff line
@@ -46,6 +46,7 @@ import android.bluetooth.BluetoothAdapter.ActiveDeviceProfile;
import android.bluetooth.BluetoothAdapter.ActiveDeviceUse;
import android.bluetooth.BluetoothClass;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothFrameworkInitializer;
import android.bluetooth.BluetoothProfile;
import android.bluetooth.BluetoothProtoEnums;
import android.bluetooth.BluetoothServerSocket;
@@ -128,7 +129,6 @@ import com.android.bluetooth.telephony.BluetoothInCallService;
import com.android.bluetooth.vc.VolumeControlService;
import com.android.internal.annotations.GuardedBy;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.os.BinderCallsStats;
import com.android.modules.utils.BackgroundThread;
import com.android.modules.utils.BytesMatcher;
import com.android.modules.utils.SynchronousResultReceiver;
@@ -326,8 +326,6 @@ public class AdapterService extends Service {
    private CsipSetCoordinatorService mCsipSetCoordinatorService;
    private LeAudioService mLeAudioService;

    private BinderCallsStats.SettingsObserver mBinderCallsSettingsObserver;

    private volatile boolean mTestModeEnabled = false;

    private MetricsLogger mMetricsLogger;
@@ -488,11 +486,7 @@ public class AdapterService extends Service {
        int configCompareResult = mBluetoothKeystoreService.getCompareResult();

        // Start tracking Binder latency for the bluetooth process.
        mBinderCallsSettingsObserver = new BinderCallsStats.SettingsObserver(
                getApplicationContext(),
                new BinderCallsStats(
                        new BinderCallsStats.Injector(),
                        com.android.internal.os.BinderLatencyProto.Dims.BLUETOOTH));
        BluetoothFrameworkInitializer.initializeBinderCallsStats(getApplicationContext());

        // Android TV doesn't show consent dialogs for just works and encryption only le pairing
        boolean isAtvDevice = getApplicationContext().getPackageManager().hasSystemFeature(
+1 −1
Original line number Diff line number Diff line
@@ -240,7 +240,7 @@ public class Config {
    }

    private static boolean isHearingAidSettingsEnabled(Context context) {
        final String flagOverridePrefix = "sys.fflag.override.";
        final String flagOverridePrefix = "persist.sys.fflag.override.";
        final String hearingAidSettings = "settings_bluetooth_hearing_aid";

        // Override precedence:
+60 −1
Original line number Diff line number Diff line
@@ -24,7 +24,6 @@ import android.telephony.TelephonyManager;
import android.util.Log;

import com.android.bluetooth.util.GsmAlphabet;
import com.android.internal.telephony.SmsConstants;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
@@ -780,4 +779,64 @@ public class BluetoothMapSmsPdu {
        return tableValue;
    }

    private static class SmsConstants {
        /** User data text encoding code unit size */
        public static final int ENCODING_UNKNOWN = 0;
        public static final int ENCODING_7BIT = 1;
        public static final int ENCODING_8BIT = 2;
        public static final int ENCODING_16BIT = 3;

        /** The maximum number of payload septets per message */
        public static final int MAX_USER_DATA_SEPTETS = 160;

        /**
         * The maximum number of payload septets per message if a user data header
         * is present.  This assumes the header only contains the
         * CONCATENATED_8_BIT_REFERENCE element.
         */
        public static final int MAX_USER_DATA_SEPTETS_WITH_HEADER = 153;

        /**
         * This value is not defined in global standard. Only in Korea, this is used.
         */
        public static final int ENCODING_KSC5601 = 4;

        /** The maximum number of payload bytes per message */
        public static final int MAX_USER_DATA_BYTES = 140;

        /**
         * The maximum number of payload bytes per message if a user data header
         * is present.  This assumes the header only contains the
         * CONCATENATED_8_BIT_REFERENCE element.
         */
        public static final int MAX_USER_DATA_BYTES_WITH_HEADER = 134;

        /**
         * SMS Class enumeration.
         * See TS 23.038.
         */
        public enum MessageClass{
            UNKNOWN,
            CLASS_0,
            CLASS_1,
            CLASS_2,
            CLASS_3;
        }

        /**
         * Indicates unknown format SMS message.
         */
        public static final String FORMAT_UNKNOWN = "unknown";

        /**
         * Indicates a 3GPP format SMS message.
         */
        public static final String FORMAT_3GPP = "3gpp";

        /**
         * Indicates a 3GPP2 format SMS message.
         */
        public static final String FORMAT_3GPP2 = "3gpp2";
    }

}
+2 −2
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@
package com.android.server;

import android.provider.DeviceConfig;
import android.util.Slog;
import android.util.Log;

import java.util.ArrayList;

@@ -57,7 +57,7 @@ class BluetoothDeviceConfigListener {
                        for (String name : properties.getKeyset()) {
                            flags.add(name + "='" + properties.getString(name, "") + "'");
                        }
                        Slog.d(TAG, "onPropertiesChanged: " + String.join(",", flags));
                        Log.d(TAG, "onPropertiesChanged: " + String.join(",", flags));
                    }
                    boolean foundInit = false;
                    for (String name : properties.getKeyset()) {
Loading