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

Commit bd94f0d1 authored by Zach Johnson's avatar Zach Johnson
Browse files

Simplify getName & setName

Toss the try/catch, it's a simple field
access under the hood, so no exception
should ever come out of it.

Remove setName and go directly to adapterProperties.

Bug: 145171640
Test: compile
Change-Id: Icb28a16972443bdb5cf3201b03f65a95ffb36c8e
parent e8f5cb73
Loading
Loading
Loading
Loading
+2 −11
Original line number Diff line number Diff line
@@ -1203,7 +1203,7 @@ public class AdapterService extends Service {

            enforceBluetoothAdminPermission(service);

            return service.setName(name);
            return service.mAdapterProperties.setName(name);
        }

        @Override
@@ -2102,16 +2102,7 @@ public class AdapterService extends Service {
    }

    public String getName() {
        try {
        return mAdapterProperties.getName();
        } catch (Throwable t) {
            debugLog("getName() - Unexpected exception (" + t + ")");
        }
        return null;
    }

    boolean setName(String name) {
        return mAdapterProperties.setName(name);
    }

    BluetoothClass getBluetoothClass() {