[android-scripting] 2 new revisions pushed by rjmatthews62 on 2012-12-10 00:05 GMT

9 views
Skip to first unread message

android-...@googlecode.com

unread,
Dec 9, 2012, 7:05:34 PM12/9/12
to android-scri...@googlegroups.com
2 new revisions:

Revision: 165503f1bc8c
Branch: default
Author: rjmatthews62
Date: Thu Jul 12 04:16:24 2012
Log: startEventDispatcher wasn't handling its default value properly.
http://code.google.com/p/android-scripting/source/detail?r=165503f1bc8c

Revision: dc87c605b7fa
Branch: default
Author: rjmatthews62
Date: Sun Dec 9 16:04:59 2012
Log: Updates to camera facade for newer devices.
http://code.google.com/p/android-scripting/source/detail?r=dc87c605b7fa

==============================================================================
Revision: 165503f1bc8c
Branch: default
Author: rjmatthews62
Date: Thu Jul 12 04:16:24 2012
Log: startEventDispatcher wasn't handling its default value properly.
http://code.google.com/p/android-scripting/source/detail?r=165503f1bc8c

Modified:

/android/Common/src/com/googlecode/android_scripting/facade/EventFacade.java

=======================================
---
/android/Common/src/com/googlecode/android_scripting/facade/EventFacade.java
Thu Jul 5 17:42:04 2012
+++
/android/Common/src/com/googlecode/android_scripting/facade/EventFacade.java
Thu Jul 12 04:16:24 2012
@@ -305,6 +305,9 @@
public int startEventDispatcher(
@RpcParameter(name = "port", description = "Port to use")
@RpcDefault("0") @RpcOptional() Integer port) {
if (mEventServer == null) {
+ if (port == null) {
+ port = 0;
+ }
mEventServer = new EventServer(port);
addGlobalEventObserver(mEventServer);
}

==============================================================================
Revision: dc87c605b7fa
Branch: default
Author: rjmatthews62
Date: Sun Dec 9 16:04:59 2012
Log: Updates to camera facade for newer devices.
http://code.google.com/p/android-scripting/source/detail?r=dc87c605b7fa

Modified:
/android/Common/.classpath

/android/Common/src/com/googlecode/android_scripting/facade/CameraFacade.java
/android/ScriptingLayerForAndroid/AndroidManifest.xml
/android/ScriptingLayerForAndroid/assets/sl4adoc.zip

=======================================
--- /android/Common/.classpath Sat Mar 5 03:51:44 2011
+++ /android/Common/.classpath Sun Dec 9 16:04:59 2012
@@ -3,7 +3,11 @@
<classpathentry kind="src" path="src"/>
<classpathentry kind="lib" path="libs/guava-r06.jar"/>
<classpathentry kind="lib" path="libs/libGoogleAnalytics.jar"/>
- <classpathentry kind="var"
path="ANDROID_SDK/platforms/android-3/android.jar"
sourcepath="/ANDROID_SDK/platforms/android-3/sources/"/>
+ <classpathentry kind="var"
path="ANDROID_SDK/platforms/android-3/android.jar"
sourcepath="/ANDROID_SDK/platforms/android-3/sources/">
+ <attributes>
+ <attribute name="javadoc_location" value="file:/C:/Program Files
(x86)/Android/android-sdk/docs/reference/"/>
+ </attributes>
+ </classpathentry>
<classpathentry combineaccessrules="false" kind="src" path="/Utils"/>
<classpathentry kind="output" path="bin"/>
</classpath>
=======================================
---
/android/Common/src/com/googlecode/android_scripting/facade/CameraFacade.java
Mon Feb 7 14:27:24 2011
+++
/android/Common/src/com/googlecode/android_scripting/facade/CameraFacade.java
Sun Dec 9 16:04:59 2012
@@ -26,9 +26,9 @@
import android.os.Bundle;
import android.provider.MediaStore;
import android.view.SurfaceHolder;
+import android.view.SurfaceHolder.Callback;
import android.view.SurfaceView;
import android.view.WindowManager;
-import android.view.SurfaceHolder.Callback;

import com.googlecode.android_scripting.BaseApplication;
import com.googlecode.android_scripting.FileUtils;
@@ -60,10 +60,22 @@
boolean mmResult = false;
}

- public CameraFacade(FacadeManager manager) {
+ public Camera openCamera(int cameraId) throws Exception {
+ int sSdkLevel = Integer.parseInt(android.os.Build.VERSION.SDK);
+ Camera result;
+ if (sSdkLevel < 9) {
+ result = Camera.open();
+ } else {
+ Method openCamera = Camera.class.getMethod("open", int.class);
+ result = (Camera) openCamera.invoke(null, cameraId);
+ }
+ return result;
+ }
+
+ public CameraFacade(FacadeManager manager) throws Exception {
super(manager);
mService = manager.getService();
- Camera camera = Camera.open();
+ Camera camera = openCamera(0);
try {
mParameters = camera.getParameters();
} finally {
@@ -71,14 +83,15 @@
}
}

- @Rpc(description = "Take a picture and save it to the specified path.",
returns = "A map of Booleans autoFocus and takePicture where True indicates
success.")
- public Bundle cameraCapturePicture(@RpcParameter(name = "targetPath")
final String targetPath,
- @RpcParameter(name = "useAutoFocus") @RpcDefault("true") Boolean
useAutoFocus)
- throws InterruptedException {
+ @Rpc(description = "Take a picture and save it to the specified path.",
returns = "A map of Booleans autoFocus and takePicture where True indicates
success. cameraId also included.")
+ public Bundle cameraCapturePicture(
+ @RpcParameter(name = "targetPath") final String targetPath,
+ @RpcParameter(name = "useAutoFocus") @RpcDefault("true") Boolean
useAutoFocus,
+ @RpcParameter(name = "cameraId", description = "Id of camera to use.
SDK 9") @RpcDefault("0") Integer cameraId)
+ throws Exception {
final BooleanResult autoFocusResult = new BooleanResult();
final BooleanResult takePictureResult = new BooleanResult();
-
- Camera camera = Camera.open();
+ Camera camera = openCamera(cameraId);
camera.setParameters(mParameters);

try {
@@ -105,6 +118,7 @@
Bundle result = new Bundle();
result.putBoolean("autoFocus", autoFocusResult.mmResult);
result.putBoolean("takePicture", takePictureResult.mmResult);
+ result.putInt("cameraId", cameraId);
return result;
}

=======================================
--- /android/ScriptingLayerForAndroid/AndroidManifest.xml Mon Jul 9
18:54:31 2012
+++ /android/ScriptingLayerForAndroid/AndroidManifest.xml Sun Dec 9
16:04:59 2012
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.googlecode.android_scripting" android:installLocation="auto"
- android:versionCode="600" android:versionName="6">
+ android:versionCode="601" android:versionName="6x01">
<uses-permission android:name="android.permission.RECEIVE_SMS" />
<uses-permission
android:name="net.dinglisch.android.tasker.PERMISSION_RUN_TASKS" />
<uses-permission
android:name="com.android.launcher.permission.INSTALL_SHORTCUT" />
=======================================
--- /android/ScriptingLayerForAndroid/assets/sl4adoc.zip Mon Jul 9
18:54:31 2012
+++ /android/ScriptingLayerForAndroid/assets/sl4adoc.zip Sun Dec 9
16:04:59 2012
Binary file, no diff available.
Reply all
Reply to author
Forward
0 new messages