* commit 'f7f90276a1f262c0db855edc49d544e157bc6e7f': Fix API review: Camera prewarm lock device orientation during app compatibility test Fix reconfigure & setPremult alpha handling Unflip TextureView getBitmap readback Handle error states when refreshing accessibility node
This commit is contained in:
@@ -26143,8 +26143,6 @@ package android.provider {
|
|||||||
method public static java.lang.String getVersion(android.content.Context);
|
method public static java.lang.String getVersion(android.content.Context);
|
||||||
field public static final java.lang.String ACTION_IMAGE_CAPTURE = "android.media.action.IMAGE_CAPTURE";
|
field public static final java.lang.String ACTION_IMAGE_CAPTURE = "android.media.action.IMAGE_CAPTURE";
|
||||||
field public static final java.lang.String ACTION_IMAGE_CAPTURE_SECURE = "android.media.action.IMAGE_CAPTURE_SECURE";
|
field public static final java.lang.String ACTION_IMAGE_CAPTURE_SECURE = "android.media.action.IMAGE_CAPTURE_SECURE";
|
||||||
field public static final java.lang.String ACTION_STILL_IMAGE_CAMERA_COOLDOWN = "android.media.action.STILL_IMAGE_CAMERA_COOLDOWN";
|
|
||||||
field public static final java.lang.String ACTION_STILL_IMAGE_CAMERA_PREWARM = "android.media.action.STILL_IMAGE_CAMERA_PREWARM";
|
|
||||||
field public static final java.lang.String ACTION_VIDEO_CAPTURE = "android.media.action.VIDEO_CAPTURE";
|
field public static final java.lang.String ACTION_VIDEO_CAPTURE = "android.media.action.VIDEO_CAPTURE";
|
||||||
field public static final java.lang.String AUTHORITY = "media";
|
field public static final java.lang.String AUTHORITY = "media";
|
||||||
field public static final java.lang.String EXTRA_DURATION_LIMIT = "android.intent.extra.durationLimit";
|
field public static final java.lang.String EXTRA_DURATION_LIMIT = "android.intent.extra.durationLimit";
|
||||||
@@ -26172,6 +26170,7 @@ package android.provider {
|
|||||||
field public static final java.lang.String INTENT_ACTION_VIDEO_PLAY_FROM_SEARCH = "android.media.action.VIDEO_PLAY_FROM_SEARCH";
|
field public static final java.lang.String INTENT_ACTION_VIDEO_PLAY_FROM_SEARCH = "android.media.action.VIDEO_PLAY_FROM_SEARCH";
|
||||||
field public static final java.lang.String MEDIA_IGNORE_FILENAME = ".nomedia";
|
field public static final java.lang.String MEDIA_IGNORE_FILENAME = ".nomedia";
|
||||||
field public static final java.lang.String MEDIA_SCANNER_VOLUME = "volume";
|
field public static final java.lang.String MEDIA_SCANNER_VOLUME = "volume";
|
||||||
|
field public static final java.lang.String META_DATA_STILL_IMAGE_CAMERA_PREWARM_SERVICE = "android.media.still_image_camera_preview_service";
|
||||||
field public static final java.lang.String UNKNOWN_STRING = "<unknown>";
|
field public static final java.lang.String UNKNOWN_STRING = "<unknown>";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -28730,6 +28729,13 @@ package android.service.dreams {
|
|||||||
|
|
||||||
package android.service.media {
|
package android.service.media {
|
||||||
|
|
||||||
|
public abstract class CameraPrewarmService extends android.app.Service {
|
||||||
|
ctor public CameraPrewarmService();
|
||||||
|
method public android.os.IBinder onBind(android.content.Intent);
|
||||||
|
method public abstract void onCooldown(boolean);
|
||||||
|
method public abstract void onPrewarm();
|
||||||
|
}
|
||||||
|
|
||||||
public abstract class MediaBrowserService extends android.app.Service {
|
public abstract class MediaBrowserService extends android.app.Service {
|
||||||
ctor public MediaBrowserService();
|
ctor public MediaBrowserService();
|
||||||
method public void dump(java.io.FileDescriptor, java.io.PrintWriter, java.lang.String[]);
|
method public void dump(java.io.FileDescriptor, java.io.PrintWriter, java.lang.String[]);
|
||||||
|
|||||||
@@ -28072,8 +28072,6 @@ package android.provider {
|
|||||||
method public static java.lang.String getVersion(android.content.Context);
|
method public static java.lang.String getVersion(android.content.Context);
|
||||||
field public static final java.lang.String ACTION_IMAGE_CAPTURE = "android.media.action.IMAGE_CAPTURE";
|
field public static final java.lang.String ACTION_IMAGE_CAPTURE = "android.media.action.IMAGE_CAPTURE";
|
||||||
field public static final java.lang.String ACTION_IMAGE_CAPTURE_SECURE = "android.media.action.IMAGE_CAPTURE_SECURE";
|
field public static final java.lang.String ACTION_IMAGE_CAPTURE_SECURE = "android.media.action.IMAGE_CAPTURE_SECURE";
|
||||||
field public static final java.lang.String ACTION_STILL_IMAGE_CAMERA_COOLDOWN = "android.media.action.STILL_IMAGE_CAMERA_COOLDOWN";
|
|
||||||
field public static final java.lang.String ACTION_STILL_IMAGE_CAMERA_PREWARM = "android.media.action.STILL_IMAGE_CAMERA_PREWARM";
|
|
||||||
field public static final java.lang.String ACTION_VIDEO_CAPTURE = "android.media.action.VIDEO_CAPTURE";
|
field public static final java.lang.String ACTION_VIDEO_CAPTURE = "android.media.action.VIDEO_CAPTURE";
|
||||||
field public static final java.lang.String AUTHORITY = "media";
|
field public static final java.lang.String AUTHORITY = "media";
|
||||||
field public static final java.lang.String EXTRA_DURATION_LIMIT = "android.intent.extra.durationLimit";
|
field public static final java.lang.String EXTRA_DURATION_LIMIT = "android.intent.extra.durationLimit";
|
||||||
@@ -28101,6 +28099,7 @@ package android.provider {
|
|||||||
field public static final java.lang.String INTENT_ACTION_VIDEO_PLAY_FROM_SEARCH = "android.media.action.VIDEO_PLAY_FROM_SEARCH";
|
field public static final java.lang.String INTENT_ACTION_VIDEO_PLAY_FROM_SEARCH = "android.media.action.VIDEO_PLAY_FROM_SEARCH";
|
||||||
field public static final java.lang.String MEDIA_IGNORE_FILENAME = ".nomedia";
|
field public static final java.lang.String MEDIA_IGNORE_FILENAME = ".nomedia";
|
||||||
field public static final java.lang.String MEDIA_SCANNER_VOLUME = "volume";
|
field public static final java.lang.String MEDIA_SCANNER_VOLUME = "volume";
|
||||||
|
field public static final java.lang.String META_DATA_STILL_IMAGE_CAMERA_PREWARM_SERVICE = "android.media.still_image_camera_preview_service";
|
||||||
field public static final java.lang.String UNKNOWN_STRING = "<unknown>";
|
field public static final java.lang.String UNKNOWN_STRING = "<unknown>";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -30762,6 +30761,13 @@ package android.service.dreams {
|
|||||||
|
|
||||||
package android.service.media {
|
package android.service.media {
|
||||||
|
|
||||||
|
public abstract class CameraPrewarmService extends android.app.Service {
|
||||||
|
ctor public CameraPrewarmService();
|
||||||
|
method public android.os.IBinder onBind(android.content.Intent);
|
||||||
|
method public abstract void onCooldown(boolean);
|
||||||
|
method public abstract void onPrewarm();
|
||||||
|
}
|
||||||
|
|
||||||
public abstract class MediaBrowserService extends android.app.Service {
|
public abstract class MediaBrowserService extends android.app.Service {
|
||||||
ctor public MediaBrowserService();
|
ctor public MediaBrowserService();
|
||||||
method public void dump(java.io.FileDescriptor, java.io.PrintWriter, java.lang.String[]);
|
method public void dump(java.io.FileDescriptor, java.io.PrintWriter, java.lang.String[]);
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import android.content.ContentResolver;
|
|||||||
import android.content.ContentUris;
|
import android.content.ContentUris;
|
||||||
import android.content.ContentValues;
|
import android.content.ContentValues;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
import android.database.Cursor;
|
import android.database.Cursor;
|
||||||
import android.database.DatabaseUtils;
|
import android.database.DatabaseUtils;
|
||||||
import android.database.sqlite.SQLiteException;
|
import android.database.sqlite.SQLiteException;
|
||||||
@@ -33,6 +34,7 @@ import android.media.ThumbnailUtils;
|
|||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Environment;
|
import android.os.Environment;
|
||||||
import android.os.ParcelFileDescriptor;
|
import android.os.ParcelFileDescriptor;
|
||||||
|
import android.service.media.CameraPrewarmService;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
@@ -226,33 +228,24 @@ public final class MediaStore {
|
|||||||
public static final String INTENT_ACTION_STILL_IMAGE_CAMERA = "android.media.action.STILL_IMAGE_CAMERA";
|
public static final String INTENT_ACTION_STILL_IMAGE_CAMERA = "android.media.action.STILL_IMAGE_CAMERA";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The name of the Intent action used to indicate that a camera launch might be imminent. This
|
* Name under which an activity handling {@link #INTENT_ACTION_STILL_IMAGE_CAMERA} or
|
||||||
* broadcast should be targeted to the package that is receiving
|
* {@link #INTENT_ACTION_STILL_IMAGE_CAMERA_SECURE} publishes the service name for its prewarm
|
||||||
* {@link #INTENT_ACTION_STILL_IMAGE_CAMERA} or
|
* service.
|
||||||
* {@link #INTENT_ACTION_STILL_IMAGE_CAMERA_SECURE}, depending on the context. If such
|
|
||||||
* intent would launch the resolver activity, this broadcast should not be sent at all.
|
|
||||||
* <p>
|
* <p>
|
||||||
* A receiver of this broadcast should do the absolute minimum amount of work to initialize the
|
* This meta-data should reference the fully qualified class name of the prewarm service
|
||||||
* camera in order to reduce startup time in likely case that shortly after an actual camera
|
* extending {@link CameraPrewarmService}.
|
||||||
* launch intent would be sent.
|
|
||||||
* <p>
|
* <p>
|
||||||
* In case the actual intent will not be fired, the target package will receive
|
* The prewarm service will get bound and receive a prewarm signal
|
||||||
* {@link #ACTION_STILL_IMAGE_CAMERA_COOLDOWN}. However, it is recommended that the receiver
|
* {@link CameraPrewarmService#onPrewarm()} when a camera launch intent fire might be imminent.
|
||||||
* also implements a timeout to close the camera after receiving this intent, as there is no
|
* An application implementing a prewarm service should do the absolute minimum amount of work
|
||||||
* guarantee that {@link #ACTION_STILL_IMAGE_CAMERA_COOLDOWN} will be delivered.
|
* to initialize the camera in order to reduce startup time in likely case that shortly after a
|
||||||
|
* camera launch intent would be sent.
|
||||||
|
* <p>
|
||||||
|
* If the camera launch intent gets fired shortly after, the service will be unbound
|
||||||
|
* asynchronously, without receiving
|
||||||
*/
|
*/
|
||||||
@SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
|
public static final String META_DATA_STILL_IMAGE_CAMERA_PREWARM_SERVICE =
|
||||||
public static final String ACTION_STILL_IMAGE_CAMERA_PREWARM = "android.media.action.STILL_IMAGE_CAMERA_PREWARM";
|
"android.media.still_image_camera_preview_service";
|
||||||
|
|
||||||
/**
|
|
||||||
* The name of the Intent action used to indicate that an imminent camera launch has been
|
|
||||||
* cancelled by the user. This broadcast should be targeted to the package that has received
|
|
||||||
* {@link #ACTION_STILL_IMAGE_CAMERA_PREWARM}.
|
|
||||||
* <p>
|
|
||||||
* A receiver of this broadcast should close the camera immediately.
|
|
||||||
*/
|
|
||||||
@SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
|
|
||||||
public static final String ACTION_STILL_IMAGE_CAMERA_COOLDOWN = "android.media.action.STILL_IMAGE_CAMERA_COOLDOWN";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The name of the Intent action used to launch a camera in still image mode
|
* The name of the Intent action used to launch a camera in still image mode
|
||||||
@@ -2268,5 +2261,4 @@ public final class MediaStore {
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
96
core/java/android/service/media/CameraPrewarmService.java
Normal file
96
core/java/android/service/media/CameraPrewarmService.java
Normal file
@@ -0,0 +1,96 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2015 The Android Open Source Project
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License
|
||||||
|
*/
|
||||||
|
|
||||||
|
package android.service.media;
|
||||||
|
|
||||||
|
import android.app.Service;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Handler;
|
||||||
|
import android.os.IBinder;
|
||||||
|
import android.os.Message;
|
||||||
|
import android.os.Messenger;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Extend this class to implement a camera prewarm service. See
|
||||||
|
* {@link android.provider.MediaStore#META_DATA_STILL_IMAGE_CAMERA_PREWARM_SERVICE}.
|
||||||
|
*/
|
||||||
|
public abstract class CameraPrewarmService extends Service {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Intent action to bind the service as a prewarm service.
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
public static final String ACTION_PREWARM =
|
||||||
|
"android.service.media.CameraPrewarmService.ACTION_PREWARM";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Message sent by the client indicating that the camera intent has been fired.
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
public static final int MSG_CAMERA_FIRED = 1;
|
||||||
|
|
||||||
|
private final Handler mHandler = new Handler() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void handleMessage(Message msg) {
|
||||||
|
switch (msg.what) {
|
||||||
|
case MSG_CAMERA_FIRED:
|
||||||
|
mCameraIntentFired = true;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
super.handleMessage(msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
private boolean mCameraIntentFired;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IBinder onBind(Intent intent) {
|
||||||
|
if (ACTION_PREWARM.equals(intent.getAction())) {
|
||||||
|
onPrewarm();
|
||||||
|
return new Messenger(mHandler).getBinder();
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onUnbind(Intent intent) {
|
||||||
|
if (ACTION_PREWARM.equals(intent.getAction())) {
|
||||||
|
onCooldown(mCameraIntentFired);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when the camera should be prewarmed.
|
||||||
|
*/
|
||||||
|
public abstract void onPrewarm();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when prewarm phase is done, either because the camera launch intent has been fired
|
||||||
|
* at this point or prewarm is no longer needed. A client should close the camera
|
||||||
|
* immediately in the latter case.
|
||||||
|
* <p>
|
||||||
|
* In case the camera launch intent has been fired, there is no guarantee about the ordering
|
||||||
|
* of these two events. Cooldown might happen either before or after the activity has been
|
||||||
|
* created that handles the camera intent.
|
||||||
|
*
|
||||||
|
* @param cameraIntentFired Indicates whether the intent to launch the camera has been
|
||||||
|
* fired.
|
||||||
|
*/
|
||||||
|
public abstract void onCooldown(boolean cameraIntentFired);
|
||||||
|
}
|
||||||
@@ -60,6 +60,7 @@ public class KeyguardHostView extends FrameLayout implements SecurityCallback {
|
|||||||
protected ViewMediatorCallback mViewMediatorCallback;
|
protected ViewMediatorCallback mViewMediatorCallback;
|
||||||
protected LockPatternUtils mLockPatternUtils;
|
protected LockPatternUtils mLockPatternUtils;
|
||||||
private OnDismissAction mDismissAction;
|
private OnDismissAction mDismissAction;
|
||||||
|
private Runnable mCancelAction;
|
||||||
|
|
||||||
private final KeyguardUpdateMonitorCallback mUpdateCallback =
|
private final KeyguardUpdateMonitorCallback mUpdateCallback =
|
||||||
new KeyguardUpdateMonitorCallback() {
|
new KeyguardUpdateMonitorCallback() {
|
||||||
@@ -126,8 +127,17 @@ public class KeyguardHostView extends FrameLayout implements SecurityCallback {
|
|||||||
*
|
*
|
||||||
* @param action
|
* @param action
|
||||||
*/
|
*/
|
||||||
public void setOnDismissAction(OnDismissAction action) {
|
public void setOnDismissAction(OnDismissAction action, Runnable cancelAction) {
|
||||||
|
if (mCancelAction != null) {
|
||||||
|
mCancelAction.run();
|
||||||
|
mCancelAction = null;
|
||||||
|
}
|
||||||
mDismissAction = action;
|
mDismissAction = action;
|
||||||
|
mCancelAction = cancelAction;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void cancelDismissAction() {
|
||||||
|
setOnDismissAction(null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -197,6 +207,7 @@ public class KeyguardHostView extends FrameLayout implements SecurityCallback {
|
|||||||
if (mDismissAction != null) {
|
if (mDismissAction != null) {
|
||||||
deferKeyguardDone = mDismissAction.onDismiss();
|
deferKeyguardDone = mDismissAction.onDismiss();
|
||||||
mDismissAction = null;
|
mDismissAction = null;
|
||||||
|
mCancelAction = null;
|
||||||
}
|
}
|
||||||
if (mViewMediatorCallback != null) {
|
if (mViewMediatorCallback != null) {
|
||||||
if (deferKeyguardDone) {
|
if (deferKeyguardDone) {
|
||||||
|
|||||||
@@ -24,6 +24,11 @@ import android.content.Intent;
|
|||||||
* Keyguard.
|
* Keyguard.
|
||||||
*/
|
*/
|
||||||
public interface ActivityStarter {
|
public interface ActivityStarter {
|
||||||
public void startActivity(Intent intent, boolean dismissShade);
|
void startActivity(Intent intent, boolean dismissShade);
|
||||||
|
void startActivity(Intent intent, boolean dismissShade, Callback callback);
|
||||||
void preventNextAnimation();
|
void preventNextAnimation();
|
||||||
|
|
||||||
|
interface Callback {
|
||||||
|
void onActivityStarted(int resultCode);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -160,7 +160,7 @@ public class KeyguardAffordanceHelper {
|
|||||||
} else {
|
} else {
|
||||||
mTouchSlopExeeded = false;
|
mTouchSlopExeeded = false;
|
||||||
}
|
}
|
||||||
mCallback.onSwipingStarted(targetView == mLeftIcon);
|
mCallback.onSwipingStarted(targetView == mRightIcon);
|
||||||
mSwipingInProgress = true;
|
mSwipingInProgress = true;
|
||||||
mTargetedView = targetView;
|
mTargetedView = targetView;
|
||||||
mInitialTouchX = x;
|
mInitialTouchX = x;
|
||||||
@@ -550,7 +550,7 @@ public class KeyguardAffordanceHelper {
|
|||||||
|
|
||||||
float getMaxTranslationDistance();
|
float getMaxTranslationDistance();
|
||||||
|
|
||||||
void onSwipingStarted(boolean isRightwardMotion);
|
void onSwipingStarted(boolean rightIcon);
|
||||||
|
|
||||||
void onSwipingAborted();
|
void onSwipingAborted();
|
||||||
|
|
||||||
|
|||||||
@@ -16,12 +16,17 @@
|
|||||||
|
|
||||||
package com.android.systemui.statusbar.phone;
|
package com.android.systemui.statusbar.phone;
|
||||||
|
|
||||||
|
import android.app.ActivityManager;
|
||||||
import android.app.ActivityManagerNative;
|
import android.app.ActivityManagerNative;
|
||||||
|
import android.app.Application;
|
||||||
import android.app.admin.DevicePolicyManager;
|
import android.app.admin.DevicePolicyManager;
|
||||||
import android.content.BroadcastReceiver;
|
import android.content.BroadcastReceiver;
|
||||||
|
import android.content.ComponentName;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.IntentFilter;
|
import android.content.IntentFilter;
|
||||||
|
import android.content.ServiceConnection;
|
||||||
|
import android.content.pm.ActivityInfo;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.content.pm.ResolveInfo;
|
import android.content.pm.ResolveInfo;
|
||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
@@ -29,9 +34,13 @@ import android.graphics.drawable.Drawable;
|
|||||||
import android.graphics.drawable.InsetDrawable;
|
import android.graphics.drawable.InsetDrawable;
|
||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.os.IBinder;
|
||||||
|
import android.os.Message;
|
||||||
|
import android.os.Messenger;
|
||||||
import android.os.RemoteException;
|
import android.os.RemoteException;
|
||||||
import android.os.UserHandle;
|
import android.os.UserHandle;
|
||||||
import android.provider.MediaStore;
|
import android.provider.MediaStore;
|
||||||
|
import android.service.media.CameraPrewarmService;
|
||||||
import android.telecom.TelecomManager;
|
import android.telecom.TelecomManager;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
@@ -100,7 +109,23 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL
|
|||||||
private PhoneStatusBar mPhoneStatusBar;
|
private PhoneStatusBar mPhoneStatusBar;
|
||||||
|
|
||||||
private final Interpolator mLinearOutSlowInInterpolator;
|
private final Interpolator mLinearOutSlowInInterpolator;
|
||||||
private boolean mPrewarmSent;
|
private boolean mPrewarmBound;
|
||||||
|
private Messenger mPrewarmMessenger;
|
||||||
|
private final ServiceConnection mPrewarmConnection = new ServiceConnection() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onServiceConnected(ComponentName name, IBinder service) {
|
||||||
|
mPrewarmMessenger = new Messenger(service);
|
||||||
|
mPrewarmBound = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onServiceDisconnected(ComponentName name) {
|
||||||
|
mPrewarmBound = false;
|
||||||
|
mPrewarmMessenger = null;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
private boolean mLeftIsVoiceAssist;
|
private boolean mLeftIsVoiceAssist;
|
||||||
private AssistManager mAssistManager;
|
private AssistManager mAssistManager;
|
||||||
|
|
||||||
@@ -343,37 +368,44 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL
|
|||||||
mLockPatternUtils.requireCredentialEntry(KeyguardUpdateMonitor.getCurrentUser());
|
mLockPatternUtils.requireCredentialEntry(KeyguardUpdateMonitor.getCurrentUser());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void prewarmCamera() {
|
public void bindCameraPrewarmService() {
|
||||||
Intent intent = getCameraIntent();
|
Intent intent = getCameraIntent();
|
||||||
String targetPackage = PreviewInflater.getTargetPackage(mContext, intent,
|
ActivityInfo targetInfo = PreviewInflater.getTargetActivityInfo(mContext, intent,
|
||||||
KeyguardUpdateMonitor.getCurrentUser());
|
KeyguardUpdateMonitor.getCurrentUser());
|
||||||
if (targetPackage != null) {
|
if (targetInfo != null) {
|
||||||
Intent prewarm = new Intent(MediaStore.ACTION_STILL_IMAGE_CAMERA_PREWARM);
|
String clazz = targetInfo.metaData.getString(
|
||||||
prewarm.setPackage(targetPackage);
|
MediaStore.META_DATA_STILL_IMAGE_CAMERA_PREWARM_SERVICE);
|
||||||
mPrewarmSent = true;
|
if (clazz != null) {
|
||||||
mContext.sendBroadcast(prewarm);
|
Intent serviceIntent = new Intent();
|
||||||
|
serviceIntent.setClassName(targetInfo.packageName, clazz);
|
||||||
|
serviceIntent.setAction(CameraPrewarmService.ACTION_PREWARM);
|
||||||
|
try {
|
||||||
|
getContext().bindServiceAsUser(serviceIntent, mPrewarmConnection,
|
||||||
|
Context.BIND_AUTO_CREATE, new UserHandle(UserHandle.USER_CURRENT));
|
||||||
|
} catch (SecurityException e) {
|
||||||
|
Log.w(TAG, "Unable to bind to prewarm service package=" + targetInfo.packageName
|
||||||
|
+ " class=" + clazz, e);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void maybeCooldownCamera() {
|
public void unbindCameraPrewarmService(boolean launched) {
|
||||||
if (!mPrewarmSent) {
|
if (mPrewarmBound) {
|
||||||
return;
|
if (launched) {
|
||||||
}
|
try {
|
||||||
mPrewarmSent = false;
|
mPrewarmMessenger.send(Message.obtain(null /* handler */,
|
||||||
Intent intent = getCameraIntent();
|
CameraPrewarmService.MSG_CAMERA_FIRED));
|
||||||
String targetPackage = PreviewInflater.getTargetPackage(mContext, intent,
|
} catch (RemoteException e) {
|
||||||
KeyguardUpdateMonitor.getCurrentUser());
|
Log.w(TAG, "Error sending camera fired message", e);
|
||||||
if (targetPackage != null) {
|
}
|
||||||
Intent prewarm = new Intent(MediaStore.ACTION_STILL_IMAGE_CAMERA_COOLDOWN);
|
}
|
||||||
prewarm.setPackage(targetPackage);
|
mContext.unbindService(mPrewarmConnection);
|
||||||
mContext.sendBroadcast(prewarm);
|
mPrewarmBound = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void launchCamera() {
|
public void launchCamera() {
|
||||||
|
|
||||||
// Reset prewarm state.
|
|
||||||
mPrewarmSent = false;
|
|
||||||
final Intent intent = getCameraIntent();
|
final Intent intent = getCameraIntent();
|
||||||
boolean wouldLaunchResolverActivity = PreviewInflater.wouldLaunchResolverActivity(
|
boolean wouldLaunchResolverActivity = PreviewInflater.wouldLaunchResolverActivity(
|
||||||
mContext, intent, KeyguardUpdateMonitor.getCurrentUser());
|
mContext, intent, KeyguardUpdateMonitor.getCurrentUser());
|
||||||
@@ -381,18 +413,47 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL
|
|||||||
AsyncTask.execute(new Runnable() {
|
AsyncTask.execute(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
mContext.startActivityAsUser(intent, UserHandle.CURRENT);
|
int result = ActivityManager.START_CANCELED;
|
||||||
|
try {
|
||||||
|
result = ActivityManagerNative.getDefault().startActivityAsUser(
|
||||||
|
null, getContext().getBasePackageName(),
|
||||||
|
intent,
|
||||||
|
intent.resolveTypeIfNeeded(getContext().getContentResolver()),
|
||||||
|
null, null, 0, Intent.FLAG_ACTIVITY_NEW_TASK, null, null,
|
||||||
|
UserHandle.CURRENT.getIdentifier());
|
||||||
|
} catch (RemoteException e) {
|
||||||
|
Log.w(TAG, "Unable to start camera activity", e);
|
||||||
|
}
|
||||||
mActivityStarter.preventNextAnimation();
|
mActivityStarter.preventNextAnimation();
|
||||||
|
final boolean launched = isSuccessfulLaunch(result);
|
||||||
|
post(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
unbindCameraPrewarmService(launched);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
// We need to delay starting the activity because ResolverActivity finishes itself if
|
// We need to delay starting the activity because ResolverActivity finishes itself if
|
||||||
// launched behind lockscreen.
|
// launched behind lockscreen.
|
||||||
mActivityStarter.startActivity(intent, false /* dismissShade */);
|
mActivityStarter.startActivity(intent, false /* dismissShade */,
|
||||||
|
new ActivityStarter.Callback() {
|
||||||
|
@Override
|
||||||
|
public void onActivityStarted(int resultCode) {
|
||||||
|
unbindCameraPrewarmService(isSuccessfulLaunch(resultCode));
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static boolean isSuccessfulLaunch(int result) {
|
||||||
|
return result == ActivityManager.START_SUCCESS
|
||||||
|
|| result == ActivityManager.START_DELIVERED_TO_TOP
|
||||||
|
|| result == ActivityManager.START_TASK_TO_FRONT;
|
||||||
|
}
|
||||||
|
|
||||||
public void launchLeftAffordance() {
|
public void launchLeftAffordance() {
|
||||||
if (mLeftIsVoiceAssist) {
|
if (mLeftIsVoiceAssist) {
|
||||||
launchVoiceAssist();
|
launchVoiceAssist();
|
||||||
@@ -412,8 +473,8 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL
|
|||||||
if (mPhoneStatusBar.isKeyguardCurrentlySecure()) {
|
if (mPhoneStatusBar.isKeyguardCurrentlySecure()) {
|
||||||
AsyncTask.execute(runnable);
|
AsyncTask.execute(runnable);
|
||||||
} else {
|
} else {
|
||||||
mPhoneStatusBar.executeRunnableDismissingKeyguard(runnable, false /* dismissShade */,
|
mPhoneStatusBar.executeRunnableDismissingKeyguard(runnable, null /* cancelAction */,
|
||||||
false /* afterKeyguardGone */);
|
false /* dismissShade */, false /* afterKeyguardGone */);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -95,16 +95,16 @@ public class KeyguardBouncer {
|
|||||||
mShowingSoon = false;
|
mShowingSoon = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void showWithDismissAction(OnDismissAction r) {
|
public void showWithDismissAction(OnDismissAction r, Runnable cancelAction) {
|
||||||
ensureView();
|
ensureView();
|
||||||
mKeyguardView.setOnDismissAction(r);
|
mKeyguardView.setOnDismissAction(r, cancelAction);
|
||||||
show(false /* resetSecuritySelection */);
|
show(false /* resetSecuritySelection */);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void hide(boolean destroyView) {
|
public void hide(boolean destroyView) {
|
||||||
cancelShowRunnable();
|
cancelShowRunnable();
|
||||||
if (mKeyguardView != null) {
|
if (mKeyguardView != null) {
|
||||||
mKeyguardView.setOnDismissAction(null);
|
mKeyguardView.cancelDismissAction();
|
||||||
mKeyguardView.cleanUp();
|
mKeyguardView.cleanUp();
|
||||||
}
|
}
|
||||||
if (destroyView) {
|
if (destroyView) {
|
||||||
|
|||||||
@@ -1934,12 +1934,12 @@ public class NotificationPanelView extends PanelView implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSwipingStarted(boolean isRightwardMotion) {
|
public void onSwipingStarted(boolean rightIcon) {
|
||||||
boolean start = getLayoutDirection() == LAYOUT_DIRECTION_RTL ? isRightwardMotion
|
boolean camera = getLayoutDirection() == LAYOUT_DIRECTION_RTL ? !rightIcon
|
||||||
: !isRightwardMotion;
|
: rightIcon;
|
||||||
if (!start) {
|
if (camera) {
|
||||||
mSecureCameraLaunchManager.onSwipingStarted();
|
mSecureCameraLaunchManager.onSwipingStarted();
|
||||||
mKeyguardBottomArea.prewarmCamera();
|
mKeyguardBottomArea.bindCameraPrewarmService();
|
||||||
}
|
}
|
||||||
requestDisallowInterceptTouchEvent(true);
|
requestDisallowInterceptTouchEvent(true);
|
||||||
mOnlyAffordanceInThisMotion = true;
|
mOnlyAffordanceInThisMotion = true;
|
||||||
@@ -1948,7 +1948,7 @@ public class NotificationPanelView extends PanelView implements
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSwipingAborted() {
|
public void onSwipingAborted() {
|
||||||
mKeyguardBottomArea.maybeCooldownCamera();
|
mKeyguardBottomArea.unbindCameraPrewarmService(false /* launched */);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1829,6 +1829,11 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
|
|||||||
startActivityDismissingKeyguard(intent, false, dismissShade);
|
startActivityDismissingKeyguard(intent, false, dismissShade);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void startActivity(Intent intent, boolean dismissShade, Callback callback) {
|
||||||
|
startActivityDismissingKeyguard(intent, false, dismissShade, callback);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void preventNextAnimation() {
|
public void preventNextAnimation() {
|
||||||
overrideActivityPendingAppTransition(true /* keyguardShowing */);
|
overrideActivityPendingAppTransition(true /* keyguardShowing */);
|
||||||
@@ -2711,7 +2716,12 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void startActivityDismissingKeyguard(final Intent intent, boolean onlyProvisioned,
|
public void startActivityDismissingKeyguard(final Intent intent, boolean onlyProvisioned,
|
||||||
final boolean dismissShade) {
|
boolean dismissShade) {
|
||||||
|
startActivityDismissingKeyguard(intent, onlyProvisioned, dismissShade, null /* callback */);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void startActivityDismissingKeyguard(final Intent intent, boolean onlyProvisioned,
|
||||||
|
final boolean dismissShade, final Callback callback) {
|
||||||
if (onlyProvisioned && !isDeviceProvisioned()) return;
|
if (onlyProvisioned && !isDeviceProvisioned()) return;
|
||||||
|
|
||||||
final boolean afterKeyguardGone = PreviewInflater.wouldLaunchResolverActivity(
|
final boolean afterKeyguardGone = PreviewInflater.wouldLaunchResolverActivity(
|
||||||
@@ -2721,16 +2731,35 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
|
|||||||
public void run() {
|
public void run() {
|
||||||
intent.setFlags(
|
intent.setFlags(
|
||||||
Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
||||||
mContext.startActivityAsUser(
|
int result = ActivityManager.START_CANCELED;
|
||||||
intent, new UserHandle(UserHandle.USER_CURRENT));
|
try {
|
||||||
|
result = ActivityManagerNative.getDefault().startActivityAsUser(
|
||||||
|
null, mContext.getBasePackageName(),
|
||||||
|
intent,
|
||||||
|
intent.resolveTypeIfNeeded(mContext.getContentResolver()),
|
||||||
|
null, null, 0, Intent.FLAG_ACTIVITY_NEW_TASK, null, null,
|
||||||
|
UserHandle.CURRENT.getIdentifier());
|
||||||
|
} catch (RemoteException e) {
|
||||||
|
Log.w(TAG, "Unable to start activity", e);
|
||||||
|
}
|
||||||
overrideActivityPendingAppTransition(
|
overrideActivityPendingAppTransition(
|
||||||
keyguardShowing && !afterKeyguardGone);
|
keyguardShowing && !afterKeyguardGone);
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onActivityStarted(result);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
executeRunnableDismissingKeyguard(runnable, dismissShade, afterKeyguardGone);
|
Runnable cancelRunnable = new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
callback.onActivityStarted(ActivityManager.START_CANCELED);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
executeRunnableDismissingKeyguard(runnable, cancelRunnable, dismissShade, afterKeyguardGone);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void executeRunnableDismissingKeyguard(final Runnable runnable,
|
public void executeRunnableDismissingKeyguard(final Runnable runnable,
|
||||||
|
final Runnable cancelAction,
|
||||||
final boolean dismissShade,
|
final boolean dismissShade,
|
||||||
final boolean afterKeyguardGone) {
|
final boolean afterKeyguardGone) {
|
||||||
final boolean keyguardShowing = mStatusBarKeyguardViewManager.isShowing();
|
final boolean keyguardShowing = mStatusBarKeyguardViewManager.isShowing();
|
||||||
@@ -2757,7 +2786,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}, afterKeyguardGone);
|
}, cancelAction, afterKeyguardGone);
|
||||||
}
|
}
|
||||||
|
|
||||||
private BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver() {
|
private BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver() {
|
||||||
@@ -2817,10 +2846,15 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void dismissKeyguardThenExecute(final OnDismissAction action,
|
protected void dismissKeyguardThenExecute(OnDismissAction action, boolean afterKeyguardGone) {
|
||||||
|
dismissKeyguardThenExecute(action, null /* cancelRunnable */, afterKeyguardGone);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void dismissKeyguardThenExecute(OnDismissAction action, Runnable cancelAction,
|
||||||
boolean afterKeyguardGone) {
|
boolean afterKeyguardGone) {
|
||||||
if (mStatusBarKeyguardViewManager.isShowing()) {
|
if (mStatusBarKeyguardViewManager.isShowing()) {
|
||||||
mStatusBarKeyguardViewManager.dismissWithAction(action, afterKeyguardGone);
|
mStatusBarKeyguardViewManager.dismissWithAction(action, cancelAction,
|
||||||
|
afterKeyguardGone);
|
||||||
} else {
|
} else {
|
||||||
action.onDismiss();
|
action.onDismiss();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -126,10 +126,11 @@ public class StatusBarKeyguardViewManager {
|
|||||||
updateStates();
|
updateStates();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void dismissWithAction(OnDismissAction r, boolean afterKeyguardGone) {
|
public void dismissWithAction(OnDismissAction r, Runnable cancelAction,
|
||||||
|
boolean afterKeyguardGone) {
|
||||||
if (mShowing) {
|
if (mShowing) {
|
||||||
if (!afterKeyguardGone) {
|
if (!afterKeyguardGone) {
|
||||||
mBouncer.showWithDismissAction(r);
|
mBouncer.showWithDismissAction(r, cancelAction);
|
||||||
} else {
|
} else {
|
||||||
mBouncer.show(false /* resetSecuritySelection */);
|
mBouncer.show(false /* resetSecuritySelection */);
|
||||||
mAfterKeyguardGoneAction = r;
|
mAfterKeyguardGoneAction = r;
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ package com.android.systemui.statusbar.policy;
|
|||||||
import android.content.ComponentName;
|
import android.content.ComponentName;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.content.pm.ActivityInfo;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.content.pm.ResolveInfo;
|
import android.content.pm.ResolveInfo;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
@@ -138,14 +139,14 @@ public class PreviewInflater {
|
|||||||
|
|
||||||
public static boolean wouldLaunchResolverActivity(Context ctx, Intent intent,
|
public static boolean wouldLaunchResolverActivity(Context ctx, Intent intent,
|
||||||
int currentUserId) {
|
int currentUserId) {
|
||||||
return getTargetPackage(ctx, intent, currentUserId) == null;
|
return getTargetActivityInfo(ctx, intent, currentUserId) == null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the target package of the intent it resolves to a specific package or {@code null} if
|
* @return the target activity info of the intent it resolves to a specific package or
|
||||||
* it resolved to the resolver activity
|
* {@code null} if it resolved to the resolver activity
|
||||||
*/
|
*/
|
||||||
public static String getTargetPackage(Context ctx, Intent intent,
|
public static ActivityInfo getTargetActivityInfo(Context ctx, Intent intent,
|
||||||
int currentUserId) {
|
int currentUserId) {
|
||||||
PackageManager packageManager = ctx.getPackageManager();
|
PackageManager packageManager = ctx.getPackageManager();
|
||||||
final List<ResolveInfo> appList = packageManager.queryIntentActivitiesAsUser(
|
final List<ResolveInfo> appList = packageManager.queryIntentActivitiesAsUser(
|
||||||
@@ -158,7 +159,7 @@ public class PreviewInflater {
|
|||||||
if (resolved == null || wouldLaunchResolverActivity(resolved, appList)) {
|
if (resolved == null || wouldLaunchResolverActivity(resolved, appList)) {
|
||||||
return null;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
return resolved.activityInfo.packageName;
|
return resolved.activityInfo;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,14 +21,14 @@
|
|||||||
|
|
||||||
<activity android:name=".CameraActivity"
|
<activity android:name=".CameraActivity"
|
||||||
android:theme="@android:style/Theme.NoTitleBar">
|
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>
|
<intent-filter>
|
||||||
<action android:name="android.media.action.STILL_IMAGE_CAMERA" />
|
<action android:name="android.media.action.STILL_IMAGE_CAMERA" />
|
||||||
<category android:name="android.intent.category.DEFAULT" />
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
</intent-filter>
|
</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>
|
||||||
|
|
||||||
<activity android:name=".SecureCameraActivity"
|
<activity android:name=".SecureCameraActivity"
|
||||||
@@ -37,16 +37,15 @@
|
|||||||
<action android:name="android.media.action.STILL_IMAGE_CAMERA_SECURE" />
|
<action android:name="android.media.action.STILL_IMAGE_CAMERA_SECURE" />
|
||||||
<category android:name="android.intent.category.DEFAULT" />
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
</intent-filter>
|
</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>
|
||||||
|
|
||||||
<receiver android:name=".PrewarmReceiver" >
|
<service android:name=".PrewarmService"
|
||||||
<intent-filter>
|
android:exported="true">
|
||||||
<action android:name="android.media.action.STILL_IMAGE_CAMERA_PREWARM" />
|
</service>
|
||||||
</intent-filter>
|
|
||||||
<intent-filter>
|
|
||||||
<action android:name="android.media.action.STILL_IMAGE_CAMERA_COOLDOWN" />
|
|
||||||
</intent-filter>
|
|
||||||
</receiver>
|
|
||||||
|
|
||||||
</application>
|
</application>
|
||||||
</manifest>
|
</manifest>
|
||||||
|
|||||||
@@ -16,6 +16,6 @@
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
<resources>
|
<resources>
|
||||||
<string name="activity_title">Assistant</string>
|
<string name="activity_title">Camera Prewarm test</string>
|
||||||
<string name="search_label">Orilla Search Engine</string>
|
<string name="search_label">Orilla Search Engine</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ package com.google.android.test.cameraprewarm;
|
|||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.WindowManager;
|
|
||||||
|
|
||||||
import com.google.android.test.cameraprewarm.R;
|
import com.google.android.test.cameraprewarm.R;
|
||||||
|
|
||||||
@@ -31,7 +30,6 @@ public class CameraActivity extends Activity {
|
|||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.camera_activity);
|
setContentView(R.layout.camera_activity);
|
||||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD);
|
|
||||||
Log.i(TAG, "Activity created");
|
Log.i(TAG, "Activity created");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,20 +16,18 @@
|
|||||||
|
|
||||||
package com.google.android.test.cameraprewarm;
|
package com.google.android.test.cameraprewarm;
|
||||||
|
|
||||||
import android.content.BroadcastReceiver;
|
import android.service.media.CameraPrewarmService;
|
||||||
import android.content.Context;
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.provider.MediaStore;
|
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
public class PrewarmReceiver extends BroadcastReceiver {
|
public class PrewarmService extends CameraPrewarmService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onReceive(Context context, Intent intent) {
|
public void onPrewarm() {
|
||||||
if (intent.getAction().equals(MediaStore.ACTION_STILL_IMAGE_CAMERA_PREWARM)) {
|
Log.i("PrewarmService", "Warming up");
|
||||||
Log.i(CameraActivity.TAG, "Prewarm received");
|
}
|
||||||
} else if (intent.getAction().equals(MediaStore.ACTION_STILL_IMAGE_CAMERA_COOLDOWN)){
|
|
||||||
Log.i(CameraActivity.TAG, "Cooldown received");
|
@Override
|
||||||
}
|
public void onCooldown(boolean cameraIntentFired) {
|
||||||
|
Log.i("PrewarmService", "Cooling down fired=" + cameraIntentFired);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user