1 /* 2 * Copyright (C) 2017 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.layout.remote.api; 18 19 import com.android.ide.common.rendering.api.LayoutLog; 20 21 import java.io.Serializable; 22 import java.rmi.Remote; 23 import java.rmi.RemoteException; 24 25 /** 26 * Remote version of the {@link LayoutLog} class 27 */ 28 public interface RemoteLayoutLog extends Remote { 29 /** 30 * Logs a warning. 31 * 32 * @param tag a tag describing the type of the warning 33 * @param message the message of the warning 34 * @param data an optional data bundle that the client can use to improve the warning display. 35 */ 36 void warning(String tag, String message, Serializable data) throws RemoteException; 37 38 /** 39 * Logs a fidelity warning. 40 * <p> 41 * This type of warning indicates that the render will not be the same as the rendering on a 42 * device due to limitation of the Java rendering API. 43 * 44 * @param tag a tag describing the type of the warning 45 * @param message the message of the warning 46 * @param throwable an optional Throwable that triggered the warning 47 * @param viewCookie optional cookie of the view associated to this error 48 * @param data an optional data bundle that the client can use to improve the warning display. 49 */ 50 void fidelityWarning(String tag, String message, Throwable throwable, Object viewCookie, 51 Object data) throws RemoteException; 52 53 /** 54 * Logs an error. 55 * 56 * @param tag a tag describing the type of the error 57 * @param message the message of the error 58 * @param data an optional data bundle that the client can use to improve the error display. 59 */ 60 void error(String tag, String message, Serializable data) throws RemoteException; 61 62 /** 63 * Logs an error, and the {@link Throwable} that triggered it. 64 * 65 * @param tag a tag describing the type of the error 66 * @param message the message of the error 67 * @param throwable the Throwable that triggered the error 68 * @param data an optional data bundle that the client can use to improve the error display. 69 */ 70 void error(String tag, String message, Throwable throwable, Serializable data) 71 throws RemoteException; 72 } 73