Home | History | Annotate | Download | only in downloads
      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      */
     14     public long currentTimeMillis();
     15 
     16     /**
     17      * @return Currently active network, or null if there's no active
     18      *         connection.
     19      */
     20     public NetworkInfo getActiveNetworkInfo(int uid);
     21 
     22     public boolean isActiveNetworkMetered();
     23 
     24     /**
     25      * @see android.telephony.TelephonyManager#isNetworkRoaming
     26      */
     27     public boolean isNetworkRoaming();
     28 
     29     /**
     30      * @return maximum size, in bytes, of downloads that may go over a mobile connection; or null if
     31      * there's no limit
     32      */
     33     public Long getMaxBytesOverMobile();
     34 
     35     /**
     36      * @return recommended maximum size, in bytes, of downloads that may go over a mobile
     37      * connection; or null if there's no recommended limit.  The user will have the option to bypass
     38      * this limit.
     39      */
     40     public Long getRecommendedMaxBytesOverMobile();
     41 
     42     /**
     43      * Send a broadcast intent.
     44      */
     45     public void sendBroadcast(Intent intent);
     46 
     47     /**
     48      * Returns true if the specified UID owns the specified package name.
     49      */
     50     public boolean userOwnsPackage(int uid, String pckg) throws NameNotFoundException;
     51 
     52     /**
     53      * Post a system notification to the NotificationManager.
     54      */
     55     public void postNotification(long id, Notification notification);
     56 
     57     /**
     58      * Cancel a system notification.
     59      */
     60     public void cancelNotification(long id);
     61 
     62     /**
     63      * Cancel all system notifications.
     64      */
     65     public void cancelAllNotifications();
     66 
     67     /**
     68      * Start a thread.
     69      */
     70     public void startThread(Thread thread);
     71 }
     72