diff --git a/lib/roles/device.js b/lib/roles/device.js index 393e467b..fd82199f 100644 --- a/lib/roles/device.js +++ b/lib/roles/device.js @@ -34,7 +34,6 @@ module.exports = function(options) { .dependency(require('./device/plugins/connect')) .dependency(require('./device/plugins/account')) .dependency(require('./device/plugins/ringer')) - .dependency(require('./device/plugins/wifi')) .define(function(options, solo) { if (process.send) { // Only if we have a parent process diff --git a/lib/roles/device/plugins/service.js b/lib/roles/device/plugins/service.js index 48d053b7..bd63ce30 100644 --- a/lib/roles/device/plugins/service.js +++ b/lib/roles/device/plugins/service.js @@ -521,20 +521,6 @@ module.exports = syrup.serial() }) } - plugin.setWifiEnabled = function(enabled) { - return runServiceCommand( - apk.wire.MessageType.SET_WIFI_ENABLED - , new apk.wire.SetWifiEnabledRequest(enabled) - ) - .timeout(10000) - .then(function(data) { - var response = apk.wire.SetWifiEnabledResponse.decode(data) - if (!response.success) { - throw new Error('Unable to set Wifi') - } - }) - } - function runServiceCommand(type, cmd) { var resolver = Promise.defer() var id = Math.floor(Math.random() * 0xFFFFFF) diff --git a/lib/roles/device/plugins/wifi.js b/lib/roles/device/plugins/wifi.js deleted file mode 100644 index b614b1df..00000000 --- a/lib/roles/device/plugins/wifi.js +++ /dev/null @@ -1,35 +0,0 @@ -var syrup = require('syrup') - -var logger = require('../../../util/logger') -var wire = require('../../../wire') -var wireutil = require('../../../wire/util') - -module.exports = syrup.serial() - .dependency(require('./service')) - .dependency(require('../support/router')) - .dependency(require('../support/push')) - .define(function(options, service, router, push) { - var log = logger.createLogger('device:plugins:wifi') - - router.on(wire.WifiSetEnabledMessage, function(channel, message) { - var reply = wireutil.reply(options.serial) - - log.info('Setting Wifi "%s"', message.enabled) - - service.setWifiEnabled(message.enabled) - .timeout(30000) - .then(function() { - push.send([ - channel - , reply.okay() - ]) - }) - .error(function(err) { - log.error('Setting wifi enabled failed', err.stack) - push.send([ - channel - , reply.fail(err.message) - ]) - }) - }) - }) diff --git a/lib/roles/websocket.js b/lib/roles/websocket.js index dc0160e1..49a64e30 100644 --- a/lib/roles/websocket.js +++ b/lib/roles/websocket.js @@ -341,16 +341,6 @@ module.exports = function(options) { ) ]) }) - .on('wifi.set', function(channel, responseChannel, data) { - joinChannel(responseChannel) - push.send([ - channel - , wireutil.transaction( - responseChannel - , new wire.WifiSetEnabledMessage(data.enabled) - ) - ]) - }) .on('group.invite', function(channel, responseChannel, data) { joinChannel(responseChannel) push.send([ diff --git a/lib/wire/wire.proto b/lib/wire/wire.proto index 4966d9e5..e1a344ea 100644 --- a/lib/wire/wire.proto +++ b/lib/wire/wire.proto @@ -56,7 +56,6 @@ enum MessageType { ConnectStopMessage = 54; AccountRemoveMessage = 55; RingerSetMessage = 56; - WifiSetEnabledMessage = 57; } message Envelope { @@ -392,10 +391,6 @@ message RingerSetMessage { required int32 mode = 1; } -message WifiSetEnabledMessage { - required bool enabled = 1; -} - // Events, these must be kept in sync with STFService/wire.proto message AirplaneModeEvent { diff --git a/res/app/components/stf/control/control-service.js b/res/app/components/stf/control/control-service.js index 0b976746..14d7ee7d 100644 --- a/res/app/components/stf/control/control-service.js +++ b/res/app/components/stf/control/control-service.js @@ -228,12 +228,6 @@ module.exports = function ControlServiceFactory( }) } - this.setWifiEnabled = function(enabled) { - return sendTwoWay('wifi.set', { - enabled: enabled - }) - } - window.cc = this } diff --git a/vendor/STFService/STFService.apk b/vendor/STFService/STFService.apk index 0ad65618..1c70699f 100644 Binary files a/vendor/STFService/STFService.apk and b/vendor/STFService/STFService.apk differ diff --git a/vendor/STFService/wire.proto b/vendor/STFService/wire.proto index 90144d5c..257f85be 100644 --- a/vendor/STFService/wire.proto +++ b/vendor/STFService/wire.proto @@ -17,7 +17,6 @@ enum MessageType { SET_RINGER_MODE = 21; SET_ROTATION = 12; SET_WAKE_LOCK = 11; - SET_WIFI_ENABLED = 22; EVENT_AIRPLANE_MODE = 13; EVENT_BATTERY = 14; EVENT_CONNECTIVITY = 15; @@ -196,14 +195,6 @@ message SetRingerModeResponse { required bool success = 1; } -message SetWifiEnabledRequest { - required bool enabled = 1; -} - -message SetWifiEnabledResponse { - required bool success = 1; -} - // Agent enum KeyEvent {