1 /* 2 * Copyright (C) 2019 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 com.android.systemui.accessibility; 18 19 import android.annotation.MainThread; 20 import android.annotation.Nullable; 21 import android.view.accessibility.IRemoteMagnificationAnimationCallback; 22 23 import com.android.systemui.CoreStartable; 24 25 /** Interface for managing magnification connection calls from system process. */ 26 public interface Magnification extends CoreStartable { 27 28 @MainThread enableWindowMagnification( int displayId, float scale, float centerX, float centerY, float magnificationFrameOffsetRatioX, float magnificationFrameOffsetRatioY, @Nullable IRemoteMagnificationAnimationCallback callback)29 void enableWindowMagnification( 30 int displayId, 31 float scale, 32 float centerX, 33 float centerY, 34 float magnificationFrameOffsetRatioX, 35 float magnificationFrameOffsetRatioY, 36 @Nullable IRemoteMagnificationAnimationCallback callback); 37 38 @MainThread setScaleForWindowMagnification(int displayId, float scale)39 void setScaleForWindowMagnification(int displayId, float scale); 40 41 @MainThread moveWindowMagnifier(int displayId, float offsetX, float offsetY)42 void moveWindowMagnifier(int displayId, float offsetX, float offsetY); 43 44 @MainThread disableWindowMagnification( int displayId, @Nullable IRemoteMagnificationAnimationCallback callback)45 void disableWindowMagnification( 46 int displayId, @Nullable IRemoteMagnificationAnimationCallback callback); 47 48 @MainThread onFullscreenMagnificationActivationChanged(int displayId, boolean activated)49 void onFullscreenMagnificationActivationChanged(int displayId, boolean activated); 50 51 @MainThread showMagnificationButton(int displayId, int magnificationMode)52 void showMagnificationButton(int displayId, int magnificationMode); 53 54 @MainThread removeMagnificationButton(int displayId)55 void removeMagnificationButton(int displayId); 56 57 @MainThread setUserMagnificationScale(int userId, int displayId, float scale)58 void setUserMagnificationScale(int userId, int displayId, float scale); 59 60 @MainThread hideMagnificationSettingsPanel(int displayId)61 void hideMagnificationSettingsPanel(int displayId); 62 63 @MainThread moveWindowMagnifierToPosition( int displayId, float positionX, float positionY, IRemoteMagnificationAnimationCallback callback)64 void moveWindowMagnifierToPosition( 65 int displayId, 66 float positionX, 67 float positionY, 68 IRemoteMagnificationAnimationCallback callback); 69 } 70