1 /* 2 * Copyright (C) 2008-2009 Marc Blank 3 * Licensed to The Android Open Source Project. 4 * 5 * Licensed under the Apache License, Version 2.0 (the "License"); 6 * you may not use this file except in compliance with the License. 7 * You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 */ 17 18 package com.android.emailcommon.service; 19 20 oneway interface IEmailServiceCallback { 21 /* 22 * Ordinary results: 23 * statuscode = 1, progress = 0: "starting" 24 * statuscode = 0, progress = n/a: "finished" 25 * 26 * If there is an error, it must be reported as follows: 27 * statuscode = err, progress = n/a: "stopping due to error" 28 * 29 * *Optionally* a callback can also include intermediate values from 1..99 e.g. 30 * statuscode = 1, progress = 0: "starting" 31 * statuscode = 1, progress = 30: "working" 32 * statuscode = 1, progress = 60: "working" 33 * statuscode = 0, progress = n/a: "finished" 34 */ 35 36 /** 37 * Callback to indicate that a particular attachment is being synced 38 * messageId = the message that owns the attachment 39 * attachmentId = the attachment being synced 40 * statusCode = 0 for OK, 1 for progress, other codes for error 41 * progress = 0 for "start", 1..100 for optional progress reports 42 */ loadAttachmentStatus(long messageId, long attachmentId, int statusCode, int progress)43 void loadAttachmentStatus(long messageId, long attachmentId, int statusCode, int progress); 44 } 45