Merge "Handle the WatchRotation failed" into rvc-dev
This commit is contained in:
@@ -29,6 +29,7 @@ import android.os.Handler;
|
|||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
import android.os.RemoteException;
|
import android.os.RemoteException;
|
||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
|
import android.util.Log;
|
||||||
import android.view.IRotationWatcher.Stub;
|
import android.view.IRotationWatcher.Stub;
|
||||||
import android.view.MotionEvent;
|
import android.view.MotionEvent;
|
||||||
import android.view.Surface;
|
import android.view.Surface;
|
||||||
@@ -53,6 +54,7 @@ import java.util.function.Consumer;
|
|||||||
/** Contains logic that deals with showing a rotate suggestion button with animation. */
|
/** Contains logic that deals with showing a rotate suggestion button with animation. */
|
||||||
public class RotationButtonController {
|
public class RotationButtonController {
|
||||||
|
|
||||||
|
private static final String TAG = "StatusBar/RotationButtonController";
|
||||||
private static final int BUTTON_FADE_IN_OUT_DURATION_MS = 100;
|
private static final int BUTTON_FADE_IN_OUT_DURATION_MS = 100;
|
||||||
private static final int NAVBAR_HIDDEN_PENDING_ICON_TIMEOUT_MS = 20000;
|
private static final int NAVBAR_HIDDEN_PENDING_ICON_TIMEOUT_MS = 20000;
|
||||||
|
|
||||||
@@ -138,6 +140,9 @@ public class RotationButtonController {
|
|||||||
try {
|
try {
|
||||||
WindowManagerGlobal.getWindowManagerService()
|
WindowManagerGlobal.getWindowManagerService()
|
||||||
.watchRotation(mRotationWatcher, mContext.getDisplay().getDisplayId());
|
.watchRotation(mRotationWatcher, mContext.getDisplay().getDisplayId());
|
||||||
|
} catch (IllegalArgumentException e) {
|
||||||
|
mListenersRegistered = false;
|
||||||
|
Log.w(TAG, "RegisterListeners for the display failed");
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
throw e.rethrowFromSystemServer();
|
throw e.rethrowFromSystemServer();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user