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

Commit fe19f123 authored by Matthew Xie's avatar Matthew Xie Committed by Android (Google) Code Review
Browse files

Add TODO comments to remove start/stopReverseTethering

Change start/stopReverseTethering permission from CHANGE_NETWORK_STATE
to CONNECTIVITY_INTERNAL

Change-Id: Iac76d5af6418e6a3e2d2f77bf713466981285e1a
parent 6fde3098
Loading
Loading
Loading
Loading
+6 −4
Original line number Original line Diff line number Diff line
@@ -780,11 +780,12 @@ public class NetworkManagementService extends INetworkManagementService.Stub
        event.checkCode(TetherStatusResult);
        event.checkCode(TetherStatusResult);
        return event.getMessage().endsWith("started");
        return event.getMessage().endsWith("started");
    }
    }

    // TODO(BT) Remove
    public void startReverseTethering(String iface)
    public void startReverseTethering(String iface)
             throws IllegalStateException {
             throws IllegalStateException {
        if (DBG) Slog.d(TAG, "startReverseTethering in");
        if (DBG) Slog.d(TAG, "startReverseTethering in");
        mContext.enforceCallingOrSelfPermission(
        mContext.enforceCallingOrSelfPermission(CONNECTIVITY_INTERNAL, TAG);
                android.Manifest.permission.CHANGE_NETWORK_STATE, "NetworkManagementService");
        // cmd is "tether start first_start first_stop second_start second_stop ..."
        // cmd is "tether start first_start first_stop second_start second_stop ..."
        // an odd number of addrs will fail
        // an odd number of addrs will fail
        String cmd = "tether start-reverse";
        String cmd = "tether start-reverse";
@@ -798,9 +799,10 @@ public class NetworkManagementService extends INetworkManagementService.Stub
        BluetoothTetheringDataTracker.getInstance().startReverseTether(iface);
        BluetoothTetheringDataTracker.getInstance().startReverseTether(iface);


    }
    }

    // TODO(BT) Remove
    public void stopReverseTethering() throws IllegalStateException {
    public void stopReverseTethering() throws IllegalStateException {
        mContext.enforceCallingOrSelfPermission(
        mContext.enforceCallingOrSelfPermission(CONNECTIVITY_INTERNAL, TAG);
                android.Manifest.permission.CHANGE_NETWORK_STATE, "NetworkManagementService");
        try {
        try {
            mConnector.doCommand("tether stop-reverse");
            mConnector.doCommand("tether stop-reverse");
        } catch (NativeDaemonConnectorException e) {
        } catch (NativeDaemonConnectorException e) {