1 /* 2 * Copyright 2022 Google LLC 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 package com.google.android.libraries.mobiledatadownload.lite; 17 18 import android.net.Uri; 19 20 /** Interface for Monitoring Single File Downloads for MDD Lite. */ 21 public interface SingleFileDownloadProgressMonitor { 22 23 /** 24 * Add a DownloadListener that client can use to receive download progress update. Currently we 25 * only support 1 listener per file uri. Calling addDownloadListener to add another listener would 26 * be no-op. 27 * 28 * @param uri The destination file uri that the DownloadListener will receive download progress 29 * update. 30 * @param downloadListener the DownloadListener to add. 31 */ addDownloadListener(Uri uri, DownloadListener downloadListener)32 public void addDownloadListener(Uri uri, DownloadListener downloadListener); 33 34 /** 35 * Remove a DownloadListener. 36 * 37 * @param uri The uri that the DownloadListener receive download progress update. 38 */ removeDownloadListener(Uri uri)39 public void removeDownloadListener(Uri uri); 40 } 41