1 /** 2 * Copyright (c) 2012, 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 android.service.dreams; 18 19 import android.content.ComponentName; 20 import android.content.Intent; 21 import android.os.Bundle; 22 import android.os.ParcelFileDescriptor; 23 import android.os.IBinder; 24 25 /** @hide */ 26 interface IDreamManager { 27 @UnsupportedAppUsage dream()28 void dream(); 29 @UnsupportedAppUsage awaken()30 void awaken(); 31 @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553) setDreamComponents(in ComponentName[] componentNames)32 void setDreamComponents(in ComponentName[] componentNames); 33 @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553) getDreamComponents()34 ComponentName[] getDreamComponents(); getDefaultDreamComponentForUser(int userId)35 ComponentName getDefaultDreamComponentForUser(int userId); testDream(int userId, in ComponentName componentName)36 void testDream(int userId, in ComponentName componentName); 37 @UnsupportedAppUsage isDreaming()38 boolean isDreaming(); 39 @UnsupportedAppUsage isDreamingOrInPreview()40 boolean isDreamingOrInPreview(); canStartDreaming(boolean isScreenOn)41 boolean canStartDreaming(boolean isScreenOn); 42 /** @deprecated Please use finishSelfOneway instead. */ finishSelf(in IBinder token, boolean immediate)43 void finishSelf(in IBinder token, boolean immediate); 44 /** @deprecated Please use startDozingOneway instead. */ startDozing(in IBinder token, int screenState, int reason, float screenBrightnessFloat, int screenBrightnessInt, boolean useNormalBrightnessForDoze)45 void startDozing(in IBinder token, int screenState, int reason, float screenBrightnessFloat, 46 int screenBrightnessInt, boolean useNormalBrightnessForDoze); stopDozing(in IBinder token)47 void stopDozing(in IBinder token); forceAmbientDisplayEnabled(boolean enabled)48 void forceAmbientDisplayEnabled(boolean enabled); getDreamComponentsForUser(int userId)49 ComponentName[] getDreamComponentsForUser(int userId); setDreamComponentsForUser(int userId, in ComponentName[] componentNames)50 void setDreamComponentsForUser(int userId, in ComponentName[] componentNames); setSystemDreamComponent(in ComponentName componentName)51 void setSystemDreamComponent(in ComponentName componentName); registerDreamOverlayService(in ComponentName componentName)52 void registerDreamOverlayService(in ComponentName componentName); startDreamActivity(in Intent intent)53 void startDreamActivity(in Intent intent); 54 @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.WRITE_DREAM_STATE)") setDreamIsObscured(in boolean isObscured)55 oneway void setDreamIsObscured(in boolean isObscured); 56 @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.WRITE_DREAM_STATE)") setDevicePostured(in boolean isPostured)57 oneway void setDevicePostured(in boolean isPostured); startDozingOneway(in IBinder token, int screenState, int reason, float screenBrightnessFloat, int screenBrightnessInt, boolean useNormalBrightnessForDoze)58 oneway void startDozingOneway(in IBinder token, int screenState, int reason, 59 float screenBrightnessFloat, int screenBrightnessInt, 60 boolean useNormalBrightnessForDoze); finishSelfOneway(in IBinder token, boolean immediate)61 oneway void finishSelfOneway(in IBinder token, boolean immediate); 62 @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS)") setScreensaverEnabled(boolean enabled)63 void setScreensaverEnabled(boolean enabled); 64 } 65