2012-08-24 Mark Holland <mark@mark-holland.me.uk>

* AndroidManifest.xml: Added experimental start
	pandroid on device boot(not operational)

	* res/layout/setup.xml: Removed duplicate password
	button

	* res/layout/setupnosim.xml: Removed unused text view

	* src/pandroid/agent/core.java: set inventory to disabled
	by default

	* src/pandroid/agent/PandroidAgentListener.java: Fixed
	inventory report if condition

	* src/pandroid/agent/PandroidAgentTentacle.java: Fixed if
	condition when server response == null, Changed how data
	is written to serverOutput, fixes utf-8.

git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6909 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
markholland 2012-08-24 01:43:50 +00:00
parent ee022c4241
commit f75104454e
9 changed files with 67 additions and 22 deletions

View File

@ -36,6 +36,20 @@
<service android:enabled="true" android:name="pandroid.agent.PandroidAgentListener" />
<receiver android:name="pandroid.agent.EventReceiver" />
<receiver
android:name="pandroid.agent.StartMyServiceAtBootReceiver"
android:enabled="true"
android:exported="true"
android:label="StartMyServiceAtBootReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
<service android:enabled="true" android:name="pandroid.agent.MyStartService" />
<activity
android:name=".About"
android:label="@string/pandroid_agent_str"
@ -65,7 +79,7 @@
<uses-permission android:name="android.permission.RECEIVE_SMS"/>
<uses-permission android:name="android.permission.READ_CONTACTS"/>
<uses-permission android:name="android.permission.READ_SMS"/>
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-feature android:name="android.hardware.sensor.light" />
<uses-feature android:name="android.hardware.location" />

View File

@ -1,3 +1,24 @@
2012-08-24 Mark Holland <mark@mark-holland.me.uk>
* AndroidManifest.xml: Added experimental start
pandroid on device boot(not operational)
* res/layout/setup.xml: Removed duplicate password
button
* res/layout/setupnosim.xml: Removed unused text view
* src/pandroid/agent/core.java: set inventory to disabled
by default
* src/pandroid/agent/PandroidAgentListener.java: Fixed
inventory report if condition
* src/pandroid/agent/PandroidAgentTentacle.java: Fixed if
condition when server response == null, Changed how data
is written to serverOutput, fixes utf-8.
2012-08-22 Mark Holland <mark@mark-holland.me.uk>
* AndroidManifest.xml: Changed icon drawable to

View File

@ -282,12 +282,6 @@
android:textSize="14dip" />
<Button
android:id="@+id/set_password"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/set_password" />
<CheckBox
android:id="@+id/checkNotification"
android:layout_width="wrap_content"

View File

@ -178,13 +178,7 @@
android:textColor="#bbbbbb"
android:textSize="14dip" />
<TextView
android:id="@+id/field5"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/task" />
<CheckBox
android:id="@+id/checkNotification"

View File

@ -67,7 +67,7 @@ public class Core {
static volatile public String defaultBytesSentReport = "enabled"; // "disabled" or "enabled"
static volatile public String defaultHelloSignalReport = "enabled"; // "disabled" or "enabled"
static volatile public String defaultRoamingReport = "enabled"; // "disabled" or "enabled"
static volatile public String defaultInventoryReport = "enabled"; // "disabled" or "enabled"
static volatile public String defaultInventoryReport = "disabled"; // "disabled" or "enabled"
static volatile public String defaultNotificationCheck = "enabled"; // "disabled" or "enabled"
static volatile public boolean defaultHasSim = false;

View File

@ -275,6 +275,10 @@ public class PandroidAgentListener extends Service {
String RoamingReport = getSharedData("PANDROID_DATA", "RoamingReport", Core.defaultRoamingReport, "string");
String InventoryReport = getSharedData("PANDROID_DATA", "InventoryReport", Core.defaultInventoryReport, "string");
if(InventoryReport.equals("enabled"))
{
buffer += buildInventoryXML();
}
if (BatteryLevelReport.equals("enabled"))
buffer += buildmoduleXML("battery_level", "The current Battery level", "generic_data", batteryLevel);
@ -341,9 +345,8 @@ public class PandroidAgentListener extends Service {
if (HelloSignalReport.equals("enabled"))
buffer += buildmoduleXML("helloSignal","Hello Signal", "generic_data", helloSignal);
if(InventoryReport.equals("enabled"))
Log.v("MARK",InventoryReport);
buffer += buildInventoryXML();
// End_Modules

View File

@ -23,6 +23,8 @@ import java.io.InputStreamReader;
import java.net.Socket;
import java.net.UnknownHostException;
import android.util.Log;
class tentacle_client {
// Return 0 when success, -1 when error
@ -109,7 +111,7 @@ class tentacle_client {
} catch (IOException e) {
getError("Could not get the file");
}
Log.v("MARK",data);
getInfo("*** Start of transference ***\n",verbose);
// Send the file name and length
try {
@ -126,10 +128,11 @@ class tentacle_client {
}
getInfo("Server -> Client: " + serverResponse + "\n", verbose);
if (serverResponse.equals("SEND OK")) {
if (serverResponse != null && serverResponse.equals("SEND OK")) {
try {
getInfo("Client -> Server: [file data]\n", verbose);
serverOutput.writeBytes(data);
serverOutput.write(data.getBytes());
} catch (IOException e) {
getError("Could not write on server");
}
@ -140,7 +143,7 @@ class tentacle_client {
}
getInfo("Server -> Client: " + serverResponse + "\n", verbose);
if (serverResponse.equals("SEND OK")) {
if (serverResponse != null && serverResponse.equals("SEND OK")) {
try {
send = "QUIT\n";
getInfo("Client -> Server: " + send, verbose);
@ -181,6 +184,7 @@ class tentacle_client {
}
private void log (String msg) {
//Context context = getApplicationContext();
//int duration = Toast.LENGTH_SHORT;

View File

@ -0,0 +1,15 @@
package pandroid.agent;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
public class StartMyServiceAtBootReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
if ("android.intent.action.BOOT_COMPLETED".equals(intent.getAction())) {
//Core.restartAgentListener(context);
}
}
}