/* * Copyright (C) 2024 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.app; import android.annotation.IntDef; import android.annotation.NonNull; import android.annotation.Nullable; import android.os.Parcel; import android.os.Parcelable; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; /** * Stores Camera Compat information about a particular Task. * @hide */ public class CameraCompatTaskInfo implements Parcelable { /** * Camera compat control isn't shown because it's not requested by heuristics. */ public static final int CAMERA_COMPAT_CONTROL_HIDDEN = 0; /** * Camera compat control is shown with the treatment suggested. */ public static final int CAMERA_COMPAT_CONTROL_TREATMENT_SUGGESTED = 1; /** * Camera compat control is shown to allow reverting the applied treatment. */ public static final int CAMERA_COMPAT_CONTROL_TREATMENT_APPLIED = 2; /** * Camera compat control is dismissed by user. */ public static final int CAMERA_COMPAT_CONTROL_DISMISSED = 3; /** * Enum for the Camera app compat control states. */ @Retention(RetentionPolicy.SOURCE) @IntDef(prefix = { "CAMERA_COMPAT_CONTROL_" }, value = { CAMERA_COMPAT_CONTROL_HIDDEN, CAMERA_COMPAT_CONTROL_TREATMENT_SUGGESTED, CAMERA_COMPAT_CONTROL_TREATMENT_APPLIED, CAMERA_COMPAT_CONTROL_DISMISSED, }) public @interface CameraCompatControlState {} /** * State of the Camera app compat control which is used to correct stretched viewfinder * in apps that don't handle all possible configurations and changes between them correctly. */ @CameraCompatControlState public int cameraCompatControlState = CAMERA_COMPAT_CONTROL_HIDDEN; /** * The value to use when no camera compat treatment should be applied to a windowed task. */ public static final int CAMERA_COMPAT_FREEFORM_NONE = 0; /** * The value to use when portrait camera compat treatment should be applied to a windowed task. */ public static final int CAMERA_COMPAT_FREEFORM_PORTRAIT = 1; /** * The value to use when landscape camera compat treatment should be applied to a windowed task. */ public static final int CAMERA_COMPAT_FREEFORM_LANDSCAPE = 2; @Retention(RetentionPolicy.SOURCE) @IntDef(prefix = { "CAMERA_COMPAT_FREEFORM_" }, value = { CAMERA_COMPAT_FREEFORM_NONE, CAMERA_COMPAT_FREEFORM_PORTRAIT, CAMERA_COMPAT_FREEFORM_LANDSCAPE, }) public @interface FreeformCameraCompatMode {} /** * Whether the camera activity is letterboxed in freeform windowing mode to emulate expected * aspect ratio for fixed-orientation apps. * *
This field is used by the WM and the camera framework, to coordinate camera compat mode
* setup.
*/
@FreeformCameraCompatMode
public int freeformCameraCompatMode;
private CameraCompatTaskInfo() {
// Do nothing
}
@NonNull
static CameraCompatTaskInfo create() {
return new CameraCompatTaskInfo();
}
private CameraCompatTaskInfo(Parcel source) {
readFromParcel(source);
}
@Override
public int describeContents() {
return 0;
}
public static final Creator