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

Commit 47898dd3 authored by Jaikumar Ganesh's avatar Jaikumar Ganesh
Browse files

Make profile handler classes package and final.

Also merge in the netmask removal fix.

Change-Id: I7a5c806d442a704f9cb21204a1d1307461f801c7
parent 9efb1343
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -35,10 +35,8 @@ import java.util.List;
 * This handles all the operations on the HID profile.
 * All functions are called by BluetoothService, as Bluetooth Service
 * is the Service handler for the HID profile.
 *
 * @hide
 */
public class BluetoothInputProfileHandler {
final class BluetoothInputProfileHandler {
    private static final String TAG = "BluetoothInputProfileHandler";
    private static final boolean DBG = true;

+4 −7
Original line number Diff line number Diff line
@@ -41,10 +41,8 @@ import java.util.List;
/**
 * This handles the PAN profile. All calls into this are made
 * from Bluetooth Service.
 * @hide
 */

public class BluetoothPanProfileHandler {
final class BluetoothPanProfileHandler {
    private static final String TAG = "BluetoothPanProfileHandler";
    private static final boolean DBG = true;

@@ -53,7 +51,7 @@ public class BluetoothPanProfileHandler {

    private static final String BLUETOOTH_IFACE_ADDR_START= "192.168.44.1";
    private static final int BLUETOOTH_MAX_PAN_CONNECTIONS = 5;
    private static final String BLUETOOTH_NETMASK        = "255.255.255.0";
    private static final int BLUETOOTH_PREFIX_LENGTH        = 24;
    public static BluetoothPanProfileHandler sInstance;
    private final HashMap<BluetoothDevice, BluetoothPanDevice> mPanDevices;
    private boolean mTetheringOn;
@@ -300,7 +298,7 @@ public class BluetoothPanProfileHandler {
        private int mState;
        private String mIfaceAddr;
        private String mIface;
        private int mLocalRole; // Which local role is this PAN device bound too
        private int mLocalRole; // Which local role is this PAN device bound to

        BluetoothPanDevice(int state, String ifaceAddr, String iface, int localRole) {
            mState = state;
@@ -365,7 +363,6 @@ public class BluetoothPanProfileHandler {
        try {
            ifcg = service.getInterfaceConfig(iface);
            if (ifcg != null) {
                InetAddress mask = InetAddress.getByName(BLUETOOTH_NETMASK);
                InetAddress addr = null;
                if (ifcg.addr == null || (addr = ifcg.addr.getAddress()) == null ||
                        addr.equals(InetAddress.getByName("0.0.0.0")) ||
@@ -373,7 +370,7 @@ public class BluetoothPanProfileHandler {
                    addr = InetAddress.getByName(address);
                }
                ifcg.interfaceFlags = ifcg.interfaceFlags.replace("down", "up");
                ifcg.addr = new LinkAddress(addr, mask);
                ifcg.addr = new LinkAddress(addr, BLUETOOTH_PREFIX_LENGTH);
                ifcg.interfaceFlags = ifcg.interfaceFlags.replace("running", "");
                ifcg.interfaceFlags = ifcg.interfaceFlags.replace("  "," ");
                service.setInterfaceConfig(iface, ifcg);