@@ -981,17 +981,28 @@ private void notifyUploadStart(UploadFileOperation upload) {
981
981
.setProgress (100 , 0 , false )
982
982
.setContentText (
983
983
String .format (getString (R .string .uploader_upload_in_progress_content ), 0 , upload .getFileName ())
984
+ )
985
+ .setAutoCancel (false )
986
+ .addAction (
987
+ R .drawable .ic_action_delete_grey ,
988
+ getString (R .string .common_cancel ),
989
+ PendingIntent .getActivity (
990
+ this ,
991
+ (int ) System .nanoTime (),
992
+ new Intent (this , FileUploader .ServiceHandler .class ),
993
+ 0 )
984
994
);
985
995
986
996
/// includes a pending intent in the notification showing the details
987
997
Intent showUploadListIntent = new Intent (this , UploadListActivity .class );
988
998
showUploadListIntent .putExtra (FileActivity .EXTRA_FILE , upload .getFile ());
989
999
showUploadListIntent .putExtra (FileActivity .EXTRA_ACCOUNT , upload .getAccount ());
990
1000
showUploadListIntent .addFlags (Intent .FLAG_ACTIVITY_CLEAR_TOP );
991
- mNotificationBuilder .setContentIntent (PendingIntent .getActivity (this , (int ) System .currentTimeMillis (),
1001
+ mNotificationBuilder .setContentIntent (PendingIntent .getActivity (this , (int ) System .nanoTime (),
992
1002
showUploadListIntent , 0 ));
993
1003
994
1004
if (!upload .isInstantPicture () && !upload .isInstantVideo ()) {
1005
+ // TODO: should first parameter to notify not be a uniq mId?
995
1006
mNotificationManager .notify (R .string .uploader_upload_in_progress_ticker , mNotificationBuilder .build ());
996
1007
} // else wait until the upload really start (onTransferProgress is called), so that if it's discarded
997
1008
// due to lack of Wifi, no notification is shown
0 commit comments