summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/CameraPrewarmTest/AndroidManifest.xml23
-rw-r--r--tests/CameraPrewarmTest/res/values/strings.xml2
-rw-r--r--tests/CameraPrewarmTest/src/com/google/android/test/cameraprewarm/CameraActivity.java2
-rw-r--r--tests/CameraPrewarmTest/src/com/google/android/test/cameraprewarm/PrewarmService.java (renamed from tests/CameraPrewarmTest/src/com/google/android/test/cameraprewarm/PrewarmReceiver.java)20
4 files changed, 21 insertions, 26 deletions
diff --git a/tests/CameraPrewarmTest/AndroidManifest.xml b/tests/CameraPrewarmTest/AndroidManifest.xml
index eb40200..11b2686 100644
--- a/tests/CameraPrewarmTest/AndroidManifest.xml
+++ b/tests/CameraPrewarmTest/AndroidManifest.xml
@@ -22,13 +22,13 @@
<activity android:name=".CameraActivity"
android:theme="@android:style/Theme.NoTitleBar">
<intent-filter>
- <action android:name="android.media.action.STILL_IMAGE_CAMERA_SECURE" />
- <category android:name="android.intent.category.DEFAULT" />
- </intent-filter>
- <intent-filter>
<action android:name="android.media.action.STILL_IMAGE_CAMERA" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
+ <meta-data
+ android:name="android.media.still_image_camera_preview_service"
+ android:value="com.google.android.test.cameraprewarm.PrewarmService">
+ </meta-data>
</activity>
<activity android:name=".SecureCameraActivity"
@@ -37,16 +37,15 @@
<action android:name="android.media.action.STILL_IMAGE_CAMERA_SECURE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
+ <meta-data
+ android:name="android.media.still_image_camera_preview_service"
+ android:value="com.google.android.test.cameraprewarm.PrewarmService">
+ </meta-data>
</activity>
- <receiver android:name=".PrewarmReceiver" >
- <intent-filter>
- <action android:name="android.media.action.STILL_IMAGE_CAMERA_PREWARM" />
- </intent-filter>
- <intent-filter>
- <action android:name="android.media.action.STILL_IMAGE_CAMERA_COOLDOWN" />
- </intent-filter>
- </receiver>
+ <service android:name=".PrewarmService"
+ android:exported="true">
+ </service>
</application>
</manifest>
diff --git a/tests/CameraPrewarmTest/res/values/strings.xml b/tests/CameraPrewarmTest/res/values/strings.xml
index 11f7ac7..fe39ac1 100644
--- a/tests/CameraPrewarmTest/res/values/strings.xml
+++ b/tests/CameraPrewarmTest/res/values/strings.xml
@@ -16,6 +16,6 @@
-->
<resources>
- <string name="activity_title">Assistant</string>
+ <string name="activity_title">Camera Prewarm test</string>
<string name="search_label">Orilla Search Engine</string>
</resources>
diff --git a/tests/CameraPrewarmTest/src/com/google/android/test/cameraprewarm/CameraActivity.java b/tests/CameraPrewarmTest/src/com/google/android/test/cameraprewarm/CameraActivity.java
index 4d22234..0b43666 100644
--- a/tests/CameraPrewarmTest/src/com/google/android/test/cameraprewarm/CameraActivity.java
+++ b/tests/CameraPrewarmTest/src/com/google/android/test/cameraprewarm/CameraActivity.java
@@ -19,7 +19,6 @@ package com.google.android.test.cameraprewarm;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
-import android.view.WindowManager;
import com.google.android.test.cameraprewarm.R;
@@ -31,7 +30,6 @@ public class CameraActivity extends Activity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.camera_activity);
- getWindow().addFlags(WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD);
Log.i(TAG, "Activity created");
}
}
diff --git a/tests/CameraPrewarmTest/src/com/google/android/test/cameraprewarm/PrewarmReceiver.java b/tests/CameraPrewarmTest/src/com/google/android/test/cameraprewarm/PrewarmService.java
index d49f96d..d080b1a 100644
--- a/tests/CameraPrewarmTest/src/com/google/android/test/cameraprewarm/PrewarmReceiver.java
+++ b/tests/CameraPrewarmTest/src/com/google/android/test/cameraprewarm/PrewarmService.java
@@ -16,20 +16,18 @@
package com.google.android.test.cameraprewarm;
-import android.content.BroadcastReceiver;
-import android.content.Context;
-import android.content.Intent;
-import android.provider.MediaStore;
+import android.service.media.CameraPrewarmService;
import android.util.Log;
-public class PrewarmReceiver extends BroadcastReceiver {
+public class PrewarmService extends CameraPrewarmService {
@Override
- public void onReceive(Context context, Intent intent) {
- if (intent.getAction().equals(MediaStore.ACTION_STILL_IMAGE_CAMERA_PREWARM)) {
- Log.i(CameraActivity.TAG, "Prewarm received");
- } else if (intent.getAction().equals(MediaStore.ACTION_STILL_IMAGE_CAMERA_COOLDOWN)){
- Log.i(CameraActivity.TAG, "Cooldown received");
- }
+ public void onPrewarm() {
+ Log.i("PrewarmService", "Warming up");
+ }
+
+ @Override
+ public void onCooldown(boolean cameraIntentFired) {
+ Log.i("PrewarmService", "Cooling down fired=" + cameraIntentFired);
}
}