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 android.telephony.cts.embmstestapp;
18 
19 import android.os.Bundle;
20 import android.telephony.mbms.DownloadRequest;
21 import android.telephony.mbms.FileInfo;
22 
23 interface ICtsDownloadMiddlewareControl {
24     // Resets the state of the CTS middleware
reset()25     void reset();
26     // Get a list of calls made to the middleware binder.
27     // Looks like List<List<Object>>, where the first Object is always a String corresponding to
28     // the method name.
getDownloadSessionCalls()29     List<Bundle> getDownloadSessionCalls();
30     // Force all methods that can return an error to return this error.
forceErrorCode(int error)31     void forceErrorCode(int error);
32     // Fire the error callback on the download session
fireErrorOnSession(int errorCode, String message)33     void fireErrorOnSession(int errorCode, String message);
34     // Fire the download state callback methods
fireOnProgressUpdated(in DownloadRequest request, in FileInfo fileInfo, int currentDownloadSize, int fullDownloadSize, int currentDecodedSize, int fullDecodedSize)35     void fireOnProgressUpdated(in DownloadRequest request, in FileInfo fileInfo,
36             int currentDownloadSize, int fullDownloadSize,
37             int currentDecodedSize, int fullDecodedSize);
fireOnStateUpdated(in DownloadRequest request, in FileInfo fileInfo, int state)38     void fireOnStateUpdated(in DownloadRequest request, in FileInfo fileInfo, int state);
39 
40     // calling download() does nothing, this is to actually start the file-download flow.
actuallyStartDownloadFlow()41     void actuallyStartDownloadFlow();
42 }