}
/**
- * Return a device wipe status
- *
- * @param string $user
- * @param string $pass
- * @param string $devid
- * @return int
- */
- public function getDeviceRWStatus($devid)
- {
- return false;
- }
-
- /**
- * Set a new rw status for the device
- *
- * @param string $user
- * @param string $pass
- * @param string $devid
- * @param string $status
- *
- * @return boolean
- */
- public function setDeviceRWStatus($devid, $status)
- {
- return false;
- }
-
- /**
*
* @return unknown_type
*/
}
$this->_encoder->endTag();//policy
$this->_encoder->endTag(); //policies
- $rwstatus = $this->_driver->getDeviceRWStatus($this->_devId);
+ $rwstatus = $state->getDeviceRWStatus($this->_devId);
//wipe data if status is pending or wiped
if ($rwstatus == self::RWSTATUS_PENDING || $rwstatus == self::RWSTATUS_WIPED) {
$this->_encoder->startTag(SYNC_PROVISION_REMOTEWIPE, false, true);
- $this->_driver->setDeviceRWStatus($this->_devId, self::RWSTATUS_WIPED);
+ $state->setDeviceRWStatus($this->_devId, self::RWSTATUS_WIPED);
//$rwstatus = SYNC_PROVISION_RWSTATUS_WIPED;
}
abstract public function setPolicyKey($devId, $key);
/**
+ * Return a device remotewipe status
+ *
+ * @param string $devId The device id
+ *
+ * @return int
+ */
+ abstract public function getDeviceRWStatus($devId);
+
+
+ /**
+ * Set a new remotewipe status for the device
+ *
+ * @param string $devid
+ * @param string $status
+ *
+ * @return boolean
+ */
+ abstract public function setDeviceRWStatus($devid, $status);
+
+ /**
* Obtain the device object.
*
* @param string $devId
}
/**
+ * Return a device wipe status
+ *
+ * @param string $devId
+ *
+ * @return integer
+ */
+ public function getDeviceRWStatus($devId)
+ {
+ $info = $this->getDeviceInfo($devId);
+ return $info['rwstatus'];
+ }
+
+ /**
+ * Set a new remotewipe status for the device
+ *
+ * @param string $devId
+ * @param integer $status
+ *
+ * @return boolean
+ */
+ public function setDeviceRWStatus($devId, $status)
+ {
+ $info = $this->getDeviceInfo($devId);
+ $info['rwstatus'] = $status;
+ $this->setDeviceInfo($devId, $info);
+ }
+
+ /**
* Get list of server changes
*
* @param integer $flags