|
Android example source code file (PduCache.java)
The PduCache.java Android example source code/* * Copyright (C) 2008 Esmertec AG. * Copyright (C) 2008 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.android.mms.util; import android.content.ContentUris; import android.content.UriMatcher; import android.net.Uri; import android.provider.Telephony.Mms; import android.util.Config; import android.util.Log; import java.util.HashMap; import java.util.HashSet; public final class PduCache extends AbstractCache<Uri, PduCacheEntry> { private static final String TAG = "PduCache"; private static final boolean DEBUG = false; private static final boolean LOCAL_LOGV = DEBUG ? Config.LOGD : Config.LOGV; private static final int MMS_ALL = 0; private static final int MMS_ALL_ID = 1; private static final int MMS_INBOX = 2; private static final int MMS_INBOX_ID = 3; private static final int MMS_SENT = 4; private static final int MMS_SENT_ID = 5; private static final int MMS_DRAFTS = 6; private static final int MMS_DRAFTS_ID = 7; private static final int MMS_OUTBOX = 8; private static final int MMS_OUTBOX_ID = 9; private static final int MMS_CONVERSATION = 10; private static final int MMS_CONVERSATION_ID = 11; private static final UriMatcher URI_MATCHER; private static final HashMap<Integer, Integer> MATCH_TO_MSGBOX_ID_MAP; private static PduCache sInstance; static { URI_MATCHER = new UriMatcher(UriMatcher.NO_MATCH); URI_MATCHER.addURI("mms", null, MMS_ALL); URI_MATCHER.addURI("mms", "#", MMS_ALL_ID); URI_MATCHER.addURI("mms", "inbox", MMS_INBOX); URI_MATCHER.addURI("mms", "inbox/#", MMS_INBOX_ID); URI_MATCHER.addURI("mms", "sent", MMS_SENT); URI_MATCHER.addURI("mms", "sent/#", MMS_SENT_ID); URI_MATCHER.addURI("mms", "drafts", MMS_DRAFTS); URI_MATCHER.addURI("mms", "drafts/#", MMS_DRAFTS_ID); URI_MATCHER.addURI("mms", "outbox", MMS_OUTBOX); URI_MATCHER.addURI("mms", "outbox/#", MMS_OUTBOX_ID); URI_MATCHER.addURI("mms-sms", "conversations", MMS_CONVERSATION); URI_MATCHER.addURI("mms-sms", "conversations/#", MMS_CONVERSATION_ID); MATCH_TO_MSGBOX_ID_MAP = new HashMap<Integer, Integer>(); MATCH_TO_MSGBOX_ID_MAP.put(MMS_INBOX, Mms.MESSAGE_BOX_INBOX); MATCH_TO_MSGBOX_ID_MAP.put(MMS_SENT, Mms.MESSAGE_BOX_SENT); MATCH_TO_MSGBOX_ID_MAP.put(MMS_DRAFTS, Mms.MESSAGE_BOX_DRAFTS); MATCH_TO_MSGBOX_ID_MAP.put(MMS_OUTBOX, Mms.MESSAGE_BOX_OUTBOX); } private final HashMap<Integer, HashSet Other Android examples (source code examples)Here is a short list of links related to this Android PduCache.java source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.