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.ILayoutLog; 20 21 import java.io.Serializable; 22 import java.rmi.Remote; 23 import java.rmi.RemoteException; 24 25 /** 26 * Remote version of the {@link ILayoutLog} 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 viewCookie optional cookie of the view associated to this error 35 * @param data an optional data bundle that the client can use to improve the warning display. 36 */ warning(String tag, String message, Object viewCookie, Serializable data)37 void warning(String tag, String message, Object viewCookie, Serializable data) throws RemoteException; 38 39 /** 40 * Logs a fidelity warning. 41 * <p> 42 * This type of warning indicates that the render will not be the same as the rendering on a 43 * device due to limitation of the Java rendering API. 44 * 45 * @param tag a tag describing the type of the warning 46 * @param message the message of the warning 47 * @param throwable an optional Throwable that triggered the warning 48 * @param viewCookie optional cookie of the view associated to this error 49 * @param data an optional data bundle that the client can use to improve the warning display. 50 */ fidelityWarning(String tag, String message, Throwable throwable, Object viewCookie, Object data)51 void fidelityWarning(String tag, String message, Throwable throwable, Object viewCookie, 52 Object data) throws RemoteException; 53 54 /** 55 * Logs an error. 56 * 57 * @param tag a tag describing the type of the error 58 * @param message the message of the error 59 * @param viewCookie optional cookie of the view associated to this error 60 * @param data an optional data bundle that the client can use to improve the error display. 61 */ error(String tag, String message, Object viewCookie, Serializable data)62 void error(String tag, String message, Object viewCookie, Serializable data) throws RemoteException; 63 64 /** 65 * Logs an error, and the {@link Throwable} that triggered it. 66 * 67 * @param tag a tag describing the type of the error 68 * @param message the message of the error 69 * @param throwable the Throwable that triggered the error 70 * @param viewCookie optional cookie of the view associated to this error 71 * @param data an optional data bundle that the client can use to improve the error display. 72 */ error(String tag, String message, Throwable throwable, Object viewCookie, Serializable data)73 void error(String tag, String message, Throwable throwable, Object viewCookie, Serializable data) 74 throws RemoteException; 75 76 /** 77 * Logs messages coming from the Android Framework. 78 * 79 * @param priority the priority level of the message 80 * @param tag a tag describing the type of the error 81 * @param message the message of the error 82 */ logAndroidFramework(int priority, String tag, String message)83 void logAndroidFramework(int priority, String tag, String message) throws RemoteException; 84 } 85