Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c90eb8e7 authored by Hongwei Wang's avatar Hongwei Wang
Browse files

Handle the UnsupportedOperationException when register TaskOrganizer

With ag/10847461, register TaskOrganizer with unsupported windowing mode
would throw UnsupportedOperationException. This is a work around and in
long term, we should not initiate anything related to PiP if this
feature is not configured on the device at all.

Bug: 152401027
Test: hardcode picture-in-picture mode to be off
Change-Id: I7e3f8714a535b485f9bb770702abf44559a88386
parent c64d21d4
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -36,7 +36,6 @@ import android.util.Pair;
import android.view.DisplayInfo;
import android.view.IPinnedStackController;
import android.window.WindowContainerTransaction;
import android.window.WindowOrganizer;

import com.android.systemui.Dependency;
import com.android.systemui.UiOffloadThread;
@@ -258,7 +257,7 @@ public class PipManager implements BasePipManager, PipTaskOrganizer.PipTransitio
                // register the pip input consumer to ensure touch can send to it.
                mInputConsumerController.registerInputConsumer();
            }
        } catch (RemoteException e) {
        } catch (RemoteException | UnsupportedOperationException e) {
            e.printStackTrace();
        }
    }
+1 −2
Original line number Diff line number Diff line
@@ -45,7 +45,6 @@ import android.text.TextUtils;
import android.util.Log;
import android.util.Pair;
import android.view.DisplayInfo;
import android.window.WindowOrganizer;

import com.android.systemui.Dependency;
import com.android.systemui.R;
@@ -296,7 +295,7 @@ public class PipManager implements BasePipManager, PipTaskOrganizer.PipTransitio
        try {
            WindowManagerWrapper.getInstance().addPinnedStackListener(mPinnedStackListener);
            TaskOrganizer.registerOrganizer(mPipTaskOrganizer, WINDOWING_MODE_PINNED);
        } catch (RemoteException e) {
        } catch (RemoteException | UnsupportedOperationException e) {
            Log.e(TAG, "Failed to register pinned stack listener", e);
        }