Refactor google mms packages, correct expected incoming MMS action

This commit is contained in:
Moez Bhatti
2018-01-09 17:08:20 -05:00
parent e655a5f178
commit 5497dad695
28 changed files with 43 additions and 39 deletions
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package com.google.android.mms.pdu; package com.google.android.mms.pdu_alt;
import com.google.android.mms.InvalidHeaderValueException; import com.google.android.mms.InvalidHeaderValueException;
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package com.google.android.mms.pdu; package com.google.android.mms.pdu_alt;
public class Base64 { public class Base64 {
/** /**
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package com.google.android.mms.pdu; package com.google.android.mms.pdu_alt;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.util.HashMap; import java.util.HashMap;
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package com.google.android.mms.pdu; package com.google.android.mms.pdu_alt;
import com.google.android.mms.InvalidHeaderValueException; import com.google.android.mms.InvalidHeaderValueException;
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package com.google.android.mms.pdu; package com.google.android.mms.pdu_alt;
import android.util.Log; import android.util.Log;
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package com.google.android.mms.pdu; package com.google.android.mms.pdu_alt;
import com.google.android.mms.InvalidHeaderValueException; import com.google.android.mms.InvalidHeaderValueException;
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package com.google.android.mms.pdu; package com.google.android.mms.pdu_alt;
import com.google.android.mms.InvalidHeaderValueException; import com.google.android.mms.InvalidHeaderValueException;
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package com.google.android.mms.pdu; package com.google.android.mms.pdu_alt;
import com.google.android.mms.InvalidHeaderValueException; import com.google.android.mms.InvalidHeaderValueException;
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package com.google.android.mms.pdu; package com.google.android.mms.pdu_alt;
import com.google.android.mms.InvalidHeaderValueException; import com.google.android.mms.InvalidHeaderValueException;
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package com.google.android.mms.pdu; package com.google.android.mms.pdu_alt;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package com.google.android.mms.pdu; package com.google.android.mms.pdu_alt;
public class PduContentTypes { public class PduContentTypes {
/** /**
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package com.google.android.mms.pdu; package com.google.android.mms.pdu_alt;
import com.google.android.mms.InvalidHeaderValueException; import com.google.android.mms.InvalidHeaderValueException;
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package com.google.android.mms.pdu; package com.google.android.mms.pdu_alt;
import android.telephony.SmsManager; import android.telephony.SmsManager;
import android.util.Log; import android.util.Log;
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package com.google.android.mms.pdu; package com.google.android.mms.pdu_alt;
import android.net.Uri; import android.net.Uri;
@@ -14,15 +14,15 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package com.google.android.mms.pdu; package com.google.android.mms.pdu_alt;
import com.google.android.mms.ContentType; import com.google.android.mms.ContentType;
import com.google.android.mms.InvalidHeaderValueException; import com.google.android.mms.InvalidHeaderValueException;
import com.google.android.mms.MmsException; import com.google.android.mms.MmsException;
import com.google.android.mms.util.DownloadDrmHelper; import com.google.android.mms.util_alt.DownloadDrmHelper;
import com.google.android.mms.util.DrmConvertSession; import com.google.android.mms.util_alt.DrmConvertSession;
import com.google.android.mms.util.PduCache; import com.google.android.mms.util_alt.PduCache;
import com.google.android.mms.util.PduCacheEntry; import com.google.android.mms.util_alt.PduCacheEntry;
import com.google.android.mms.util.SqliteWrapper; import com.google.android.mms.util_alt.SqliteWrapper;
import android.content.ContentResolver; import android.content.ContentResolver;
import android.content.ContentUris; import android.content.ContentUris;
import android.content.ContentValues; import android.content.ContentValues;
@@ -57,7 +57,7 @@ import java.util.HashSet;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import java.util.Map.Entry; import java.util.Map.Entry;
import com.google.android.mms.pdu.EncodedStringValue;
/** /**
* This class is the high-level manager of PDU storage. * This class is the high-level manager of PDU storage.
*/ */
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package com.google.android.mms.pdu; package com.google.android.mms.pdu_alt;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package com.google.android.mms.pdu; package com.google.android.mms.pdu_alt;
import com.google.android.mms.InvalidHeaderValueException; import com.google.android.mms.InvalidHeaderValueException;
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package com.google.android.mms.pdu; package com.google.android.mms.pdu_alt;
import com.google.android.mms.InvalidHeaderValueException; import com.google.android.mms.InvalidHeaderValueException;
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package com.google.android.mms.pdu; package com.google.android.mms.pdu_alt;
import com.google.android.mms.InvalidHeaderValueException; import com.google.android.mms.InvalidHeaderValueException;
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package com.google.android.mms.pdu; package com.google.android.mms.pdu_alt;
import com.google.android.mms.InvalidHeaderValueException; import com.google.android.mms.InvalidHeaderValueException;
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package com.google.android.mms.pdu; package com.google.android.mms.pdu_alt;
import android.util.Log; import android.util.Log;
import com.google.android.mms.InvalidHeaderValueException; import com.google.android.mms.InvalidHeaderValueException;
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package com.google.android.mms.util; package com.google.android.mms.util_alt;
import android.util.Log; import android.util.Log;
@@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
* *
*/ */
package com.google.android.mms.util; package com.google.android.mms.util_alt;
import android.content.Context; import android.content.Context;
import android.drm.DrmManagerClient; import android.drm.DrmManagerClient;
@@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
* *
*/ */
package com.google.android.mms.util; package com.google.android.mms.util_alt;
import android.content.Context; import android.content.Context;
import android.drm.DrmConvertedStatus; import android.drm.DrmConvertedStatus;
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package com.google.android.mms.util; package com.google.android.mms.util_alt;
import android.content.ContentUris; import android.content.ContentUris;
import android.content.UriMatcher; import android.content.UriMatcher;
@@ -14,9 +14,9 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package com.google.android.mms.util; package com.google.android.mms.util_alt;
import com.google.android.mms.pdu.GenericPdu; import com.google.android.mms.pdu_alt.GenericPdu;
public final class PduCacheEntry { public final class PduCacheEntry {
private final GenericPdu mPdu; private final GenericPdu mPdu;
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package com.google.android.mms.util; package com.google.android.mms.util_alt;
import android.app.ActivityManager; import android.app.ActivityManager;
import android.content.ContentResolver; import android.content.ContentResolver;
@@ -23,16 +23,16 @@ import android.content.Context
import android.content.Intent import android.content.Intent
import android.provider.Telephony import android.provider.Telephony
import com.google.android.mms.ContentType import com.google.android.mms.ContentType
import com.google.android.mms.pdu.GenericPdu import com.google.android.mms.pdu_alt.GenericPdu
import com.google.android.mms.pdu.NotificationInd import com.google.android.mms.pdu_alt.NotificationInd
import com.google.android.mms.pdu.PduHeaders import com.google.android.mms.pdu_alt.PduHeaders
import com.google.android.mms.pdu.PduParser import com.google.android.mms.pdu_alt.PduParser
import timber.log.Timber import timber.log.Timber
class MmsReceiver : BroadcastReceiver() { class MmsReceiver : BroadcastReceiver() {
override fun onReceive(context: Context, intent: Intent) { override fun onReceive(context: Context, intent: Intent) {
if (Telephony.Sms.Intents.WAP_PUSH_RECEIVED_ACTION == intent.action && ContentType.MMS_MESSAGE == intent.type) { if (Telephony.Sms.Intents.WAP_PUSH_DELIVER_ACTION == intent.action && ContentType.MMS_MESSAGE == intent.type) {
val data = intent.getByteArrayExtra("data") val data = intent.getByteArrayExtra("data")
val parser = PduParser(data) val parser = PduParser(data)
var pdu: GenericPdu? = null var pdu: GenericPdu? = null
@@ -62,6 +62,10 @@ class MmsReceiver : BroadcastReceiver() {
PduHeaders.MESSAGE_TYPE_READ_ORIG_IND -> { PduHeaders.MESSAGE_TYPE_READ_ORIG_IND -> {
Timber.v("Received read report") Timber.v("Received read report")
} }
else -> {
Timber.v("Received unhandled MMS type: ${pdu.messageType}")
}
} }
} }
} }