Loading packages/SystemUI/shared/src/com/android/systemui/shared/rotation/RotationButtonController.java +24 −23 Original line number Diff line number Diff line Loading @@ -68,6 +68,7 @@ import com.android.systemui.shared.system.TaskStackChangeListeners; import java.io.PrintWriter; import java.util.Optional; import java.util.concurrent.Executor; import java.util.concurrent.ThreadPoolExecutor; import java.util.function.Supplier; /** Loading Loading @@ -199,6 +200,10 @@ public class RotationButtonController { return mContext; } /** * We should pass single threaded executor (rather than {@link ThreadPoolExecutor}) as we will * make binder calls on that executor and ordering is vital. */ public void setBgExecutor(Executor bgExecutor) { mBgExecutor = bgExecutor; } Loading Loading @@ -230,24 +235,21 @@ public class RotationButtonController { mListenersRegistered = true; mBgExecutor.execute(() -> { final Intent intent = mContext.registerReceiver(mDockedReceiver, new IntentFilter(Intent.ACTION_DOCK_EVENT)); mContext.getMainExecutor().execute(() -> updateDockedState(intent)); }); if (registerRotationWatcher) { try { WindowManagerGlobal.getWindowManagerService() .watchRotation(mRotationWatcher, DEFAULT_DISPLAY); mRotationWatcherRegistered = true; } catch (IllegalArgumentException e) { mListenersRegistered = false; Log.w(TAG, "RegisterListeners for the display failed", e); } catch (RemoteException e) { Log.e(TAG, "RegisterListeners caught a RemoteException", e); return; } } final Intent intent = mContext.registerReceiver(mDockedReceiver, new IntentFilter(Intent.ACTION_DOCK_EVENT)); mContext.getMainExecutor().execute(() -> updateDockedState(intent)); }); TaskStackChangeListeners.getInstance().registerTaskStackListener(mTaskStackListener); } Loading @@ -265,7 +267,6 @@ public class RotationButtonController { } catch (IllegalArgumentException e) { Log.e(TAG, "Docked receiver already unregistered", e); } }); if (mRotationWatcherRegistered) { try { Loading @@ -273,9 +274,9 @@ public class RotationButtonController { mRotationWatcher); } catch (RemoteException e) { Log.e(TAG, "UnregisterListeners caught a RemoteException", e); return; } } }); TaskStackChangeListeners.getInstance().unregisterTaskStackListener(mTaskStackListener); } Loading Loading
packages/SystemUI/shared/src/com/android/systemui/shared/rotation/RotationButtonController.java +24 −23 Original line number Diff line number Diff line Loading @@ -68,6 +68,7 @@ import com.android.systemui.shared.system.TaskStackChangeListeners; import java.io.PrintWriter; import java.util.Optional; import java.util.concurrent.Executor; import java.util.concurrent.ThreadPoolExecutor; import java.util.function.Supplier; /** Loading Loading @@ -199,6 +200,10 @@ public class RotationButtonController { return mContext; } /** * We should pass single threaded executor (rather than {@link ThreadPoolExecutor}) as we will * make binder calls on that executor and ordering is vital. */ public void setBgExecutor(Executor bgExecutor) { mBgExecutor = bgExecutor; } Loading Loading @@ -230,24 +235,21 @@ public class RotationButtonController { mListenersRegistered = true; mBgExecutor.execute(() -> { final Intent intent = mContext.registerReceiver(mDockedReceiver, new IntentFilter(Intent.ACTION_DOCK_EVENT)); mContext.getMainExecutor().execute(() -> updateDockedState(intent)); }); if (registerRotationWatcher) { try { WindowManagerGlobal.getWindowManagerService() .watchRotation(mRotationWatcher, DEFAULT_DISPLAY); mRotationWatcherRegistered = true; } catch (IllegalArgumentException e) { mListenersRegistered = false; Log.w(TAG, "RegisterListeners for the display failed", e); } catch (RemoteException e) { Log.e(TAG, "RegisterListeners caught a RemoteException", e); return; } } final Intent intent = mContext.registerReceiver(mDockedReceiver, new IntentFilter(Intent.ACTION_DOCK_EVENT)); mContext.getMainExecutor().execute(() -> updateDockedState(intent)); }); TaskStackChangeListeners.getInstance().registerTaskStackListener(mTaskStackListener); } Loading @@ -265,7 +267,6 @@ public class RotationButtonController { } catch (IllegalArgumentException e) { Log.e(TAG, "Docked receiver already unregistered", e); } }); if (mRotationWatcherRegistered) { try { Loading @@ -273,9 +274,9 @@ public class RotationButtonController { mRotationWatcher); } catch (RemoteException e) { Log.e(TAG, "UnregisterListeners caught a RemoteException", e); return; } } }); TaskStackChangeListeners.getInstance().unregisterTaskStackListener(mTaskStackListener); } Loading