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

Commit 41e12fc1 authored by Xin Li's avatar Xin Li Committed by Gerrit Code Review
Browse files

Merge "DO NOT MERGE - Merge Android R QPR1"

parents 139b62a2 1a6d81d2
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -112,8 +112,9 @@ public class BluetoothMediaBrowserService extends MediaBrowserServiceCompat {
        Intent launchIntent = new Intent();
        Intent launchIntent = new Intent();
        launchIntent.setAction(BluetoothPrefs.BLUETOOTH_SETTING_ACTION);
        launchIntent.setAction(BluetoothPrefs.BLUETOOTH_SETTING_ACTION);
        launchIntent.addCategory(BluetoothPrefs.BLUETOOTH_SETTING_CATEGORY);
        launchIntent.addCategory(BluetoothPrefs.BLUETOOTH_SETTING_CATEGORY);
        int flags = PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE;
        PendingIntent pendingIntent = PendingIntent.getActivity(getApplicationContext(), 0,
        PendingIntent pendingIntent = PendingIntent.getActivity(getApplicationContext(), 0,
                launchIntent, PendingIntent.FLAG_UPDATE_CURRENT);
                launchIntent, flags);
        extras.putParcelable(ERROR_RESOLUTION_ACTION_INTENT, pendingIntent);
        extras.putParcelable(ERROR_RESOLUTION_ACTION_INTENT, pendingIntent);
        PlaybackStateCompat errorState = new PlaybackStateCompat.Builder()
        PlaybackStateCompat errorState = new PlaybackStateCompat.Builder()
                .setErrorMessage(getString(R.string.bluetooth_disconnected))
                .setErrorMessage(getString(R.string.bluetooth_disconnected))
+28 −1
Original line number Original line Diff line number Diff line
@@ -569,7 +569,7 @@ class BluetoothOppNotification {
                    mContext.getText(R.string.incoming_file_confirm_ok),
                    mContext.getText(R.string.incoming_file_confirm_ok),
                    PendingIntent.getBroadcast(mContext, 0,
                    PendingIntent.getBroadcast(mContext, 0,
                            new Intent(baseIntent).setAction(Constants.ACTION_ACCEPT), 0)).build();
                            new Intent(baseIntent).setAction(Constants.ACTION_ACCEPT), 0)).build();
            Notification n =
            Notification public_n =
                    new Notification.Builder(mContext, OPP_NOTIFICATION_CHANNEL).setOnlyAlertOnce(
                    new Notification.Builder(mContext, OPP_NOTIFICATION_CHANNEL).setOnlyAlertOnce(
                            true)
                            true)
                            .setOngoing(true)
                            .setOngoing(true)
@@ -596,6 +596,33 @@ class BluetoothOppNotification {
                            .setSmallIcon(R.drawable.bt_incomming_file_notification)
                            .setSmallIcon(R.drawable.bt_incomming_file_notification)
                            .setLocalOnly(true)
                            .setLocalOnly(true)
                            .build();
                            .build();
            Notification n =
                    new Notification.Builder(mContext, OPP_NOTIFICATION_CHANNEL).setOnlyAlertOnce(
                            true)
                            .setOngoing(true)
                            .setWhen(info.mTimeStamp)
                            .setContentIntent(PendingIntent.getBroadcast(mContext, 0,
                                    new Intent(baseIntent).setAction(
                                            Constants.ACTION_INCOMING_FILE_CONFIRM), 0))
                            .setDeleteIntent(PendingIntent.getBroadcast(mContext, 0,
                                    new Intent(baseIntent).setAction(Constants.ACTION_HIDE), 0))
                            .setColor(mContext.getResources()
                                    .getColor(
                                            com.android.internal.R.color
                                                    .system_notification_accent_color,
                                            mContext.getTheme()))
                            .setContentTitle(mContext.getText(
                                    R.string.incoming_file_confirm_Notification_title))
                            .setContentText(info.mFileName)
                            .setStyle(new Notification.BigTextStyle().bigText(mContext.getString(
                                    R.string.incoming_file_confirm_Notification_content,
                                    info.mDeviceName, info.mFileName)))
                            .setSubText(Formatter.formatFileSize(mContext, info.mTotalBytes))
                            .setSmallIcon(R.drawable.bt_incomming_file_notification)
                            .setLocalOnly(true)
                            .setVisibility(Notification.VISIBILITY_PRIVATE)
                            .setPublicVersion(public_n)
                            .build();
            mNotificationMgr.notify(NOTIFICATION_ID_PROGRESS, n);
            mNotificationMgr.notify(NOTIFICATION_ID_PROGRESS, n);
        }
        }
        cursor.close();
        cursor.close();