1 /*
2  * Copyright (C) 2023 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package androidx.window.extensions.embedding;
18 
19 import androidx.annotation.NonNull;
20 
21 /**
22  * Client-side descriptor of a split that holds two containers while the secondary
23  * container is pinned on top of the Task and the primary container is the container that is
24  * currently below the secondary container. The primary container could be updated to
25  * another container whenever the existing primary container is removed or no longer
26  * be the container that's right behind the secondary container.
27  */
28 class SplitPinContainer extends SplitContainer {
29 
SplitPinContainer(@onNull TaskFragmentContainer primaryContainer, @NonNull TaskFragmentContainer secondaryContainer, @NonNull SplitPinRule splitPinRule, @NonNull SplitAttributes splitAttributes)30     SplitPinContainer(@NonNull TaskFragmentContainer primaryContainer,
31             @NonNull TaskFragmentContainer secondaryContainer,
32             @NonNull SplitPinRule splitPinRule,
33             @NonNull SplitAttributes splitAttributes) {
34         super(primaryContainer, primaryContainer.getTopNonFinishingActivity(), secondaryContainer,
35                 splitPinRule, splitAttributes, true /* isPrimaryContainerMutable */);
36     }
37 
38     @Override
toString()39     public String toString() {
40         return "SplitPinContainer{"
41                 + " primaryContainer=" + getPrimaryContainer()
42                 + " secondaryContainer=" + getSecondaryContainer()
43                 + " splitPinRule=" + getSplitRule()
44                 + " splitAttributes" + getCurrentSplitAttributes()
45                 + "}";
46     }
47 }
48