1 /* 2 * Copyright (C) 2022 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 distributed under the 11 * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 12 * KIND, either express or implied. See the License for the specific language governing 13 * permissions and limitations under the License. 14 */ 15 package com.android.systemui.unfold.updates.hinge 16 17 import androidx.core.util.Consumer 18 import com.android.systemui.unfold.util.CallbackController 19 20 /** 21 * Emits device hinge angle values (angle between two integral parts of the device). 22 * 23 * The hinge angle could be from 0 to 360 degrees inclusive. For foldable devices usually 0 24 * corresponds to fully closed (folded) state and 180 degrees corresponds to fully open (flat) 25 * state. 26 */ 27 interface HingeAngleProvider : CallbackController<Consumer<Float>> { startnull28 fun start() 29 fun stop() 30 } 31 32 const val FULLY_OPEN_DEGREES = 180f 33 const val FULLY_CLOSED_DEGREES = 0f 34