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

Commit 32f21da4 authored by fenglu's avatar fenglu
Browse files

requestBwUpdate() public API review

Change-Id: I1e780b2705d13bfc85a0a8712ac1dbd623b474a1
parent 8fcd5fee
Loading
Loading
Loading
Loading
+9 −7
Original line number Original line Diff line number Diff line
@@ -2452,17 +2452,19 @@ public class ConnectivityManager {
    }
    }


    /**
    /**
     * Request connectivityservice to refresh network capabilities for the given
     * Requests bandwidth update for a given {@link Network} and returns whether the update request
     * {@link network}. This method returns true if the network is still active, false
     * is accepted by ConnectivityService. Once accepted, ConnectivityService will poll underlying
     * otherwise. Notice the method call assumes the caller has registered for
     * network connection for updated bandwidth information. The caller will be notified via
     * listening NetworkCapabilities updates.
     * {@link ConnectivityManager.NetworkCallback} if there is an update. Notice that this
     * method assumes that the caller has previously called {@link #registerNetworkCallback} to
     * listen for network changes.
     *
     *
     * @param network{@link Network} specifying which network you're interested.
     * @param network{@link Network} specifying which network you're interested.
     * @hide
     * @return {@code true} on success, {@code false} if the {@link Network} is no longer valid.
     */
     */
    public boolean requestBwUpdate(Network network) {
    public boolean requestBandwidthUpdate(Network network) {
        try {
        try {
            return mService.requestBwUpdate(network);
            return mService.requestBandwidthUpdate(network);
        } catch (RemoteException e) {
        } catch (RemoteException e) {
            return false;
            return false;
        }
        }
+1 −1
Original line number Original line Diff line number Diff line
@@ -134,7 +134,7 @@ interface IConnectivityManager


    void registerNetworkFactory(in Messenger messenger, in String name);
    void registerNetworkFactory(in Messenger messenger, in String name);


    boolean requestBwUpdate(in Network network);
    boolean requestBandwidthUpdate(in Network network);


    void unregisterNetworkFactory(in Messenger messenger);
    void unregisterNetworkFactory(in Messenger messenger);


+1 −1
Original line number Original line Diff line number Diff line
@@ -3456,7 +3456,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
    }
    }


    @Override
    @Override
    public boolean requestBwUpdate(Network network) {
    public boolean requestBandwidthUpdate(Network network) {
        enforceAccessPermission();
        enforceAccessPermission();
        NetworkAgentInfo nai = null;
        NetworkAgentInfo nai = null;
        if (network == null) {
        if (network == null) {