Move the usb mass storage notification & activity into SystemUI.apk.
Also fix the notification to show properly when the runtime is restarted. Change-Id: Id0c7ef9f9dc9c9df18428cbaa7db1703f085137e
This commit is contained in:
@@ -1269,9 +1269,6 @@
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity android:name="com.android.server.status.UsbStorageActivity"
|
||||
android:excludeFromRecents="true">
|
||||
</activity>
|
||||
<activity android:name="com.android.internal.app.ExternalMediaFormatActivity"
|
||||
android:theme="@style/Theme.Dialog.Alert"
|
||||
android:excludeFromRecents="true">
|
||||
|
||||
@@ -18,5 +18,10 @@
|
||||
android:name=".statusbar.PhoneStatusBarService"
|
||||
android:exported="false"
|
||||
/>
|
||||
|
||||
<activity android:name=".usb.UsbStorageActivity"
|
||||
android:excludeFromRecents="true">
|
||||
</activity>
|
||||
|
||||
</application>
|
||||
</manifest>
|
||||
|
||||
@@ -365,7 +365,7 @@ public class StatusBarPolicy {
|
||||
// storage
|
||||
mStorageManager = (StorageManager) context.getSystemService(Context.STORAGE_SERVICE);
|
||||
mStorageManager.registerListener(
|
||||
new com.android.server.status.StorageNotification(context));
|
||||
new com.android.systemui.usb.StorageNotification(context));
|
||||
|
||||
// battery
|
||||
mService.setIcon("battery", com.android.internal.R.drawable.stat_sys_battery_unknown, 0);
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.server.status;
|
||||
package com.android.systemui.usb;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.Notification;
|
||||
@@ -80,9 +80,10 @@ public class StorageNotification extends StorageEventListener {
|
||||
mContext = context;
|
||||
|
||||
mStorageManager = (StorageManager) context.getSystemService(Context.STORAGE_SERVICE);
|
||||
mUmsAvailable = mStorageManager.isUsbMassStorageConnected();
|
||||
final boolean connected = mStorageManager.isUsbMassStorageConnected();
|
||||
Slog.d(TAG, String.format( "Startup with UMS connection %s (media state %s)", mUmsAvailable,
|
||||
Environment.getExternalStorageState()));
|
||||
onUsbMassStorageConnectionChanged(connected);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -122,7 +123,7 @@ public class StorageNotification extends StorageEventListener {
|
||||
* for stopping UMS.
|
||||
*/
|
||||
Intent intent = new Intent();
|
||||
intent.setClass(mContext, com.android.server.status.UsbStorageActivity.class);
|
||||
intent.setClass(mContext, com.android.systemui.usb.UsbStorageActivity.class);
|
||||
PendingIntent pi = PendingIntent.getActivity(mContext, 0, intent, 0);
|
||||
setUsbStorageNotification(
|
||||
com.android.internal.R.string.usb_storage_stop_notification_title,
|
||||
@@ -240,7 +241,7 @@ public class StorageNotification extends StorageEventListener {
|
||||
|
||||
if (available) {
|
||||
Intent intent = new Intent();
|
||||
intent.setClass(mContext, com.android.server.status.UsbStorageActivity.class);
|
||||
intent.setClass(mContext, com.android.systemui.usb.UsbStorageActivity.class);
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
|
||||
final boolean adbOn = 1 == Settings.Secure.getInt(
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.server.status;
|
||||
package com.android.systemui.usb;
|
||||
|
||||
import com.android.internal.R;
|
||||
import android.app.Activity;
|
||||
Reference in New Issue
Block a user