summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSan Mehat <san@google.com>2010-02-10 11:21:50 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2010-02-10 11:21:50 -0800
commitd0efb6bc159b86dfad540aa9dc3e20e1bb56d930 (patch)
treeb699271ba9346af5235100f6a7e6c66e20e61456
parent4c48cb72ffc975c2a94473efb529d559aacaff17 (diff)
parent4154c07c5cabc74029a2df379075391d782a682c (diff)
downloadframeworks_base-d0efb6bc159b86dfad540aa9dc3e20e1bb56d930.zip
frameworks_base-d0efb6bc159b86dfad540aa9dc3e20e1bb56d930.tar.gz
frameworks_base-d0efb6bc159b86dfad540aa9dc3e20e1bb56d930.tar.bz2
Merge "StorageNotification: Move notification / usb storage activity into StatusBarPolicy"
-rw-r--r--core/res/AndroidManifest.xml6
-rwxr-xr-xservices/java/com/android/server/NotificationManagerService.java4
-rw-r--r--services/java/com/android/server/status/StatusBarPolicy.java9
-rw-r--r--services/java/com/android/server/status/StorageNotification.java (renamed from core/java/com/android/internal/app/StorageNotification.java)10
-rw-r--r--services/java/com/android/server/status/UsbStorageActivity.java (renamed from core/java/com/android/internal/app/UsbStorageActivity.java)2
5 files changed, 16 insertions, 15 deletions
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index 713e725..a57c71b 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -1249,11 +1249,7 @@
android:theme="@style/Theme.Dialog.Alert"
android:excludeFromRecents="true">
</activity>
- <activity android:name="com.android.internal.app.UsbStorageActivity"
- android:excludeFromRecents="true">
- </activity>
- <activity android:name="com.android.internal.app.UsbStorageStopActivity"
- android:theme="@style/Theme.Dialog.Alert"
+ <activity android:name="com.android.server.status.UsbStorageActivity"
android:excludeFromRecents="true">
</activity>
<activity android:name="com.android.internal.app.ExternalMediaFormatActivity"
diff --git a/services/java/com/android/server/NotificationManagerService.java b/services/java/com/android/server/NotificationManagerService.java
index ad8ab84..3657133 100755
--- a/services/java/com/android/server/NotificationManagerService.java
+++ b/services/java/com/android/server/NotificationManagerService.java
@@ -50,7 +50,6 @@ import android.os.Message;
import android.os.Power;
import android.os.Process;
import android.os.RemoteException;
-import android.os.storage.StorageManager;
import android.os.SystemProperties;
import android.os.Vibrator;
import android.provider.Settings;
@@ -408,9 +407,6 @@ class NotificationManagerService extends INotificationManager.Stub
mToastQueue = new ArrayList<ToastRecord>();
mHandler = new WorkerHandler();
- StorageManager sm = (StorageManager) context.getSystemService(Context.STORAGE_SERVICE);
- sm.registerListener(new com.android.internal.app.StorageNotification(context));
-
mStatusBarService = statusBar;
statusBar.setNotificationCallbacks(mNotificationCallbacks);
diff --git a/services/java/com/android/server/status/StatusBarPolicy.java b/services/java/com/android/server/status/StatusBarPolicy.java
index f5aeaf0..20209e4 100644
--- a/services/java/com/android/server/status/StatusBarPolicy.java
+++ b/services/java/com/android/server/status/StatusBarPolicy.java
@@ -37,6 +37,7 @@ import android.os.Handler;
import android.os.IBinder;
import android.os.Message;
import android.os.RemoteException;
+import android.os.storage.StorageManager;
import android.provider.Settings;
import android.telephony.PhoneStateListener;
import android.telephony.ServiceState;
@@ -93,6 +94,9 @@ public class StatusBarPolicy {
private IBinder mClockIcon;
private IconData mClockData;
+ // storage
+ private StorageManager mStorageManager;
+
// battery
private IBinder mBatteryIcon;
private IconData mBatteryData;
@@ -407,6 +411,11 @@ public class StatusBarPolicy {
mClockIcon = service.addIcon(mClockData, null);
updateClock();
+ // storage
+ mStorageManager = (StorageManager) context.getSystemService(Context.STORAGE_SERVICE);
+ mStorageManager.registerListener(
+ new com.android.server.status.StorageNotification(context));
+
// battery
mBatteryData = IconData.makeIcon("battery",
null, com.android.internal.R.drawable.stat_sys_battery_unknown, 0, 0);
diff --git a/core/java/com/android/internal/app/StorageNotification.java b/services/java/com/android/server/status/StorageNotification.java
index 8876612..3b79049 100644
--- a/core/java/com/android/internal/app/StorageNotification.java
+++ b/services/java/com/android/server/status/StorageNotification.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.internal.app;
+package com.android.server.status;
import android.app.Activity;
import android.app.Notification;
@@ -119,7 +119,7 @@ public class StorageNotification extends StorageEventListener {
* for stopping UMS.
*/
Intent intent = new Intent();
- intent.setClass(mContext, com.android.internal.app.UsbStorageActivity.class);
+ intent.setClass(mContext, com.android.server.status.UsbStorageActivity.class);
PendingIntent pi = PendingIntent.getActivity(mContext, 0, intent, 0);
setUsbStorageNotification(
com.android.internal.R.string.usb_storage_stop_notification_title,
@@ -237,7 +237,7 @@ public class StorageNotification extends StorageEventListener {
if (available) {
Intent intent = new Intent();
- intent.setClass(mContext, com.android.internal.app.UsbStorageActivity.class);
+ intent.setClass(mContext, com.android.server.status.UsbStorageActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
PendingIntent pi = PendingIntent.getActivity(mContext, 0, intent, 0);
setUsbStorageNotification(
@@ -253,8 +253,8 @@ public class StorageNotification extends StorageEventListener {
/**
* Sets the USB storage notification.
*/
- private synchronized void setUsbStorageNotification(int titleId, int messageId, int icon, boolean sound, boolean visible,
- PendingIntent pi) {
+ private synchronized void setUsbStorageNotification(int titleId, int messageId, int icon,
+ boolean sound, boolean visible, PendingIntent pi) {
if (!visible && mUsbStorageNotification == null) {
return;
diff --git a/core/java/com/android/internal/app/UsbStorageActivity.java b/services/java/com/android/server/status/UsbStorageActivity.java
index 991f04b..7a2a2d6 100644
--- a/core/java/com/android/internal/app/UsbStorageActivity.java
+++ b/services/java/com/android/server/status/UsbStorageActivity.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.internal.app;
+package com.android.server.status;
import android.app.Activity;
import android.content.BroadcastReceiver;