Search in sources :

Example 76 with Message

use of android.os.Message in project android_frameworks_base by ParanoidAndroid.

the class WifiStateMachine method syncGetConfiguredNetworks.

public List<WifiConfiguration> syncGetConfiguredNetworks(AsyncChannel channel) {
    Message resultMsg = channel.sendMessageSynchronously(CMD_GET_CONFIGURED_NETWORKS);
    List<WifiConfiguration> result = (List<WifiConfiguration>) resultMsg.obj;
    resultMsg.recycle();
    return result;
}
Also used : Message(android.os.Message) List(java.util.List) ArrayList(java.util.ArrayList)

Example 77 with Message

use of android.os.Message in project android_frameworks_base by ParanoidAndroid.

the class WifiStateMachine method syncDisableNetwork.

/**
     * Disable a network
     *
     * @param netId network id of the network
     * @return {@code true} if the operation succeeds, {@code false} otherwise
     */
public boolean syncDisableNetwork(AsyncChannel channel, int netId) {
    Message resultMsg = channel.sendMessageSynchronously(WifiManager.DISABLE_NETWORK, netId);
    boolean result = (resultMsg.arg1 != WifiManager.DISABLE_NETWORK_FAILED);
    resultMsg.recycle();
    return result;
}
Also used : Message(android.os.Message)

Example 78 with Message

use of android.os.Message in project android_frameworks_base by ParanoidAndroid.

the class WifiStateMachine method syncSaveConfig.

/**
     * Save configuration on supplicant
     *
     * @return {@code true} if the operation succeeds, {@code false} otherwise
     *
     * TODO: deprecate this
     */
public boolean syncSaveConfig(AsyncChannel channel) {
    Message resultMsg = channel.sendMessageSynchronously(CMD_SAVE_CONFIG);
    boolean result = (resultMsg.arg1 != FAILURE);
    resultMsg.recycle();
    return result;
}
Also used : Message(android.os.Message)

Example 79 with Message

use of android.os.Message in project android_frameworks_base by ParanoidAndroid.

the class WifiStateMachine method syncRemoveNetwork.

/**
     * Delete a network
     *
     * @param networkId id of the network to be removed
     */
public boolean syncRemoveNetwork(AsyncChannel channel, int networkId) {
    Message resultMsg = channel.sendMessageSynchronously(CMD_REMOVE_NETWORK, networkId);
    boolean result = (resultMsg.arg1 != FAILURE);
    resultMsg.recycle();
    return result;
}
Also used : Message(android.os.Message)

Example 80 with Message

use of android.os.Message in project android_frameworks_base by ParanoidAndroid.

the class WifiStateMachine method syncEnableNetwork.

/**
     * Enable a network
     *
     * @param netId network id of the network
     * @param disableOthers true, if all other networks have to be disabled
     * @return {@code true} if the operation succeeds, {@code false} otherwise
     */
public boolean syncEnableNetwork(AsyncChannel channel, int netId, boolean disableOthers) {
    Message resultMsg = channel.sendMessageSynchronously(CMD_ENABLE_NETWORK, netId, disableOthers ? 1 : 0);
    boolean result = (resultMsg.arg1 != FAILURE);
    resultMsg.recycle();
    return result;
}
Also used : Message(android.os.Message)

Aggregations

Message (android.os.Message)3198 Handler (android.os.Handler)347 RemoteException (android.os.RemoteException)263 Bundle (android.os.Bundle)210 Test (org.junit.Test)144 Intent (android.content.Intent)130 IOException (java.io.IOException)124 Point (android.graphics.Point)86 HashMap (java.util.HashMap)77 SomeArgs (com.android.internal.os.SomeArgs)67 SmallTest (android.test.suitebuilder.annotation.SmallTest)64 Messenger (android.os.Messenger)63 ArrayList (java.util.ArrayList)59 View (android.view.View)52 File (java.io.File)50 MediumTest (android.test.suitebuilder.annotation.MediumTest)43 TextView (android.widget.TextView)41 IBinder (android.os.IBinder)38 Map (java.util.Map)37 PendingIntent (android.app.PendingIntent)33