1
2package com.android.providers.downloads;
3
4import android.app.Notification;
5import android.content.Intent;
6import android.content.pm.PackageManager.NameNotFoundException;
7import android.net.NetworkInfo;
8
9
10interface 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    /**
23     * @see android.telephony.TelephonyManager#isNetworkRoaming
24     */
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     */
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     */
38    public Long getRecommendedMaxBytesOverMobile();
39
40    /**
41     * Send a broadcast intent.
42     */
43    public void sendBroadcast(Intent intent);
44
45    /**
46     * Returns true if the specified UID owns the specified package name.
47     */
48    public boolean userOwnsPackage(int uid, String pckg) throws NameNotFoundException;
49
50    /**
51     * Post a system notification to the NotificationManager.
52     */
53    public void postNotification(long id, Notification notification);
54
55    /**
56     * Cancel a system notification.
57     */
58    public void cancelNotification(long id);
59
60    /**
61     * Cancel all system notifications.
62     */
63    public void cancelAllNotifications();
64
65    /**
66     * Start a thread.
67     */
68    public void startThread(Thread thread);
69}
70