Android修改第三方应用相机方向

时间:2024-10-26 12:08:19
diff --git a/frameworks/base/core/java/android/hardware/Camera.java b/frameworks/base/core/java/android/hardware/Camera.java
index 8c7434b..7201481 100755
--- a/frameworks/base/core/java/android/hardware/Camera.java
+++ b/frameworks/base/core/java/android/hardware/Camera.java
@@ -384,6 +384,11 @@ public class Camera {
      */
     public static void getCameraInfo(int cameraId, CameraInfo cameraInfo) {
         _getCameraInfo(cameraId, cameraInfo);
+               if(ActivityThread.currentOpPackageName().equals("com.eusoft.eudic")){
+                       if(cameraInfo.facing == CameraInfo.CAMERA_FACING_BACK){
+                               cameraInfo.orientation = SystemProperties.getInt("persist.bs.camera.orientation", 90);
+                       }
+               }
         IBinder b = ServiceManager.getService(Context.AUDIO_SERVICE);
         IAudioService audioService = IAudioService.Stub.asInterface(b);
         try {