Merge "StorageNotification: Move notification / usb storage activity into StatusBarPolicy"
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
Reference in New Issue
Block a user