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; package org.wso2.carbon.iot.android.sense.event.streams.data;
import java.util.Date;
public class NetworkData { public class NetworkData {
//Mobile or Wifi //Mobile or Wifi

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

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

@ -1,5 +1,5 @@
/* Enter a unique ExecutionPlan */ /* Enter a unique ExecutionPlan */
@Plan:name('Andriod-Audio-Filter-ExecutionPlan') @Plan:name('Android-Audio-Filter-ExecutionPlan')
/* Enter a unique description for ExecutionPlan */ /* Enter a unique description for ExecutionPlan */
@Plan:description('This converts the true/false params of the orgininal stream into ON/OFF') @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') @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); 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); 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, from AudioStream select meta_owner, meta_deviceId, meta_timestamp, ifThenElse(audio_playing, 'ON', 'OFF') as audio,

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

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Analytics> <Analytics>
<Editable>true</Editable> <Editable>true</Editable>
<Name>AndriodCallScript</Name> <Name>AndroidBatteryScript</Name>
<Script> CREATE TEMPORARY TABLE AndroidBatteryData USING CarbonAnalytics OPTIONS(tableName <Script> CREATE TEMPORARY TABLE AndroidBatteryData USING CarbonAnalytics OPTIONS(tableName
"ORG_WSO2_IOT_ANDROID_BATTERY_STATS", incrementalParams "ORG_WSO2_IOT_ANDROID_BATTERY_STATS, DAY"); "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"); timestamp STRING", primaryKeys "year, month, day, deviceId, owner, type", mergeSchema "false");
INSERT INTO TABLE Android_Battery_Stat_Per_Day 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 getDateStartingTime(year, month, day) as timestamp
FROM AndroidBatteryData FROM AndroidBatteryData
GROUP BY year, month, day, meta_deviceId, meta_owner, type ORDER BY timestamp DESC; 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"?> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Analytics> <Analytics>
<Editable>true</Editable> <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"); <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 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"> <artifact name= "android_call_script" version="1.0.0" type="analytics/spark" serverRole="DataAnalyticsServer">
<file>AndriodCallScript.xml</file> <file>AndroidCallScript.xml</file>
</artifact> </artifact>

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Analytics> <Analytics>
<Editable>true</Editable> <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"); <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 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"> <artifact name= "android_data_script" version="1.0.0" type="analytics/spark" serverRole="DataAnalyticsServer">
<file>AndriodDataScript.xml</file> <file>AndroidDataScript.xml</file>
</artifact> </artifact>

@ -10,6 +10,6 @@
"limit": "1", "limit": "1",
"provider-name": "batch", "provider-name": "batch",
"query": "meta_username: \"admin\" AND id: \"123456\"", "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')){ if (deviceDetails.hasOwnProperty('meta_username')){
deviceDetailsTable += getDeviceDetailTableEntry('Owner:', deviceDetails.meta_username) deviceDetailsTable += getDeviceDetailTableEntry('Owner:', deviceDetails.meta_username)
} }
if (deviceDetails.hasOwnProperty('andriod_version')){ if (deviceDetails.hasOwnProperty('android_version')){
deviceDetailsTable += getDeviceDetailTableEntry('Andriod Version:', deviceDetails.andriod_version) deviceDetailsTable += getDeviceDetailTableEntry('Android Version:', deviceDetails.android_version)
} }
if (deviceDetails.hasOwnProperty('memory')){ if (deviceDetails.hasOwnProperty('memory')){
deviceDetailsTable += getDeviceDetailTableEntry('Memory:', deviceDetails.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"> <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> </artifact>

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

@ -18,6 +18,6 @@
--> -->
<artifact name= "android_device_details_streams" version="1.0.0" type="event/stream" serverRole="DataAnalyticsServer"> <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> </artifact>

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

@ -18,6 +18,6 @@
--> -->
<artifact name="android_filtered_audio_streams" version="1.0.0" type="event/stream" serverRole="DataAnalyticsServer"> <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> </artifact>

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

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Analytics> <Analytics>
<Editable>true</Editable> <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"); <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"); 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"> <artifact name= "android_frequentcontacts_script" version="1.0.0" type="analytics/spark" serverRole="DataAnalyticsServer">
<file>AndriodFrequentContactsScript.xml</file> <file>AndroidFrequentContactsScript.xml</file>
</artifact> </artifact>

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Analytics> <Analytics>
<Editable>true</Editable> <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"); <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 CREATE TEMPORARY TABLE Android_Headset_Stat_Per_Day USING CarbonAnalytics

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

@ -1,6 +1,6 @@
{ {
"provider-conf": { "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" "provider-name": "realtime"
}, },
"chart-conf": { "chart-conf": {

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Analytics> <Analytics>
<Editable>true</Editable> <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"); <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 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"> <artifact name= "android_screen_script" version="1.0.0" type="analytics/spark" serverRole="DataAnalyticsServer">
<file>AndriodScreenScript.xml</file> <file>AndroidScreenScript.xml</file>
</artifact> </artifact>

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Analytics> <Analytics>
<Editable>true</Editable> <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"); <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 CREATE TEMPORARY TABLE Android_Sms_Stat_Per_Day USING CarbonAnalytics
@ -15,5 +15,7 @@
FROM AndroidSmsData FROM AndroidSmsData
GROUP BY year, month, day, meta_deviceId, meta_owner, type ORDER BY timestamp DESC; 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> </Analytics>

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

@ -32,7 +32,7 @@
serverRole="DataAnalyticsServer"/> serverRole="DataAnalyticsServer"/>
<dependency artifact="android_activity_streams" version="1.0.0" include="true" <dependency artifact="android_activity_streams" version="1.0.0" include="true"
serverRole="DataAnalyticsServer"/> 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"/> serverRole="DataAnalyticsServer"/>
<dependency artifact="android_android_activity_executionplan" version="1.0.0" include="true" <dependency artifact="android_android_activity_executionplan" version="1.0.0" include="true"
serverRole="DataAnalyticsServer"/> serverRole="DataAnalyticsServer"/>
@ -58,7 +58,7 @@
serverRole="DataAnalyticsServer"/> serverRole="DataAnalyticsServer"/>
<dependency artifact="android_battery_percentage_chart_gadget" version="1.0.0" include="true" <dependency artifact="android_battery_percentage_chart_gadget" version="1.0.0" include="true"
serverRole="DataAnalyticsServer"/> 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" <dependency artifact="android_battery_stats_event_sink" version="1.0.0" include="true"
serverRole="DataAnalyticsServer"/> serverRole="DataAnalyticsServer"/>
<dependency artifact="android_battery_stats_streams" version="1.0.0" include="true" <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" <dependency artifact="android_screen_ui_event_publisher" version="1.0.0" include="true"
serverRole="DataAnalyticsServer"/> serverRole="DataAnalyticsServer"/>
<dependency artifact="android_sense_dashboard" 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_sense_streams" version="1.0.0" include="true" serverRole="DataAnalyticsServer"/>
<dependency artifact="android_sms_chart_gadget" version="1.0.0" include="true" <dependency artifact="android_sms_chart_gadget" version="1.0.0" include="true"
serverRole="DataAnalyticsServer"/> serverRole="DataAnalyticsServer"/>

Loading…
Cancel
Save