1/* 2 * Copyright (C) 2008 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 17package com.android.providers.downloads; 18 19import android.content.Intent; 20import android.content.pm.PackageManager.NameNotFoundException; 21import android.net.NetworkInfo; 22 23interface SystemFacade { 24 /** 25 * @see System#currentTimeMillis() 26 */ 27 public long currentTimeMillis(); 28 29 /** 30 * @return Currently active network, or null if there's no active 31 * connection. 32 */ 33 public NetworkInfo getActiveNetworkInfo(int uid); 34 35 public boolean isActiveNetworkMetered(); 36 37 /** 38 * @see android.telephony.TelephonyManager#isNetworkRoaming 39 */ 40 public boolean isNetworkRoaming(); 41 42 /** 43 * @return maximum size, in bytes, of downloads that may go over a mobile connection; or null if 44 * there's no limit 45 */ 46 public Long getMaxBytesOverMobile(); 47 48 /** 49 * @return recommended maximum size, in bytes, of downloads that may go over a mobile 50 * connection; or null if there's no recommended limit. The user will have the option to bypass 51 * this limit. 52 */ 53 public Long getRecommendedMaxBytesOverMobile(); 54 55 /** 56 * Send a broadcast intent. 57 */ 58 public void sendBroadcast(Intent intent); 59 60 /** 61 * Returns true if the specified UID owns the specified package name. 62 */ 63 public boolean userOwnsPackage(int uid, String pckg) throws NameNotFoundException; 64} 65