Android竖屏转横屏

高通7.1竖屏转横屏

 

竖屏转横屏的patch:

diff --git a/frameworks/base/cmds/bootanimation/BootAnimation.cpp b/frameworks/base/cmds/bootanimation/BootAnimation.cpp
old mode 100644
new mode 100755
index d4a9326..06375a5
--- a/frameworks/base/cmds/bootanimation/BootAnimation.cpp
+++ b/frameworks/base/cmds/bootanimation/BootAnimation.cpp
@@ -286,6 +286,18 @@ status_t BootAnimation::readyToRun() {
     status_t status = SurfaceComposerClient::getDisplayInfo(dtoken, &dinfo);
     if (status)
         return -1;
+    char value[PROPERTY_VALUE_MAX];
+    property_get("persist.panel.orientation", value, "0");
+    int orient = atoi(value) / 90;
+
+    if(orient == eOrientation90 || orient == eOrientation270) {
+        int temp = dinfo.h;
+        dinfo.h = dinfo.w;
+        dinfo.w = temp;
+    }
+
+    Rect destRect(dinfo.w, dinfo.h);
+    mSession->setDisplayProjection(dtoken, orient, destRect, destRect);
 
     // create the native surface
     sp<SurfaceControl> control = session()->createSurface(String8("BootAnimation"),
diff --git a/frameworks/base/cmds/bootanimation/BootAnimation.h b/frameworks/base/cmds/bootanimation/BootAnimation.h
old mode 100644
new mode 100755
index c0ae6b6..e357365
--- a/frameworks/base/cmds/bootanimation/BootAnimation.h
+++ b/frameworks/base/cmds/bootanimation/BootAnimation.h
@@ -39,6 +39,12 @@ class SurfaceControl;
 class BootAnimation : public Thread, public IBinder::DeathRecipient
 {
 public:
+    enum {
+        eOrientationDefault     = 0,
+        eOrientation90          = 1,
+        eOrientation180         = 2,
+        eOrientation270         = 3,
+    };
                 BootAnimation();
     virtual     ~BootAnimation();
 
diff --git a/frameworks/base/core/java/com/android/internal/view/RotationPolicy.java b/frameworks/base/core/java/com/android/internal/view/RotationPolicy.java
index b479cb1..a615298 100644
--- a/frameworks/base/core/java/com/android/internal/view/RotationPolicy.java
+++ b/frameworks/base/core/java/com/android/internal/view/RotationPolicy.java
@@ -25,6 +25,7 @@ import android.net.Uri;
 import android.os.AsyncTask;
 import android.os.Handler;
 import android.os.RemoteException;
+import android.os.SystemProperties;
 import android.os.UserHandle;
 import android.provider.Settings;
 import android.util.Log;
@@ -140,7 +141,9 @@ public final class RotationPolicy {
                 try {
                     IWindowManager wm = WindowManagerGlobal.getWindowManagerService();
                     if (enabled) {
-                        wm.freezeRotation(rotation);
+                        //wm.freezeRotation(rotation);
+                        wm.freezeRotation(SystemProperties.getInt(
+                                "persist.panel.orientation", 0)/90);
                     } else {
                         wm.thawRotation();
                     }
@@ -194,4 +197,4 @@ public final class RotationPolicy {
 
         public abstract void onChange();
     }
-}
\ No newline at end of file
+}
diff --git a/frameworks/base/packages/SettingsProvider/res/values/defaults.xml b/frameworks/base/packages/SettingsProvider/res/values/defaults.xml
index d9515e9..6e7559e 100755
--- a/frameworks/base/packages/SettingsProvider/res/values/defaults.xml
+++ b/frameworks/base/packages/SettingsProvider/res/values/defaults.xml
@@ -147,7 +147,7 @@
     <bool name="def_accessibility_display_magnification_auto_update">true</bool>
 
     <!-- Default for Settings.System.USER_ROTATION -->
-    <integer name="def_user_rotation">1</integer>
+    <integer name="def_user_rotation">0</integer>
 
     <!-- Default for Settings.Secure.DOWNLOAD_MAX_BYTES_OVER_MOBILE. <=0 if no limit -->
     <integer name="def_download_manager_max_bytes_over_mobile">-1</integer>
diff --git a/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowManager.java b/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowManager.java
old mode 100644
new mode 100755
index a7a792b..455a575
--- a/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowManager.java
+++ b/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowManager.java
@@ -127,11 +127,14 @@ public class StatusBarWindowManager implements RemoteInputController.Callback {
         if (state.isKeyguardShowingAndNotOccluded()) {
             if (mKeyguardScreenRotation) {
                 mLpChanged.screenOrientation = ActivityInfo.SCREEN_ORIENTATION_USER;
+				Log.i(TAG,"Tim orientation SCREEN_ORIENTATION_USER");
             } else {
-                mLpChanged.screenOrientation = ActivityInfo.SCREEN_ORIENTATION_NOSENSOR;
+                mLpChanged.screenOrientation = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;
+				Log.i(TAG,"Tim orientation SCREEN_ORIENTATION_NOSENSOR");
             }
         } else {
             mLpChanged.screenOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
+			Log.i(TAG,"Tim orientation SCREEN_ORIENTATION_UNSPECIFIED");
         }
     }
 
diff --git a/frameworks/base/services/core/java/com/android/server/policy/PhoneWindowManager.java b/frameworks/base/services/core/java/com/android/server/policy/PhoneWindowManager.java
old mode 100644
new mode 100755
index 8432af2..a22c75d
--- a/frameworks/base/services/core/java/com/android/server/policy/PhoneWindowManager.java
+++ b/frameworks/base/services/core/java/com/android/server/policy/PhoneWindowManager.java
@@ -676,6 +676,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
     int mOverscanRight = 0;
     int mOverscanBottom = 0;
 
+    int mPanelOrientation = Surface.ROTATION_0;
+
     // What we do when the user long presses on home
     private int mLongPressOnHomeBehavior;
 
@@ -1857,6 +1859,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
             return;
         }
         mDisplay = display;
+		mPanelOrientation =SystemProperties.getInt("persist.panel.orientation", 0) / 90;
 
         final Resources res = mContext.getResources();
         int shortSize, longSize;
@@ -6801,7 +6804,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                     mAllowAllRotations = mContext.getResources().getBoolean(
                             com.android.internal.R.bool.config_allowAllRotations) ? 1 : 0;
                 }
-                if (sensorRotation != Surface.ROTATION_180
+                if (sensorRotation != mUpsideDownRotation
                         || mAllowAllRotations == 1
                         || orientation == ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR
                         || orientation == ActivityInfo.SCREEN_ORIENTATION_FULL_USER) {
@@ -6879,7 +6882,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                     if (preferredRotation >= 0) {
                         return preferredRotation;
                     }
-                    return Surface.ROTATION_0;
+                    return mPanelOrientation;
             }
         }
     }
diff --git a/frameworks/base/services/core/java/com/android/server/wm/WindowManagerService.java b/frameworks/base/services/core/java/com/android/server/wm/WindowManagerService.java
old mode 100644
new mode 100755
index 149d1dc..64d23bb
--- a/frameworks/base/services/core/java/com/android/server/wm/WindowManagerService.java
+++ b/frameworks/base/services/core/java/com/android/server/wm/WindowManagerService.java
@@ -558,7 +558,7 @@ public class WindowManagerService extends IWindowManager.Stub
     /** All DisplayContents in the world, kept here */
     SparseArray<DisplayContent> mDisplayContents = new SparseArray<>(2);
 
-    int mRotation = 0;
+    int mRotation = SystemProperties.getInt("persist.panel.orientation", 0) / 90;
     int mLastOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
     boolean mAltOrientation = false;
 
diff --git a/frameworks/native/services/surfaceflinger/DisplayDevice.cpp b/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
old mode 100644
new mode 100755
index f1450cf..c66dce7
--- a/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
+++ b/frameworks/native/services/surfaceflinger/DisplayDevice.cpp
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-// #define LOG_NDEBUG 0
+#define LOG_NDEBUG 0
 #undef LOG_TAG
 #define LOG_TAG "DisplayDevice"
 
@@ -168,8 +168,16 @@ DisplayDevice::DisplayDevice(
     property_get("ro.panel.mountflip", property, "0");
     mPanelMountFlip = atoi(property);
 
+	int panelOrientation = DisplayState::eOrientationDefault;
+    // Set the panel orientation from the property.
+    property_get("persist.panel.orientation", property, "0");
+    panelOrientation = atoi(property) / 90;
+
     // initialize the display orientation transform.
-    setProjection(DisplayState::eOrientationDefault, mViewport, mFrame);
+    setProjection(panelOrientation, mViewport, mFrame);
+
+	// initialize the display orientation transform.
+    //setProjection(DisplayState::eOrientationDefault, mViewport, mFrame);
 
 #ifdef NUM_FRAMEBUFFER_SURFACE_BUFFERS
     surface->allocateBuffers();
diff --git a/frameworks/native/services/surfaceflinger/SurfaceFlinger.cpp b/frameworks/native/services/surfaceflinger/SurfaceFlinger.cpp
old mode 100644
new mode 100755
index 6cdc80d..f066ebc
--- a/frameworks/native/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/frameworks/native/services/surfaceflinger/SurfaceFlinger.cpp
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-// #define LOG_NDEBUG 0
+#define LOG_NDEBUG 0
 #define ATRACE_TAG ATRACE_TAG_GRAPHICS
 
 #include <stdint.h>
@@ -1556,8 +1556,45 @@ void SurfaceFlinger::handleTransactionLocked(uint32_t transactionFlags)
                                 || (state.viewport != draw[i].viewport)
                                 || (state.frame != draw[i].frame))
                         {
-                            disp->setProjection(state.orientation,
-                                    state.viewport, state.frame);
+                        	
+
+
+#ifdef 1
+														int orient = state.orientation;
+														// Honor the orientation change after boot
+														// animation completes and make sure boot
+														// animation is shown in panel orientation always.
+														if(mBootFinished){
+															disp->setProjection(state.orientation,
+																	state.viewport, state.frame);
+															orient = state.orientation;
+														}
+														else{
+															char property[PROPERTY_VALUE_MAX];
+															int panelOrientation =
+																	DisplayState::eOrientationDefault;
+															if(property_get("persist.panel.orientation",
+																		property, "0") > 0){
+																panelOrientation = atoi(property) / 90;
+															}
+															disp->setProjection(panelOrientation,
+																	state.viewport, state.frame);
+															orient = panelOrientation;
+														}
+														// Set the view frame of each display only of its
+														// default orientation.
+														if(orient == DisplayState::eOrientationDefault and
+																state.frame.isValid()) {
+															qdutils::setViewFrame(disp->getHwcDisplayId(),
+																state.frame.left, state.frame.top,
+																state.frame.right, state.frame.bottom);
+														}
+#else
+														disp->setProjection(state.orientation,
+															state.viewport, state.frame);
+#endif
+
+				//end
                         }
                         if (state.width != draw[i].width || state.height != draw[i].height) {
                             disp->setDisplaySize(state.width, state.height);


diff --git a/device/qcom/msm8952_64/system.prop b/device/qcom/msm8952_64/system.prop
index ccb4468..4ecae2c 100755
--- a/device/qcom/msm8952_64/system.prop
+++ b/device/qcom/msm8952_64/system.prop
@@ -227,3 +227,13 @@ sched.colocate.enable=1
 persist.radio.lw_enabled=true
 
 persist.sys.usb.config=diag,serial_smd,rmnet_ipa,adb

+persist.panel.orientation=90

1.以上补丁请谨慎运用,修改之后开机动画还是会有问题(会出现黑屏),其它的recovery可能还是会有影响。

2.RotationPolicy的修改会使其只能固定到横屏的方向,若是固定其它方向,会出现半边黑屏的问题

3.recovery的方向还未修改

./device/qcom/msm8916_64/chinachip/C10/system.prop:35:persist.panel.orientation=90
./device/qcom/msm8916_64/system.prop:173:#persist.panel.orientation=270
./frameworks/native/services/surfaceflinger/DisplayDevice.cpp:134:    property_get("persist.panel.orientation", property, "0");
./frameworks/native/services/surfaceflinger/SurfaceFlinger.cpp:1562:                                if(property_get("persist.panel.orientation",
./frameworks/base/core/java/com/android/internal/view/RotationPolicy.java:147:                                "persist.panel.orientation", 0)/90);
./frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java:1666:            SystemProperties.getInt("persist.panel.orientation", 0) / 90;
./frameworks/base/services/core/java/com/android/server/wm/WindowManagerService.java:489:    int mRotation = SystemProperties.getInt("persist.panel.orientation", 0) / 90;
./frameworks/base/cmds/bootanimation/BootAnimation.cpp:335:    property_get("persist.panel.orientation", value, "0");
 

 

调试过程中遇到的问题:

1.第一次刷机开机后还是竖屏显示,第二次开机正常

高通的代码中有一个apk:Setup_Wizard,这个应用会覆盖Provision。并且它的主activity被写成了竖屏。

diff --git a/vendor/qcom/proprietary/qrdplus/Extension/apps/SetupWizard/AndroidManifest.xml b/vendor/qcom/proprietary/qrdplus/Extension/apps/SetupWizard/AndroidManifest.xml
index 421f846..b323654 100755
--- a/vendor/qcom/proprietary/qrdplus/Extension/apps/SetupWizard/AndroidManifest.xml
+++ b/vendor/qcom/proprietary/qrdplus/Extension/apps/SetupWizard/AndroidManifest.xml
@@ -28,7 +28,7 @@
             android:name=".SetupWelcomeActivity"
             android:excludeFromRecents="true"
             android:launchMode="singleTask"
-            android:screenOrientation="portrait" >
+           android:screenOrientation="nosensor" >
             <intent-filter android:priority="3">
                 <action android:name="android.intent.action.MAIN" />
                 <category android:name="android.intent.category.HOME" />
@@ -49,4 +49,4 @@
         </activity>
     </application>
 
-</manifest>
\ No newline at end of file
+</manifest>
 

2.刷机第一次开机黑屏

原因:高通的代码中有一个apk:Setup_Wizard,这个应用会覆盖Provision,这个应用显示的是黑屏

解决方法:

diff --git a/frameworks/base/packages/SettingsProvider/res/values/defaults.xml b/frameworks/base/packages/SettingsProvider/res/values/defaults.xml
index d9515e9..41001be 100755
--- a/frameworks/base/packages/SettingsProvider/res/values/defaults.xml
+++ b/frameworks/base/packages/SettingsProvider/res/values/defaults.xml
@@ -82,7 +82,7 @@
     <string name="def_wireless_charging_started_sound" translatable="false">/system/media/audio/ui/WirelessChargingStarted.ogg</string>
 
     <bool name="def_lockscreen_disabled">false</bool>
-    <bool name="def_device_provisioned">false</bool>
+    <bool name="def_device_provisioned">true</bool>
     <integer name="def_dock_audio_media_enabled">1</integer>
 
     <!-- Notifications use ringer volume -->
@@ -176,7 +176,7 @@
     <integer name="def_max_dhcp_retries">9</integer>
 
     <!-- Default for Settings.Secure.USER_SETUP_COMPLETE -->
-    <bool name="def_user_setup_complete">false</bool>
+    <bool name="def_user_setup_complete">true</bool>
 
     <!-- Default for Settings.Global.LOW_BATTERY_SOUND_TIMEOUT.
          0 means no timeout; battery sounds will always play
diff --git a/packages/apps/Provision/Android.mk b/packages/apps/Provision/Android.mk
old mode 100644
new mode 100755
index e03490f..a97df90
--- a/packages/apps/Provision/Android.mk
+++ b/packages/apps/Provision/Android.mk
@@ -1,14 +1,14 @@
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_SRC_FILES := $(call all-subdir-java-files)
-
-LOCAL_PACKAGE_NAME := Provision
-LOCAL_CERTIFICATE := platform
-LOCAL_PRIVILEGED_MODULE := true
-
-LOCAL_PROGUARD_FLAG_FILES := proguard.flags
-
-include $(BUILD_PACKAGE)
+#LOCAL_PATH:= $(call my-dir)
+#include $(CLEAR_VARS)
+#
+#LOCAL_MODULE_TAGS := optional
+#
+#LOCAL_SRC_FILES := $(call all-subdir-java-files)
+#
+#LOCAL_PACKAGE_NAME := Provision
+#LOCAL_CERTIFICATE := platform
+#LOCAL_PRIVILEGED_MODULE := true
+#
+#LOCAL_PROGUARD_FLAG_FILES := proguard.flags
+#
+#include $(BUILD_PACKAGE)
diff --git a/vendor/qcom/proprietary/qrdplus/Extension/products.mk b/vendor/qcom/proprietary/qrdplus/Extension/products.mk
index b22e9c4..61ab48f 100755
--- a/vendor/qcom/proprietary/qrdplus/Extension/products.mk
+++ b/vendor/qcom/proprietary/qrdplus/Extension/products.mk
@@ -50,7 +50,6 @@ PRODUCT_PACKAGES += \
     LunarInfoProvider \
     ZeroBalanceHelper \
     libdatactrl \
-    Setup_Wizard \
     ConfigurationClient \
     OmaDownload \
     libomadrmengine \
-- 
1.9.1

 

3.每次开机都会黑屏

原因:wallpaper未加载出来。

解决方法,优化壁纸显示。调试中发现如果预先设置了壁纸,就不会有黑屏的现象,所以当时的方法是预拷贝壁纸资源。

commit bb900c2ea7b8df5366e5bc1b20932abdc8e3fcd0
Author: lmzhong <lmzhong@chinachip.com>
Date:   Thu Jun 13 17:10:59 2019 +0800

    [G35W][boot][NA][fix]解决每次开机黑屏问题

diff --git a/frameworks/base/core/res/res/drawable-nodpi/custom_default_wallpaper.png b/frameworks/base/core/res/res/drawable-nodpi/custom_default_wallpaper.png
new file mode 100755
index 0000000..cb00d82
Binary files /dev/null and b/frameworks/base/core/res/res/drawable-nodpi/custom_default_wallpaper.png differ
diff --git a/frameworks/base/core/res/res/values/symbols.xml b/frameworks/base/core/res/res/values/symbols.xml
index 4607c77..0519024 100755
--- a/frameworks/base/core/res/res/values/symbols.xml
+++ b/frameworks/base/core/res/res/values/symbols.xml
@@ -1160,6 +1160,7 @@
   <java-symbol type="array" name="config_keySystemUuidMapping" />
   <java-symbol type="array" name="config_gpsParameters" />
 
+  <java-symbol type="drawable" name="custom_default_wallpaper" />
   <java-symbol type="drawable" name="default_wallpaper" />
   <java-symbol type="drawable" name="default_lock_wallpaper" />
   <java-symbol type="drawable" name="indicator_input_error" />
diff --git a/frameworks/base/packages/SystemUI/src/com/android/systemui/ImageWallpaper.java b/frameworks/base/packages/SystemUI/src/com/android/systemui/ImageWallpaper.java
index f76a68c..b5e0693 100644
--- a/frameworks/base/packages/SystemUI/src/com/android/systemui/ImageWallpaper.java
+++ b/frameworks/base/packages/SystemUI/src/com/android/systemui/ImageWallpaper.java
@@ -495,9 +495,9 @@ public class ImageWallpaper extends WallpaperService {
                     }
                     updateSurfaceSize(getSurfaceHolder(), getDefaultDisplayInfo(),
                             false /* forDraw */);
-                    if (mNeedsDrawAfterLoadingWallpaper) {
+                    /*if (mNeedsDrawAfterLoadingWallpaper) {
                         drawFrame();
-                    }
+                    }*/
 
                     mLoader = null;
                     mNeedsDrawAfterLoadingWallpaper = false;
diff --git a/frameworks/base/services/core/java/com/android/server/pm/UserManagerService.java b/frameworks/base/services/core/java/com/android/server/pm/UserManagerService.java
old mode 100644
new mode 100755
index af055da..5649448
--- a/frameworks/base/services/core/java/com/android/server/pm/UserManagerService.java
+++ b/frameworks/base/services/core/java/com/android/server/pm/UserManagerService.java
@@ -43,6 +43,7 @@ import android.content.pm.PackageManager;
 import android.content.pm.PackageManager.NameNotFoundException;
 import android.content.pm.UserInfo;
 import android.content.res.Resources;
+import android.content.res.Resources.NotFoundException;
 import android.graphics.Bitmap;
 import android.os.Binder;
 import android.os.Build;
@@ -107,6 +108,7 @@ import java.io.BufferedOutputStream;
 import java.io.File;
 import java.io.FileDescriptor;
 import java.io.FileInputStream;
+import java.io.InputStream;
 import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
 import java.io.IOException;
@@ -430,6 +432,7 @@ public class UserManagerService extends IUserManager.Stub {
             FileUtils.setPermissions(mUsersDir.toString(),
                     FileUtils.S_IRWXU | FileUtils.S_IRWXG | FileUtils.S_IROTH | FileUtils.S_IXOTH,
                     -1, -1);
+                       copyWallpaperToUserDirSync(UserHandle.USER_SYSTEM);
             mUserListFile = new File(mUsersDir, USER_LIST_FILENAME);
             initDefaultGuestRestrictions();
             readUserListLP();
@@ -2260,7 +2263,8 @@ public class UserManagerService extends IUserManager.Stub {
 
                 userId = getNextAvailableId();
                 Environment.getUserSystemDirectory(userId).mkdirs();
-                boolean ephemeralGuests = Resources.getSystem()
+                               copyWallpaperToUserDirSync(userId);
+                           boolean ephemeralGuests = Resources.getSystem()
                         .getBoolean(com.android.internal.R.bool.config_guestUserEphemeral);
 
                 synchronized (mUsersLock) {
@@ -2329,6 +2333,47 @@ public class UserManagerService extends IUserManager.Stub {
         return userInfo;
     }
 
+    //copy the default_wallpaper to /data/system/users/id/
+       private void copyWallpaperToUserDirSync(int userId){
+               new Thread(){
+                       @Override
+                       public void run() {
+                           super.run();
+                               File wallpaper_orig = null;
+                           try{
+                               Slog.i(LOG_TAG,"Tim_Boot createUser copy wallpaper start");
+                               final int defaultResId = com.android.internal.R.drawable.custom_default_wallpaper;
+                                       InputStream wallpaper_orig_is = mContext.getResources().openRawResource(defaultResId);
+                               wallpaper_orig = new File(Environment.getUserSystemDirectory(userId),"wallpaper_orig");
+
+                                       /*InputStream wallpaper_is = mContext.getResources().openRawResource(com.android.internal.R.raw.wallpaper);
+                               File wallpaper = new File(Environment.getUserSystemDirectory(userId),"wallpaper");
+
+                                       InputStream wallpaper_info_is = mContext.getResources().openRawResource(com.android.internal.R.raw.wallpaper);
+                                       File wallpaper_info = new File(Environment.getUserSystemDirectory(userId),"wallpaper_info.xml");
+*/
+                                       if(!wallpaper_orig.exists()){
+                                   FileUtils.copyToFileOrThrow(wallpaper_orig_is, wallpaper_orig);
+                                   FileUtils.setPermissions(wallpaper_orig,FileUtils.S_IRWXU,-1,-1);
+
+                                               /*FileUtils.copyToFileOrThrow(wallpaper_is, wallpaper);
+                                   FileUtils.setPermissions(wallpaper,FileUtils.S_IRUSR,-1,-1);
+                                               
+                                               FileUtils.copyToFileOrThrow(wallpaper_info_is, wallpaper_info);
+                                   FileUtils.setPermissions(wallpaper_info,FileUtils.S_IRUSR,-1,-1);*/
+                                       
+                               }
+                               Slog.i(LOG_TAG,"Tim_Boot createUser copy wallpaper end");
+                           }catch(IOException | NotFoundException e){
+                               e.printStackTrace();
+                                       wallpaper_orig.delete();
+                               /*      wallpaper.delete();
+                                       wallpaper_info.delete();*/
+                           }
+                       }
+               }.start();
+       }
+
     /**
      * @hide
      */
diff --git a/frameworks/base/services/core/java/com/android/server/policy/PhoneWindowManager.java b/frameworks/base/services/core/java/com/android/server/policy/PhoneWindowManager.java
old mode 100644
new mode 100755
index 1ae5615..b0a1987
--- a/frameworks/base/services/core/java/com/android/server/policy/PhoneWindowManager.java
+++ b/frameworks/base/services/core/java/com/android/server/policy/PhoneWindowManager.java
@@ -6989,17 +6989,17 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                 }
             });
 
-            bindKeyguardNow = mDeferBindKeyguard;
+            /*bindKeyguardNow = mDeferBindKeyguard;
             if (bindKeyguardNow) {
                 // systemBooted ran but wasn't able to bind to the Keyguard, we'll do it now.
                 mDeferBindKeyguard = false;
-            }
+            }*/
         }
 
-        if (bindKeyguardNow) {
+        //if (bindKeyguardNow) {
             mKeyguardDelegate.bindService(mContext);
             mKeyguardDelegate.onBootCompleted();
-        }
+        //}
         mSystemGestures.systemReady();
         mImmersiveModeConfirmation.systemReady();
     }
@@ -7007,7 +7007,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
     /** {@inheritDoc} */
     @Override
     public void systemBooted() {
-        boolean bindKeyguardNow = false;
+        /*boolean bindKeyguardNow = false;
         synchronized (mLock) {
             // Time to bind Keyguard; take care to only bind it once, either here if ready or
             // in systemReady if not.
@@ -7022,7 +7022,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
         if (bindKeyguardNow) {
             mKeyguardDelegate.bindService(mContext);
             mKeyguardDelegate.onBootCompleted();
-        }
+        }*/
         synchronized (mLock) {
             mSystemBooted = true;
         }
diff --git a/frameworks/base/services/core/java/com/android/server/policy/keyguard/KeyguardServiceDelegate.java b/frameworks/base/services/core/java/com/android/server/policy/keyguard/KeyguardServiceDelegate.java
index 29a1f07..8aaf429 100644
--- a/frameworks/base/services/core/java/com/android/server/policy/keyguard/KeyguardServiceDelegate.java
+++ b/frameworks/base/services/core/java/com/android/server/policy/keyguard/KeyguardServiceDelegate.java
@@ -375,7 +375,8 @@ public class KeyguardServiceDelegate {
         lp.softInputMode = WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE;
         lp.screenOrientation = ActivityInfo.SCREEN_ORIENTATION_NOSENSOR;
         lp.privateFlags |= WindowManager.LayoutParams.PRIVATE_FLAG_FAKE_HARDWARE_ACCELERATED;
-        lp.setTitle("KeyguardScrim");
+       lp.privateFlags |= WindowManager.LayoutParams.PRIVATE_FLAG_NO_MOVE_ANIMATION;        
+       lp.setTitle("KeyguardScrim");
         final WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
         // Disable pretty much everything in statusbar until keyguard comes back and we know
         // the state of the world.
@@ -384,7 +385,8 @@ public class KeyguardServiceDelegate {
                 | View.STATUS_BAR_DISABLE_RECENT
                 | View.STATUS_BAR_DISABLE_EXPAND
                 | View.STATUS_BAR_DISABLE_SEARCH);
-        handler.post(new Runnable() {
+       view.setVisibility(View.INVISIBLE);
+       handler.post(new Runnable() {
             @Override
             public void run() {
                 wm.addView(view, lp);
diff --git a/frameworks/base/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java b/frameworks/base/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java
index 109b77f..2a554a7 100644
--- a/frameworks/base/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java
+++ b/frameworks/base/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java
@@ -1981,7 +1981,11 @@ public class WallpaperManagerService extends IWallpaperManager.Stub {
         if (wallpaper == null) {
             wallpaper = new WallpaperData(userId, WALLPAPER, WALLPAPER_CROP);
             wallpaper.allowBackup = true;
-            mWallpaperMap.put(userId, wallpaper);
+           if (!wallpaper.cropExists()) {
+                wallpaper.width = 3480;
+               wallpaper.height = 2560;
+            }
+           mWallpaperMap.put(userId, wallpaper);
             if (!wallpaper.cropExists()) {
                 generateCrop(wallpaper);
             }

 

所有patch,百度去下载:

链接: https://pan.baidu.com/s/1jzGdG5rJdtIWwy_2jnJKzw 提取码: 7teg

参考博客:

https://blog.csdn.net/eliot_shao/article/details/70766283

https://blog.csdn.net/q1183345443/article/details/53068526

https://blog.csdn.net/LoongEmbedded/article/details/81093087

https://blog.csdn.net/iteye_2886/article/details/82435382

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值