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

Commit a89b3eb9 authored by Hemant Gupta's avatar Hemant Gupta Committed by android-build-merger
Browse files

Merge "OPP: Clear Ongoing Notification after transfer complete."

am: ef8b16c1

Change-Id: I3067c0975324f1d5c2e31f4368a55df0dea1487e
parents 2e2ff819 ef8b16c1
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -32,7 +32,6 @@

package com.android.bluetooth.opp;

import android.app.NotificationManager;
import android.content.ContentValues;
import android.content.Context;
import android.net.Uri;
@@ -113,10 +112,7 @@ public class BluetoothOppObexClientSession implements BluetoothOppObexSession {
                }
            }
        }
        NotificationManager nm =
                (NotificationManager) mContext.getSystemService(Context.NOTIFICATION_SERVICE);
        nm.cancel(BluetoothOppNotification.NOTIFICATION_ID_PROGRESS);

        BluetoothOppUtility.cancelNotification(mContext);
        mCallback = null;
    }

@@ -610,6 +606,7 @@ public class BluetoothOppObexClientSession implements BluetoothOppObexSession {
                    }
                }
            }
            BluetoothOppUtility.cancelNotification(mContext);
            return status;
        }

+2 −6
Original line number Diff line number Diff line
@@ -32,7 +32,6 @@

package com.android.bluetooth.opp;

import android.app.NotificationManager;
import android.content.ContentValues;
import android.content.Context;
import android.content.Intent;
@@ -567,6 +566,7 @@ public class BluetoothOppObexServerSession extends ServerRequestHandler
                Log.e(TAG, "Error when closing stream after send");
            }
        }
        BluetoothOppUtility.cancelNotification(mContext);
        return status;
    }

@@ -660,11 +660,7 @@ public class BluetoothOppObexServerSession extends ServerRequestHandler
            }
            mServerSocket.prepareForNewConnect();
        }

        NotificationManager nm =
                (NotificationManager) mContext.getSystemService(Context.NOTIFICATION_SERVICE);
        nm.cancel(BluetoothOppNotification.NOTIFICATION_ID_PROGRESS);

        BluetoothOppUtility.cancelNotification(mContext);
        /* onClose could happen even before start() where mCallback is set */
        if (mCallback != null) {
            Message msg = Message.obtain(mCallback);
+8 −0
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@

package com.android.bluetooth.opp;

import android.app.NotificationManager;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.content.ActivityNotFoundException;
@@ -410,4 +411,11 @@ public class BluetoothOppUtility {
            return false;
        }
    }

    protected static void cancelNotification(Context ctx) {
        NotificationManager nm = (NotificationManager) ctx
                .getSystemService(Context.NOTIFICATION_SERVICE);
        nm.cancel(BluetoothOppNotification.NOTIFICATION_ID_PROGRESS);
    }

}