1 2 package com.android.providers.downloads; 3 4 import android.app.Notification; 5 import android.content.Intent; 6 import android.content.pm.PackageManager.NameNotFoundException; 7 import android.net.NetworkInfo; 8 9 10 interface SystemFacade { 11 /** 12 * @see System#currentTimeMillis() 13 */ currentTimeMillis()14 public long currentTimeMillis(); 15 16 /** 17 * @return Currently active network, or null if there's no active 18 * connection. 19 */ getActiveNetworkInfo(int uid)20 public NetworkInfo getActiveNetworkInfo(int uid); 21 22 /** 23 * @see android.telephony.TelephonyManager#isNetworkRoaming 24 */ isNetworkRoaming()25 public boolean isNetworkRoaming(); 26 27 /** 28 * @return maximum size, in bytes, of downloads that may go over a mobile connection; or null if 29 * there's no limit 30 */ getMaxBytesOverMobile()31 public Long getMaxBytesOverMobile(); 32 33 /** 34 * @return recommended maximum size, in bytes, of downloads that may go over a mobile 35 * connection; or null if there's no recommended limit. The user will have the option to bypass 36 * this limit. 37 */ getRecommendedMaxBytesOverMobile()38 public Long getRecommendedMaxBytesOverMobile(); 39 40 /** 41 * Send a broadcast intent. 42 */ sendBroadcast(Intent intent)43 public void sendBroadcast(Intent intent); 44 45 /** 46 * Returns true if the specified UID owns the specified package name. 47 */ userOwnsPackage(int uid, String pckg)48 public boolean userOwnsPackage(int uid, String pckg) throws NameNotFoundException; 49 50 /** 51 * Post a system notification to the NotificationManager. 52 */ postNotification(long id, Notification notification)53 public void postNotification(long id, Notification notification); 54 55 /** 56 * Cancel a system notification. 57 */ cancelNotification(long id)58 public void cancelNotification(long id); 59 60 /** 61 * Cancel all system notifications. 62 */ cancelAllNotifications()63 public void cancelAllNotifications(); 64 65 /** 66 * Start a thread. 67 */ startThread(Thread thread)68 public void startThread(Thread thread); 69 } 70