I want to keep screen orientation and application when I lock the screen.
But when I unlock the screen after lock screen while application is running, then device shows only black screen. It reacts by touch (checked by log) but shows nothing. I'm using TextureView with fullscreen size.
I use Samsung Galaxy Note 4 for developing, and its android version is 4.4.4.
- Launch application(which is developed by me).
- Lock screen.
- Unlock screen.
- Black screen shown. <== My Problem
Log for launch application, screen lock, screen unlock about WindowManager is following.
11-14 18:55:26.132: V/WindowOrientationListener(3409): mSContextAutoRotationListener.getProposedRotation, mbResultFaceDectection: false
11-14 18:55:26.132: V/WindowOrientationListener(3409): mSContextAutoRotationListener.getProposedRotation, Rotation: -1
11-14 18:55:26.132: V/WindowOrientationListener(3409): mSContextAutoRotationListener.getProposedRotation, mbResultFaceDectection: false
11-14 18:55:26.132: V/WindowOrientationListener(3409): mSContextAutoRotationListener.getProposedRotation, Rotation: -1
11-14 18:55:26.132: V/WindowManager(3409): rotationForOrientationLw(orient=0, last=0); user=0 USER_ROTATION_LOCKED sensorRotation=-1 mLidState=-1 mDockMode=0 mHdmiPlugged=false mAccelerometerDefault=false gripRotationLock=false
11-14 18:55:26.142: D/SamsungWindowManager(3409): setRotationLw() : rotation=1
11-14 18:55:26.187: D/WindowManager(3409): performLayoutAndPlaceSurfacesLocked called before config changed.
11-14 18:55:26.217: D/CenterBarWindow(21578): onConfigurationChanged point = Point(1280, 720)
11-14 18:55:26.217: D/WindowManager(3409): performLayoutAndPlaceSurfacesLocked called before config changed.
11-14 18:55:26.477: I/WindowManager(3409): Screen frozen for +337ms due to Window{452f1008 u0 Starting net.herit.iotwm.smartphone}
11-14 18:55:27.062: V/WindowOrientationListener(3409): mSContextAutoRotationListener.getProposedRotation, mbResultFaceDectection: false
11-14 18:55:27.062: V/WindowOrientationListener(3409): mSContextAutoRotationListener.getProposedRotation, Rotation: -1
11-14 18:55:27.062: V/WindowOrientationListener(3409): mSContextAutoRotationListener.getProposedRotation, mbResultFaceDectection: false
11-14 18:55:27.062: V/WindowOrientationListener(3409): mSContextAutoRotationListener.getProposedRotation, Rotation: -1
11-14 18:55:27.062: V/WindowManager(3409): rotationForOrientationLw(orient=0, last=1); user=0 USER_ROTATION_LOCKED sensorRotation=-1 mLidState=-1 mDockMode=0 mHdmiPlugged=false mAccelerometerDefault=false gripRotationLock=false
11-14 18:55:30.532: V/WindowOrientationListener(3409): mSContextAutoRotationListener.getProposedRotation, mbResultFaceDectection: false
11-14 18:55:30.532: V/WindowOrientationListener(3409): mSContextAutoRotationListener.getProposedRotation, Rotation: -1
11-14 18:55:30.532: V/WindowOrientationListener(3409): mSContextAutoRotationListener.getProposedRotation, mbResultFaceDectection: false
11-14 18:55:30.532: V/WindowOrientationListener(3409): mSContextAutoRotationListener.getProposedRotation, Rotation: -1
11-14 18:55:30.532: V/WindowManager(3409): rotationForOrientationLw(orient=1, last=1); user=0 USER_ROTATION_LOCKED sensorRotation=-1 mLidState=-1 mDockMode=0 mHdmiPlugged=false mAccelerometerDefault=false gripRotationLock=false
11-14 18:55:30.547: D/SamsungWindowManager(3409): setRotationLw() : rotation=0
11-14 18:55:30.567: D/WindowManager(3409): performLayoutAndPlaceSurfacesLocked called before config changed.
11-14 18:55:30.587: D/WindowManager(3409): performLayoutAndPlaceSurfacesLocked called before config changed.
11-14 18:55:30.597: D/CenterBarWindow(21578): onConfigurationChanged point = Point(720, 1280)
11-14 18:55:30.807: I/WindowManager(3409): Screen frozen for +257ms due to Window{43593a68 u0 Keyguard}
11-14 18:55:31.287: V/WindowOrientationListener(3409): mSContextAutoRotationListener.getProposedRotation, mbResultFaceDectection: false
11-14 18:55:31.287: V/WindowOrientationListener(3409): mSContextAutoRotationListener.getProposedRotation, Rotation: -1
11-14 18:55:31.287: V/WindowOrientationListener(3409): mSContextAutoRotationListener.getProposedRotation, mbResultFaceDectection: false
11-14 18:55:31.287: V/WindowOrientationListener(3409): mSContextAutoRotationListener.getProposedRotation, Rotation: -1
11-14 18:55:31.287: V/WindowManager(3409): rotationForOrientationLw(orient=1, last=0); user=0 USER_ROTATION_LOCKED sensorRotation=-1 mLidState=-1 mDockMode=0 mHdmiPlugged=false mAccelerometerDefault=false gripRotationLock=false
11-14 18:55:32.472: E/SamsungWindowManager(3409): mCoreNumLockHelper.acquire
11-14 18:55:32.517: I/WindowManager(3409): Lock screen displayed!
11-14 18:55:34.717: V/WindowOrientationListener(3409): mSContextAutoRotationListener.getProposedRotation, mbResultFaceDectection: false
11-14 18:55:34.717: V/WindowOrientationListener(3409): mSContextAutoRotationListener.getProposedRotation, Rotation: -1
11-14 18:55:34.717: V/WindowOrientationListener(3409): mSContextAutoRotationListener.getProposedRotation, mbResultFaceDectection: false
11-14 18:55:34.717: V/WindowOrientationListener(3409): mSContextAutoRotationListener.getProposedRotation, Rotation: -1
11-14 18:55:34.717: V/WindowManager(3409): rotationForOrientationLw(orient=0, last=0); user=0 USER_ROTATION_LOCKED sensorRotation=-1 mLidState=-1 mDockMode=0 mHdmiPlugged=false mAccelerometerDefault=false gripRotationLock=false
11-14 18:55:34.727: D/SamsungWindowManager(3409): setRotationLw() : rotation=1
11-14 18:55:34.747: D/WindowManager(3409): performLayoutAndPlaceSurfacesLocked called before config changed.
11-14 18:55:34.757: D/WindowManager(3409): performLayoutAndPlaceSurfacesLocked called before config changed.
11-14 18:55:34.797: D/CenterBarWindow(21578): onConfigurationChanged point = Point(1280, 720)
11-14 18:55:34.902: I/WindowManager(3409): Screen frozen for +169ms due to Window{446612a8 u0 MultiWindowTrayService/AppListWindow 0}
11-14 18:55:35.337: V/WindowOrientationListener(3409): mSContextAutoRotationListener.getProposedRotation, mbResultFaceDectection: false
11-14 18:55:35.337: V/WindowOrientationListener(3409): mSContextAutoRotationListener.getProposedRotation, Rotation: -1
11-14 18:55:35.337: V/WindowOrientationListener(3409): mSContextAutoRotationListener.getProposedRotation, mbResultFaceDectection: false
11-14 18:55:35.337: V/WindowOrientationListener(3409): mSContextAutoRotationListener.getProposedRotation, Rotation: -1
11-14 18:55:35.337: V/WindowManager(3409): rotationForOrientationLw(orient=0, last=1); user=0 USER_ROTATION_LOCKED sensorRotation=-1 mLidState=-1 mDockMode=0 mHdmiPlugged=false mAccelerometerDefault=false gripRotationLock=false
Manifest.xml is shown below.
...
android:configChanges="keyboardHidden|orientation|screenSize"
android:screenOrientation="landscape"
...
I'm sorry for my bad English. I really want to solve this problem. Somebody help me!