Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fe4f3ae3 authored by Joe Onorato's avatar Joe Onorato
Browse files

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
parent d2b1f00e
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -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">
+5 −0
Original line number Diff line number Diff line
@@ -18,5 +18,10 @@
            android:name=".statusbar.PhoneStatusBarService"
            android:exported="false"
            />

        <activity android:name=".usb.UsbStorageActivity"
                android:excludeFromRecents="true">
        </activity>

    </application>
</manifest>
+1 −1
Original line number Diff line number Diff line
@@ -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);
+5 −4
Original line number Diff line number Diff line
@@ -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(
+1 −1
Original line number Diff line number Diff line
@@ -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;