forked from signalapp/Signal-Android
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove dedicated MMS download controls
// FREEBIE
- Loading branch information
Showing
12 changed files
with
173 additions
and
202 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
src/org/thoughtcrime/securesms/attachments/MmsNotificationAttachment.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package org.thoughtcrime.securesms.attachments; | ||
|
||
|
||
import android.net.Uri; | ||
import android.support.annotation.Nullable; | ||
|
||
import org.thoughtcrime.securesms.database.AttachmentDatabase; | ||
import org.thoughtcrime.securesms.database.MmsDatabase; | ||
|
||
public class MmsNotificationAttachment extends Attachment { | ||
|
||
public MmsNotificationAttachment(int status, long size) { | ||
super("application/mms", getTransferStateFromStatus(status), size, null, null, null); | ||
} | ||
|
||
@Nullable | ||
@Override | ||
public Uri getDataUri() { | ||
return null; | ||
} | ||
|
||
@Nullable | ||
@Override | ||
public Uri getThumbnailUri() { | ||
return null; | ||
} | ||
|
||
private static int getTransferStateFromStatus(int status) { | ||
if (status == MmsDatabase.Status.DOWNLOAD_INITIALIZED || | ||
status == MmsDatabase.Status.DOWNLOAD_NO_CONNECTIVITY) | ||
{ | ||
return AttachmentDatabase.TRANSFER_PROGRESS_AUTO_PENDING; | ||
} else if (status == MmsDatabase.Status.DOWNLOAD_CONNECTING) { | ||
return AttachmentDatabase.TRANSFER_PROGRESS_STARTED; | ||
} else { | ||
return AttachmentDatabase.TRANSFER_PROGRESS_FAILED; | ||
} | ||
} | ||
} |
Oops, something went wrong.