Example usage for android.net.wifi WifiManager WIFI_MODE_FULL

List of usage examples for android.net.wifi WifiManager WIFI_MODE_FULL

Introduction

In this page you can find the example usage for android.net.wifi WifiManager WIFI_MODE_FULL.

Prototype

int WIFI_MODE_FULL

To view the source code for android.net.wifi WifiManager WIFI_MODE_FULL.

Click Source Link

Document

In this Wi-Fi lock mode, Wi-Fi will be kept active, and will behave normally, i.e., it will attempt to automatically establish a connection to a remembered access point that is within range, and will do periodic scans if there are remembered access points but none are in range.

Usage

From source file:com.allthatseries.RNAudioPlayer.Playback.java

public Playback(Context context) {
    this.mContext = context;
    this.mAudioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
    // Create the Wifi lock (this does not acquire the lock, this just creates it)
    this.mWifiLock = ((WifiManager) context.getSystemService(Context.WIFI_SERVICE))
            .createWifiLock(WifiManager.WIFI_MODE_FULL, "playback_lock");
    this.mState = PlaybackStateCompat.STATE_NONE;
}

From source file:com.zegoggles.smssync.service.ServiceBase.java

@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR1)
private int getWifiLockType() {
    return Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR1 ? WifiManager.WIFI_MODE_FULL_HIGH_PERF
            : WifiManager.WIFI_MODE_FULL;
}

From source file:com.example.chu.googleplaylibrary.playback.LocalPlayback.java

public LocalPlayback(Context context, String mMusicProvider) {
    this.mContext = context;
    this.mMusicProvider = mMusicProvider;
    this.mAudioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
    // Create the Wifi lock (this does not acquire the lock, this just creates it)
    this.mWifiLock = ((WifiManager) context.getSystemService(Context.WIFI_SERVICE))
            .createWifiLock(WifiManager.WIFI_MODE_FULL, "uAmp_lock");
    this.mState = PlaybackStateCompat.STATE_NONE;
}

From source file:com.mylovemhz.simplay.MusicService.java

private void initialize() {
    trackQueue = new ArrayList<>();

    mediaPlayer = new MediaPlayer();
    mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
    mediaPlayer.setOnCompletionListener(this);
    mediaPlayer.setOnErrorListener(this);
    mediaPlayer.setOnPreparedListener(this);
    mediaPlayer.setWakeMode(getApplicationContext(), PowerManager.PARTIAL_WAKE_LOCK);
    wifiLock = ((WifiManager) getSystemService(Context.WIFI_SERVICE)).createWifiLock(WifiManager.WIFI_MODE_FULL,
            "music lock");

    ComponentName receiver = new ComponentName(getPackageName(), MediaButtonEventReceiver.class.getName());
    mediaSession = new MediaSessionCompat(this, TAG_MUSIC_SERVICE, receiver, null);
    mediaSession.setFlags(//from  w w  w.jav a 2  s.com
            MediaSessionCompat.FLAG_HANDLES_MEDIA_BUTTONS | MediaSessionCompat.FLAG_HANDLES_TRANSPORT_CONTROLS);
    mediaSession.setCallback(new SimpleSessionCallback(this));

    currentState = State.IDLE;
    mediaSession.setActive(true);

    isInitialized = true;
    Log.d(TAG_MUSIC_SERVICE, "Initialized...");
}

From source file:com.example.android.mediabrowserservice.Playback.java

public Playback(MusicService service, MusicProvider musicProvider) {
    this.mService = service;
    this.mMusicProvider = musicProvider;
    this.mAudioManager = (AudioManager) service.getSystemService(Context.AUDIO_SERVICE);
    // Create the Wifi lock (this does not acquire the lock, this just creates it)
    this.mWifiLock = ((WifiManager) service.getSystemService(Context.WIFI_SERVICE))
            .createWifiLock(WifiManager.WIFI_MODE_FULL, "sample_lock");
}

From source file:com.example.android.supportv4.media.Playback.java

public Playback(MediaBrowserServiceSupport service, MusicProvider musicProvider) {
    this.mService = service;
    this.mMusicProvider = musicProvider;
    this.mAudioManager = (AudioManager) service.getSystemService(Context.AUDIO_SERVICE);
    // Create the Wifi lock (this does not acquire the lock, this just creates it)
    this.mWifiLock = ((WifiManager) service.getSystemService(Context.WIFI_SERVICE))
            .createWifiLock(WifiManager.WIFI_MODE_FULL, "sample_lock");
}

From source file:com.appdevper.mediaplayer.app.LocalPlayback.java

public LocalPlayback(MusicService service, MusicProvider musicProvider) {
    this.mService = service;
    this.mMusicProvider = musicProvider;
    this.mAudioManager = (AudioManager) service.getSystemService(Context.AUDIO_SERVICE);
    // Create the Wifi lock (this does not acquire the lock, this just creates it)
    this.mWifiLock = ((WifiManager) service.getSystemService(Context.WIFI_SERVICE))
            .createWifiLock(WifiManager.WIFI_MODE_FULL, "uAmp_lock");
}

From source file:dk.glutter.android.knr.playback.LocalPlayback.java

public LocalPlayback(Context context, MusicProvider musicProvider) {
    this.mContext = context;
    this.mMusicProvider = musicProvider;
    this.mAudioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
    // Create the Wifi lock (this does not acquire the lock, this just creates it)
    this.mWifiLock = ((WifiManager) context.getSystemService(Context.WIFI_SERVICE))
            .createWifiLock(WifiManager.WIFI_MODE_FULL, "knr_lock");
    this.mState = PlaybackStateCompat.STATE_NONE;
}

From source file:nuclei.media.playback.FallbackPlayback.java

public FallbackPlayback(MediaService service) {
    mService = service;//w w  w. j a  v a  2  s  .  c  om
    this.mAudioManager = (AudioManager) mService.getSystemService(Context.AUDIO_SERVICE);
    // Create the Wifi lock (this does not acquire the lock, this just creates it)
    this.mWifiLock = ((WifiManager) mService.getApplicationContext().getSystemService(Context.WIFI_SERVICE))
            .createWifiLock(WifiManager.WIFI_MODE_FULL, "uAmp_lock");
    this.mState = PlaybackStateCompat.STATE_NONE;
}

From source file:rocks.stalin.android.app.playback.RemotePlayback.java

public RemotePlayback(Context context, MusicProvider musicProvider, OffsetSource timeProvider,
        TaskScheduler scheduler) {//from  w w  w  . jav a  2  s  .  c o  m
    this.mContext = context;
    this.mMusicProvider = musicProvider;
    this.mAudioManager = (AudioManager) context.getApplicationContext().getSystemService(Context.AUDIO_SERVICE);
    // Create the Wifi lock (this does not acquire the lock, this just creates it)
    this.mWifiLock = ((WifiManager) context.getApplicationContext().getSystemService(Context.WIFI_SERVICE))
            .createWifiLock(WifiManager.WIFI_MODE_FULL, "smus_lock");
    this.timeProvider = timeProvider;
    this.scheduler = scheduler;
    this.mState = PlaybackStateCompat.STATE_NONE;
}