Home | History | Annotate | Download | only in android
      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 com.android.layoutlib.bridge.android;
     18 
     19 import android.os.IBinder;
     20 import android.os.IPowerManager;
     21 import android.os.PowerManager;
     22 import android.os.PowerSaveState;
     23 import android.os.RemoteException;
     24 import android.os.WorkSource;
     25 
     26 /**
     27  * Fake implementation of IPowerManager.
     28  *
     29  */
     30 public class BridgePowerManager implements IPowerManager {
     31 
     32     @Override
     33     public boolean isInteractive() throws RemoteException {
     34         return true;
     35     }
     36 
     37     @Override
     38     public boolean isPowerSaveMode() throws RemoteException {
     39         return false;
     40     }
     41 
     42     @Override
     43     public boolean setPowerSaveMode(boolean mode) throws RemoteException {
     44         return false;
     45     }
     46 
     47     public PowerSaveState getPowerSaveState(int serviceType) {
     48         return null;
     49     }
     50 
     51     @Override
     52     public IBinder asBinder() {
     53         // pass for now.
     54         return null;
     55     }
     56 
     57     @Override
     58     public void acquireWakeLock(IBinder arg0, int arg1, String arg2, String arg2_5, WorkSource arg3, String arg4)
     59             throws RemoteException {
     60         // pass for now.
     61     }
     62 
     63     @Override
     64     public void acquireWakeLockWithUid(IBinder arg0, int arg1, String arg2, String arg2_5, int arg3)
     65             throws RemoteException {
     66         // pass for now.
     67     }
     68 
     69     @Override
     70     public void powerHint(int hintId, int data) {
     71         // pass for now.
     72     }
     73 
     74     @Override
     75     public void crash(String arg0) throws RemoteException {
     76         // pass for now.
     77     }
     78 
     79     @Override
     80     public void goToSleep(long arg0, int arg1, int arg2) throws RemoteException {
     81         // pass for now.
     82     }
     83 
     84     @Override
     85     public void nap(long arg0) throws RemoteException {
     86         // pass for now.
     87     }
     88 
     89     @Override
     90     public void reboot(boolean confirm, String reason, boolean wait) {
     91         // pass for now.
     92     }
     93 
     94     @Override
     95     public void rebootSafeMode(boolean confirm, boolean wait) {
     96         // pass for now.
     97     }
     98 
     99     @Override
    100     public void shutdown(boolean confirm, String reason, boolean wait) {
    101         // pass for now.
    102     }
    103 
    104     @Override
    105     public void releaseWakeLock(IBinder arg0, int arg1) throws RemoteException {
    106         // pass for now.
    107     }
    108 
    109     @Override
    110     public void updateWakeLockUids(IBinder arg0, int[] arg1) throws RemoteException {
    111         // pass for now.
    112     }
    113 
    114     @Override
    115     public void setAttentionLight(boolean arg0, int arg1) throws RemoteException {
    116         // pass for now.
    117     }
    118 
    119     @Override
    120     public void setStayOnSetting(int arg0) throws RemoteException {
    121         // pass for now.
    122     }
    123 
    124     @Override
    125     public void updateWakeLockWorkSource(IBinder arg0, WorkSource arg1, String arg2) throws RemoteException {
    126         // pass for now.
    127     }
    128 
    129     @Override
    130     public boolean isWakeLockLevelSupported(int level) throws RemoteException {
    131         // pass for now.
    132         return true;
    133     }
    134 
    135     @Override
    136     public void userActivity(long time, int event, int flags) throws RemoteException {
    137         // pass for now.
    138     }
    139 
    140     @Override
    141     public void wakeUp(long time, String reason, String opPackageName) throws RemoteException {
    142         // pass for now.
    143     }
    144 
    145     @Override
    146     public void boostScreenBrightness(long time) throws RemoteException {
    147         // pass for now.
    148     }
    149 
    150     @Override
    151     public boolean isDeviceIdleMode() throws RemoteException {
    152         return false;
    153     }
    154 
    155     @Override
    156     public boolean isLightDeviceIdleMode() throws RemoteException {
    157         return false;
    158     }
    159 
    160     @Override
    161     public boolean isScreenBrightnessBoosted() throws RemoteException {
    162         return false;
    163     }
    164 
    165     @Override
    166     public int getLastShutdownReason() {
    167         return PowerManager.SHUTDOWN_REASON_UNKNOWN;
    168     }
    169 
    170     @Override
    171     public void setDozeAfterScreenOff(boolean mode) throws RemoteException {
    172         // pass for now.
    173     }
    174 }
    175