Merge pull request #482 from menakaj/release-3.0.x

Android Sense Analytics script modifications.
revert-dabc3590
Ruwan 8 years ago committed by GitHub
commit bb1435e273

@ -18,8 +18,6 @@
package org.wso2.carbon.iot.android.sense.event.streams.data;
import java.util.Date;
public class NetworkData {
//Mobile or Wifi

@ -33,7 +33,6 @@ public class SmsDataReceiver extends BroadcastReceiver {
final Bundle bundle = intent.getExtras();
if (bundle != null) {
final Object[] pdusObj = (Object[]) bundle.get("pdus");
for (int i = 0; i < pdusObj.length; i++) {

@ -148,6 +148,7 @@ public class SenseDataReceiverManager {
smsDataReceiver = new SmsDataReceiver();
IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction(Telephony.Sms.Intents.SMS_RECEIVED_ACTION);
intentFilter.addAction(Telephony.Sms.Intents.SMS_DELIVER_ACTION);
context.registerReceiver(smsDataReceiver, intentFilter);
}
}

@ -1,5 +1,5 @@
/* Enter a unique ExecutionPlan */
@Plan:name('Andriod-Audio-Filter-ExecutionPlan')
@Plan:name('Android-Audio-Filter-ExecutionPlan')
/* Enter a unique description for ExecutionPlan */
@Plan:description('This converts the true/false params of the orgininal stream into ON/OFF')
@ -9,7 +9,7 @@
@Import('org.wso2.iot.android.audio:1.0.0')
define stream AudioStream (meta_owner string, meta_deviceId string, meta_timestamp long, audio_playing bool, headset_on bool, music_volume int);
@Export('org.wso2.iot.andriod.filtered.audio:1.0.0')
@Export('org.wso2.iot.android.filtered.audio:1.0.0')
define stream FilteredAudioStream (meta_owner string, meta_deviceId string, meta_timestamp long, audio string, headset string, music_volume int);
from AudioStream select meta_owner, meta_deviceId, meta_timestamp, ifThenElse(audio_playing, 'ON', 'OFF') as audio,

@ -17,7 +17,8 @@
~ under the License.
-->
<artifact name= "android_andriod_audio_filter_executionplan" version="1.0.0" type="event/execution-plan" serverRole="DataAnalyticsServer">
<file>Andriod-Audio-Filter-ExecutionPlan.siddhiql</file>
<artifact name= "android_android_audio_filter_executionplan" version="1.0.0" type="event/execution-plan"
serverRole="DataAnalyticsServer">
<file>Android-Audio-Filter-ExecutionPlan.siddhiql</file>
</artifact>

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Analytics>
<Editable>true</Editable>
<Name>AndriodCallScript</Name>
<Name>AndroidBatteryScript</Name>
<Script> CREATE TEMPORARY TABLE AndroidBatteryData USING CarbonAnalytics OPTIONS(tableName
"ORG_WSO2_IOT_ANDROID_BATTERY_STATS", incrementalParams "ORG_WSO2_IOT_ANDROID_BATTERY_STATS, DAY");
@ -11,7 +11,7 @@
timestamp STRING", primaryKeys "year, month, day, deviceId, owner, type", mergeSchema "false");
INSERT INTO TABLE Android_Battery_Stat_Per_Day
SELECT meta_owner as owner, meta_deviceId as deviceId, type, avg(level) as level, year, month, day,
SELECT meta_owner as owner, meta_deviceId as deviceId, type, sum(level) as level, year, month, day,
getDateStartingTime(year, month, day) as timestamp
FROM AndroidBatteryData
GROUP BY year, month, day, meta_deviceId, meta_owner, type ORDER BY timestamp DESC;

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Analytics>
<Editable>true</Editable>
<Name>AndriodCallScript</Name>
<Name>AndroidCallScript</Name>
<Script> CREATE TEMPORARY TABLE AndroidCallData USING CarbonAnalytics OPTIONS(tableName "ORG_WSO2_IOT_ANDROID_CALL_STATS", incrementalParams "ORG_WSO2_IOT_ANDROID_CALL_STATS, DAY");
CREATE TEMPORARY TABLE Android_Call_Stat_Per_Day USING CarbonAnalytics

@ -18,6 +18,6 @@
-->
<artifact name= "android_call_script" version="1.0.0" type="analytics/spark" serverRole="DataAnalyticsServer">
<file>AndriodCallScript.xml</file>
<file>AndroidCallScript.xml</file>
</artifact>

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Analytics>
<Editable>true</Editable>
<Name>AndriodDataScript</Name>
<Name>AndroidDataScript</Name>
<Script> CREATE TEMPORARY TABLE AndroidDataData USING CarbonAnalytics OPTIONS(tableName "ORG_WSO2_IOT_ANDROID_DATA_STATS", incrementalParams "ORG_WSO2_IOT_ANDROID_DATA_STATS, DAY");
CREATE TEMPORARY TABLE Android_Data_Stat_Per_Day USING CarbonAnalytics

@ -18,6 +18,6 @@
-->
<artifact name= "android_data_script" version="1.0.0" type="analytics/spark" serverRole="DataAnalyticsServer">
<file>AndriodDataScript.xml</file>
<file>AndroidDataScript.xml</file>
</artifact>

@ -10,6 +10,6 @@
"limit": "1",
"provider-name": "batch",
"query": "meta_username: \"admin\" AND id: \"123456\"",
"tableName": "ORG_WSO2_IOT_ANDRIOD_DEVICE_DETAILS"
"tableName": "ORG_WSO2_IOT_ANDROID_DEVICE_DETAILS"
}
}

@ -93,8 +93,8 @@ $(function () {
if (deviceDetails.hasOwnProperty('meta_username')){
deviceDetailsTable += getDeviceDetailTableEntry('Owner:', deviceDetails.meta_username)
}
if (deviceDetails.hasOwnProperty('andriod_version')){
deviceDetailsTable += getDeviceDetailTableEntry('Andriod Version:', deviceDetails.andriod_version)
if (deviceDetails.hasOwnProperty('android_version')){
deviceDetailsTable += getDeviceDetailTableEntry('Android Version:', deviceDetails.android_version)
}
if (deviceDetails.hasOwnProperty('memory')){
deviceDetailsTable += getDeviceDetailTableEntry('Memory:', deviceDetails.memory)

@ -18,6 +18,6 @@
-->
<artifact name= "android_device_details_event_sink" version="1.0.0" type="analytics/eventstore" serverRole="DataAnalyticsServer">
<file>org_wso2_iot_andriod_device_details.xml</file>
<file>org_wso2_iot_android_device_details.xml</file>
</artifact>

@ -10,7 +10,7 @@
<Type>STRING</Type>
</ColumnDefinition>
<ColumnDefinition>
<Name>andriod_version</Name>
<Name>android_version</Name>
<IsFacet>false</IsFacet>
<EnableIndexing>false</EnableIndexing>
<IsPrimaryKey>false</IsPrimaryKey>
@ -83,7 +83,7 @@
</ColumnDefinition>
</TableSchema>
<Source>
<StreamId>org.wso2.iot.andriod.device.details:1.0.0</StreamId>
<StreamId>org.wso2.iot.android.device.details:1.0.0</StreamId>
</Source>
<MergeSchema>false</MergeSchema>
<RecordStoreName>EVENT_STORE</RecordStoreName>

@ -18,6 +18,6 @@
-->
<artifact name= "android_device_details_streams" version="1.0.0" type="event/stream" serverRole="DataAnalyticsServer">
<file>org.wso2.iot.andriod.device.details_1.0.0.json</file>
<file>org.wso2.iot.android.device.details_1.0.0.json</file>
</artifact>

@ -1,8 +1,8 @@
{
"name": "org.wso2.iot.andriod.device.details",
"name": "org.wso2.iot.android.device.details",
"version": "1.0.0",
"nickName": "",
"description": "Details of the Andriod Device",
"description": "Details of the Android Device",
"metaData": [
{
"name": "username",
@ -11,7 +11,7 @@
],
"payloadData": [
{
"name": "andriod_version",
"name": "android_version",
"type": "STRING"
},
{

@ -18,6 +18,6 @@
-->
<artifact name="android_filtered_audio_streams" version="1.0.0" type="event/stream" serverRole="DataAnalyticsServer">
<file>org.wso2.iot.andriod.filtered.audio_1.0.0.json</file>
<file>org.wso2.iot.android.filtered.audio_1.0.0.json</file>
</artifact>

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<eventPublisher name="org.wso2.iot.android.filtered.audio.ui.publisher"
processing="enable" statistics="disable" trace="disable" xmlns="http://wso2.org/carbon/eventpublisher">
<from streamName="org.wso2.iot.andriod.filtered.audio" version="1.0.0"/>
<from streamName="org.wso2.iot.android.filtered.audio" version="1.0.0"/>
<mapping customMapping="disable" type="wso2event"/>
<to eventAdapterType="ui"/>
</eventPublisher>

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Analytics>
<Editable>true</Editable>
<Name>AndriodFrequentContactsScript</Name>
<Name>AndroidFrequentContactsScript</Name>
<Script> CREATE TEMPORARY TABLE AndroidFrequentCallData USING CarbonAnalytics OPTIONS(tableName "ORG_WSO2_IOT_ANDROID_CALL_STATS", incrementalParams "ORG_WSO2_IOT_ANDROID_CALL_STATS, DAY");
CREATE TEMPORARY TABLE AndroidFrequentSmsData USING CarbonAnalytics OPTIONS(tableName "ORG_WSO2_IOT_ANDROID_SMS_STATS", incrementalParams "ORG_WSO2_IOT_ANDROID_SMS_STATS, DAY");

@ -18,6 +18,6 @@
-->
<artifact name= "android_frequentcontacts_script" version="1.0.0" type="analytics/spark" serverRole="DataAnalyticsServer">
<file>AndriodFrequentContactsScript.xml</file>
<file>AndroidFrequentContactsScript.xml</file>
</artifact>

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Analytics>
<Editable>true</Editable>
<Name>Android_Sense_Script</Name>
<Name>HeadsetScript</Name>
<Script>CREATE TEMPORARY TABLE AndroidHeadsetData USING CarbonAnalytics OPTIONS(tableName "ORG_WSO2_IOT_ANDROID_HEADSET_STATS", incrementalParams "ORG_WSO2_IOT_ANDROID_HEADSET_STATS, DAY");
CREATE TEMPORARY TABLE Android_Headset_Stat_Per_Day USING CarbonAnalytics

@ -17,7 +17,7 @@
~ under the License.
-->
<artifact name= "android_sense_script" version="1.0.0" type="analytics/spark" serverRole="DataAnalyticsServer">
<file>Android_Sense_Script.xml</file>
<artifact name= "android_headset_script" version="1.0.0" type="analytics/spark" serverRole="DataAnalyticsServer">
<file>HeadsetScript.xml</file>
</artifact>

@ -1,6 +1,6 @@
{
"provider-conf": {
"streamName": "org.wso2.iot.andriod.filtered.audio:1.0.0",
"streamName": "org.wso2.iot.android.filtered.audio:1.0.0",
"provider-name": "realtime"
},
"chart-conf": {

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Analytics>
<Editable>true</Editable>
<Name>AndriodScreenScript</Name>
<Name>AndroidScreenScript</Name>
<Script> CREATE TEMPORARY TABLE AndroidScreenData USING CarbonAnalytics OPTIONS(tableName "ORG_WSO2_IOT_ANDROID_SCREEN_STATS", incrementalParams "ORG_WSO2_IOT_ANDROID_SCREEN_STATS, DAY");
CREATE TEMPORARY TABLE Android_Screen_Stat_Per_Day USING CarbonAnalytics

@ -18,6 +18,6 @@
-->
<artifact name= "android_screen_script" version="1.0.0" type="analytics/spark" serverRole="DataAnalyticsServer">
<file>AndriodScreenScript.xml</file>
<file>AndroidScreenScript.xml</file>
</artifact>

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Analytics>
<Editable>true</Editable>
<Name>AndriodSmsScript</Name>
<Name>AndroidSmsScript</Name>
<Script> CREATE TEMPORARY TABLE AndroidSmsData USING CarbonAnalytics OPTIONS(tableName "ORG_WSO2_IOT_ANDROID_SMS_STATS", incrementalParams "ORG_WSO2_IOT_ANDROID_SMS_STATS, DAY");
CREATE TEMPORARY TABLE Android_Sms_Stat_Per_Day USING CarbonAnalytics
@ -15,5 +15,7 @@
FROM AndroidSmsData
GROUP BY year, month, day, meta_deviceId, meta_owner, type ORDER BY timestamp DESC;
INCREMENTAL_TABLE_COMMIT ORG_WSO2_IOT_ANDROID_SMS_STATS; </Script>
INCREMENTAL_TABLE_COMMIT ORG_WSO2_IOT_ANDROID_SMS_STATS;
</Script>
<CronExpression>0 0/5 * * * ?</CronExpression>
</Analytics>

@ -18,6 +18,6 @@
-->
<artifact name= "android_sms_script" version="1.0.0" type="analytics/spark" serverRole="DataAnalyticsServer">
<file>AndriodSmsScript.xml</file>
<file>AndroidSmsScript.xml</file>
</artifact>

@ -32,7 +32,7 @@
serverRole="DataAnalyticsServer"/>
<dependency artifact="android_activity_streams" version="1.0.0" include="true"
serverRole="DataAnalyticsServer"/>
<dependency artifact="android_andriod_audio_filter_executionplan" version="1.0.0" include="true"
<dependency artifact="android_android_audio_filter_executionplan" version="1.0.0" include="true"
serverRole="DataAnalyticsServer"/>
<dependency artifact="android_android_activity_executionplan" version="1.0.0" include="true"
serverRole="DataAnalyticsServer"/>
@ -58,7 +58,7 @@
serverRole="DataAnalyticsServer"/>
<dependency artifact="android_battery_percentage_chart_gadget" version="1.0.0" include="true"
serverRole="DataAnalyticsServer"/>
<dependency artifact="android_battery_script" version="1.0.0" include="true" serverRole="DataAnalyticsServer"/>
<!--<dependency artifact="android_battery_script" version="1.0.0" include="true" serverRole="DataAnalyticsServer"/>-->
<dependency artifact="android_battery_stats_event_sink" version="1.0.0" include="true"
serverRole="DataAnalyticsServer"/>
<dependency artifact="android_battery_stats_streams" version="1.0.0" include="true"
@ -160,7 +160,7 @@
<dependency artifact="android_screen_ui_event_publisher" version="1.0.0" include="true"
serverRole="DataAnalyticsServer"/>
<dependency artifact="android_sense_dashboard" version="1.0.0" include="true" serverRole="DataAnalyticsServer"/>
<dependency artifact="android_sense_script" version="1.0.0" include="true" serverRole="DataAnalyticsServer"/>
<dependency artifact="android_headset_script" version="1.0.0" include="true" serverRole="DataAnalyticsServer"/>
<dependency artifact="android_sense_streams" version="1.0.0" include="true" serverRole="DataAnalyticsServer"/>
<dependency artifact="android_sms_chart_gadget" version="1.0.0" include="true"
serverRole="DataAnalyticsServer"/>

Loading…
Cancel
Save