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

Commit 252a6197 authored by Svet Ganov's avatar Svet Ganov Committed by Svetoslav
Browse files

Do not report WiFi and Bluetooth MAC addresses - framework.

As a part of the new runtime permissions work we are limiting
the PII apps can access. BT and WiFi MAC addresses are PII and
based on our research there is no valid use case for app dev
to get these addresses aside of user tracking which we are
trying to limit.

bug:21078858

Change-Id: Ib48223b272c0fd4f5c36acc889d4f44df204b309
parent 27ce6cfb
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -95,6 +95,14 @@ public final class BluetoothAdapter {
    private static final boolean DBG = true;
    private static final boolean VDBG = false;

    /**
     * Default MAC address reported to a client that does not have the
     * android.permission.LOCAL_MAC_ADDRESS permission.
     *
     * @hide
     */
    public static final String DEFAULT_MAC_ADDRESS = "02:00:00:00:00:00";

    /**
     * Sentinel error value for this class. Guaranteed to not equal any other
     * integer constant in this class. Provided as a convenience for functions
+9 −2
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.server;

import android.Manifest;
import android.app.ActivityManager;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothProfile;
@@ -909,6 +910,7 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
            mCallbacks.finishBroadcast();
        }
    }

    public String getAddress() {
        mContext.enforceCallingOrSelfPermission(BLUETOOTH_PERM,
                "Need BLUETOOTH permission");
@@ -919,6 +921,11 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
            return null;
        }

        if (mContext.checkCallingOrSelfPermission(Manifest.permission.LOCAL_MAC_ADDRESS)
                != PackageManager.PERMISSION_GRANTED) {
            return BluetoothAdapter.DEFAULT_MAC_ADDRESS;
        }

        synchronized(mConnection) {
            if (mBluetooth != null) {
                try {