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

Commit 2382507c authored by d34d's avatar d34d Committed by Clark Scheff
Browse files

QS: Show # of clients connected to hotspot

Since we no longer post a notification showing that the wifi hotspot
is on and the # of connected clients, we now show the # of clients
connected in the label of the hotspot QS tile.

Change-Id: I9ed37b96db9b5b4320a7260524f69733ea70d030

HotSpot: Store # of connected clients in receiver

Get the number of connected clients in onReceive and cache the value
to be used in handleUpdateState.

Change-Id: I011a13e186c1fa9976df58a4ad1603e6c0cd6bbb
parent 07282156
Loading
Loading
Loading
Loading
+25 −0
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.net.wifi.WifiDevice;
import android.os.Binder;
import android.os.Build.VERSION_CODES;
import android.os.Bundle;
@@ -58,6 +59,7 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.net.InetAddress;
import java.util.HashMap;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;

/**
@@ -296,6 +298,15 @@ public class ConnectivityManager {
    public static final String ACTION_TETHER_STATE_CHANGED =
            "android.net.conn.TETHER_STATE_CHANGED";

    /**
     * Broadcast intent action indicating that a Station is connected
     * or disconnected.
     *
     * @hide
     */
    public static final String TETHER_CONNECT_STATE_CHANGED =
            "codeaurora.net.conn.TETHER_CONNECT_STATE_CHANGED";

    /**
     * @hide
     * gives a String[] listing all the interfaces configured for
@@ -1998,6 +2009,20 @@ public class ConnectivityManager {
        }
    }

    /**
     * Get the list of Stations connected to Hotspot.
     *
     * @return a list of {@link WifiDevice} objects.
     * {@hide}
     */
    public List<WifiDevice> getTetherConnectedSta() {
        try {
            return mService.getTetherConnectedSta();
        } catch (RemoteException e) {
            return null;
        }
    }

    /**
     * Check if the device allows for tethering.  It may be disabled via
     * {@code ro.tether.denied} system property, Settings.TETHER_SUPPORTED or
+5 −0
Original line number Diff line number Diff line
@@ -30,12 +30,15 @@ import android.os.IBinder;
import android.os.Messenger;
import android.os.ParcelFileDescriptor;
import android.os.ResultReceiver;
import android.net.wifi.WifiDevice;

import com.android.internal.net.LegacyVpnInfo;
import com.android.internal.net.VpnConfig;
import com.android.internal.net.VpnInfo;
import com.android.internal.net.VpnProfile;

import java.util.List;

/**
 * Interface that answers queries about, and allows changing, the
 * state of network connectivity.
@@ -97,6 +100,8 @@ interface IConnectivityManager

    int setUsbTethering(boolean enable);

    List<WifiDevice> getTetherConnectedSta();

    void reportInetCondition(int networkType, int percentage);

    void reportNetworkConnectivity(in Network network, boolean hasConnectivity);
+7 −0
Original line number Diff line number Diff line
@@ -91,6 +91,13 @@ interface INetworkManagementEventObserver {
     */
    void interfaceClassDataActivityChanged(String label, boolean active, long tsNanos);

    /**
     * Message is received from network interface.
     *
     * @param message The message
     */
    void interfaceMessageRecevied(String message);

    /**
     * Information about available DNS servers has been received.
     *
+5 −0
Original line number Diff line number Diff line
@@ -62,6 +62,11 @@ public class BaseNetworkObserver extends INetworkManagementEventObserver.Stub {
        // default no-op
    }

    @Override
    public void interfaceMessageRecevied(String message) {
        // default no-op
    }

    @Override
    public void limitReached(String limitName, String iface) {
        // default no-op
+3 −0
Original line number Diff line number Diff line
@@ -24,4 +24,7 @@
    <bool name="show_ongoing_ime_switcher">true</bool>
    <bool name="action_bar_expanded_action_views_exclusive">true</bool>
    <bool name="target_honeycomb_needs_options_menu">true</bool>

    <!-- Whether to enable softap extention feature -->
    <bool name="config_softap_extention">true</bool>
</resources>
Loading