一:去除摄像头的假对焦框
(vendor/)
(mediatek/proprietary/packages/apps/Camera/src/com/android/camera/FocusManager.java)
import java.util.ArrayList;
import java.util.List;
+import com.android.camera.ui.FocusIndicatorRotateLayout.Listener;
/**
* A class that handles everything about focus in still picture mode. This also handles the metering
@@ -56,7 +57,7 @@ import java.util.List;
* Touch the screen to change metering area.
*/
public class FocusManager implements CameraActivity.OnOrientationListener,
- CameraActivity.OnParametersReadyListener {
+ CameraActivity.OnParametersReadyListener,FocusIndicatorRotateLayout.Listener {
private static final String TAG = "FocusManager";
private static final int RESET_TOUCH_FOCUS = 0;
@@ -86,6 +87,11 @@ public class FocusManager implements CameraActivity.OnOrientationListener,
private Matrix mMatrix;
private Matrix mObjextMatrix;
+ private boolean mNeedPlaySound = false;
// The parent layout that includes only the focus indicator.
private FocusIndicatorRotateLayout mFocusIndicatorRotateLayout;
// The focus indicator view that holds the image resource.
@@ -228,6 +234,14 @@ public class FocusManager implements CameraActivity.OnOrientationListener,
mParameters = parameters;
mFocusAreaSupported = (mParameters.getMaxNumFocusAreas() > 0 && isSupported(
Parameters.FOCUS_MODE_AUTO, mParameters.getSupportedFocusModes()));
+ if (mFocusIndicatorRotateLayout != null) {
+ mFocusIndicatorRotateLayout.mCustomFocusSupported = mFocusAreaSupported;
+ mFocusIndicatorRotateLayout.setCustomListener(this);
+ }
// mLockAeAwbNeeded = (mInitialParameters.isAutoExposureLockSupported()
// ||
// mInitialParameters.isAutoWhiteBalanceLockSupported());
@@ -427,9 +441,23 @@ public class FocusManager implements CameraActivity.OnOrientationListener,
}
mListener.setFocusParameters();
if (moving) {
+ if (!mFocusAreaSupported) {
+ Log.e("vanzo","mNeedPlaySound-->false");
+ mNeedPlaySound = false;
+ }
mFocusIndicatorRotateLayout.showStart();
} else {
+/*
mFocusIndicatorRotateLayout.showSuccess(true);
+ */
+ if (mFocusAreaSupported)
+ mFocusIndicatorRotateLayout.showSuccess(true);
}
}
@@ -453,7 +481,11 @@ public class FocusManager implements CameraActivity.OnOrientationListener,
// Check if metering area or focus area is supported.
if (!mFocusAreaSupported) {
Log.i(TAG, "[onSingleTapUp] mFocusAreaSupported is false");
+ // return;
}
if (!mInitialized || mState == STATE_FOCUSING_SNAP_ON_FINISH || mState == STATE_UNKNOWN) {
return;
@@ -528,6 +560,14 @@ public class FocusManager implements CameraActivity.OnOrientationListener,
// it can't be called twice when focusing.
mListener.stopFaceDetection();
+ if (!mFocusAreaSupported) {
+ Log.e("vanzo","mNeedPlaySound-->true");
+ mNeedPlaySound = true;
+ }
// Set the focus area and metering area.
mListener.setFocusParameters();
Log.i(TAG, "onSingleTapUp, mFocusAreaSupported " + mFocusAreaSupported);
@@ -573,7 +613,13 @@ public class FocusManager implements CameraActivity.OnOrientationListener,
getFrameview().resume();
}
mState = STATE_IDLE;
+/*
updateFocusUI();
+ */
+ if (mFocusAreaSupported)
+ updateFocusUI();
+// End of Vanzo:tangshenghu
mHandler.removeMessages(RESET_TOUCH_FOCUS);
}
@@ -968,4 +1014,13 @@ public class FocusManager implements CameraActivity.OnOrientationListener,
return isSupported;
}
+ @Override
+ public void playFocusSound() {
+ if (mListener != null && mNeedPlaySound)
+ mListener.playSound(MediaActionSound.FOCUS_COMPLETE);
+ }
}
(mediatek/proprietary/packages/apps/Camera/src/com/android/camera/actor/PhotoActor.java)
// The next steps will be excuted only at the first time.
mCameraActivity.getFrameManager().initializeFrameView(false);
mIsInitialized = true;
+ mHandler.postDelayed(new Runnable() {
+ public void run() {
+ if(mCameraActivity==null||mCameraActivity.getParameters()==null){
+ return;
+ }
+ if (mCameraActivity.getParameters().getMaxNumFocusAreas() == 0)
+ mCameraActivity.getFocusManager().onAutoFocusMoving(true);
+ }
+ }, 1000);
}
private void startPreview(boolean needStop) {
@@ -983,7 +996,13 @@ public class PhotoActor extends CameraActor implements FocusManager.Listener,
if (mModuleManager.onSingleTapUp(view, x, y)) {
Log.i(TAG, "[onSingleTapUp] module manager has handled it,return.");
+ // return;
+ if (mCameraActivity.getCameraId() == 1)
+ return;
}
focusManager.onSingleTapUp(x, y);
(mediatek/proprietary/packages/apps/Camera/src/com/android/camera/ui/FocusIndicatorRotateLayout.java)
private Runnable mDisappear = new Disappear();
private Runnable mEndAction = new EndAction();
+ private Runnable mShowAction = new ShowAction();
+ public boolean mCustomFocusSupported = true;
+ Listener mListener = null;
+ public interface Listener {
+ void playFocusSound();
+ }
private static final int SCALING_UP_TIME = 1000;
private static final int SCALING_DOWN_TIME = 200;
private static final int DISAPPEAR_TIMEOUT = 200;
@@ -100,8 +110,20 @@ public class FocusIndicatorRotateLayout extends RotateLayout implements FocusInd
Log.d(TAG, "showStart mState = " + mState);
if (mState == STATE_IDLE) {
setDrawable(R.drawable.ic_focus_focusing);
+/*
animate().withLayer().setDuration(SCALING_UP_TIME).scaleX(1.5f).scaleY(1.5f);
mState = STATE_FOCUSING;
+ */
+ if (mCustomFocusSupported) {
+ animate().withLayer().setDuration(SCALING_UP_TIME).scaleX(1.5f).scaleY(1.5f);
+ mState = STATE_FOCUSING;
+ } else {
+ mState = STATE_FOCUSING;
+ animate().withLayer().setDuration(SCALING_UP_TIME)
+ .scaleX(1.5f).scaleY(1.5f).withEndAction(mShowAction);
+ }
}
}
@@ -113,6 +135,12 @@ public class FocusIndicatorRotateLayout extends RotateLayout implements FocusInd
animate().withLayer().setDuration(SCALING_DOWN_TIME).scaleX(1f).scaleY(1f)
.withEndAction(timeout ? mEndAction : null);
mState = STATE_FINISHING;
+ if (!mCustomFocusSupported && mListener != null)
+ mListener.playFocusSound();
}
}
@@ -145,6 +173,17 @@ public class FocusIndicatorRotateLayout extends RotateLayout implements FocusInd
}
}
+ private class ShowAction implements Runnable {
+ @Override
+ public void run() {
+ // Keep the focus indicator for some time.
+ showSuccess(true);
+ }
+ }
private class Disappear implements Runnable {
@Override
public void run() {
@@ -175,4 +214,11 @@ public class FocusIndicatorRotateLayout extends RotateLayout implements FocusInd
}
return true;
}
+ public void setCustomListener(Listener listener) {
+ mListener = listener;
+ }
二:插卡开机时去掉通知栏中的读取sim卡联系人的提示消息
(packages/apps/Contacts/SimProcessor/src/com/mediatek/simprocessor/SimProcessorService.java)
ExtensionManager.registerApplicationContext(getApplication());
mProcessorManager = new SimProcessorManager(this, mListener);
+/*
Notification notification = new Notification(android.R.drawable.ic_dialog_alert,
ONGOING_NOTIFICATION, System.currentTimeMillis());
startForeground(ONGOING_NOTIFICATION_ID, notification);
+*/
}
@Override
@@ -100,7 +102,7 @@ public class SimProcessorService extends Service {
public void onDestroy() {
super.onDestroy();
Log.i(TAG, "[onDestroy]...");
- stopForeground(true);
+// stopForeground(true);
System.exit(0);
}
三:更换默认锁屏壁纸
(frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java)
diff --git a/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
index 9cf7063..d896704 100644
--- a/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -51,6 +51,7 @@ import android.graphics.Rect;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
+import android.graphics.Bitmap;
import android.inputmethodservice.InputMethodService;
import android.media.AudioAttributes;
import android.media.MediaMetadata;
@@ -176,6 +177,11 @@ import com.android.systemui.statusbar.stack.NotificationStackScrollLayout.OnChil
import com.android.systemui.statusbar.stack.StackStateAnimator;
import com.android.systemui.statusbar.stack.StackViewState;
import com.android.systemui.volume.VolumeComponent;
+import android.app.WallpaperManager;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import android.provider.Settings;
/// M: BMW
import com.mediatek.multiwindow.MultiWindowManager;
@@ -749,6 +755,28 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
mScreenPinningRequest = new ScreenPinningRequest(mContext);
mFalsingManager = FalsingManager.getInstance(mContext);
+/*
+ * TODO: replace this line with your comment
+ */
+ if(Settings.System.getInt(mContext.getContentResolver(),"def_lock_wall_vanzo",0) != 1){
+ Settings.System.putInt(mContext.getContentResolver(),"def_lock_wall_vanzo" , 1);
+ WallpaperManager wallpaperManager = WallpaperManager.getInstance(mContext);
+ BitmapDrawable bitmapDrawable = (BitmapDrawable)mContext.getResources().getDrawable(R.drawable.default_lock_wallpaper);
+ Bitmap def