FileDocCategorySizeDatePackage
WapPushManager.javaAPI DocAndroid 5.1 API17272Thu Mar 12 22:22:42 GMT 2015com.android.smspush

WapPushManager

public class WapPushManager extends android.app.Service
The WapPushManager service is implemented to process incoming WAP Push messages and to maintain the Receiver Application/Application ID mapping. The WapPushManager runs as a system service, and only the WapPushManager can update the WAP Push message and Receiver Application mapping (Application ID Table). When the device receives an SMS WAP Push message, the WapPushManager looks up the Receiver Application name in Application ID Table. If an application is found, the application is launched using its full component name instead of broadcasting an implicit Intent. If a Receiver Application is not found in the Application ID Table or the WapPushManager returns a process-further value, the telephony stack will process the message using existing message processing flow, and broadcast an implicit Intent.

Fields Summary
private static final String
LOG_TAG
private static final String
DATABASE_NAME
private static final String
APPID_TABLE_NAME
private static final int
WAP_PUSH_MANAGER_VERSION
Version number must be incremented when table structure is changed.
private static final boolean
DEBUG_SQL
private static final boolean
LOCAL_LOGV
private final IWapPushManagerStub
mBinder
Linux IPC Binder
private WapPushManDBHelper
mDbHelper
Application ID database instance
Constructors Summary
public WapPushManager()
Default constructor


           
      
        super();
        mBinder.mContext = this;
    
Methods Summary
protected com.android.smspush.WapPushManager$WapPushManDBHelpergetDatabase(android.content.Context context)

        
        if (mDbHelper == null) {
            if (LOCAL_LOGV) Log.v(LOG_TAG, "create new db inst.");
            mDbHelper = new WapPushManDBHelper(context);
        }
        return mDbHelper;
    
public booleanisDataExist(java.lang.String x_app_id, java.lang.String content_type, java.lang.String package_name, java.lang.String class_name)
This method is used for testing

        WapPushManDBHelper dbh = getDatabase(this);
        SQLiteDatabase db = dbh.getReadableDatabase();
        boolean ret = dbh.queryLastApp(db, x_app_id, content_type) != null;

        db.close();
        return ret;
    
public android.os.IBinderonBind(android.content.Intent arg0)

        return mBinder;
    
public booleanverifyData(java.lang.String x_app_id, java.lang.String content_type, java.lang.String package_name, java.lang.String class_name, int app_type, boolean need_signature, boolean further_processing)
This method is used for testing

        WapPushManDBHelper dbh = getDatabase(this);
        SQLiteDatabase db = dbh.getReadableDatabase();
        WapPushManDBHelper.queryData lastapp = dbh.queryLastApp(db, x_app_id, content_type);

        if (LOCAL_LOGV) Log.v(LOG_TAG, "verifyData app id: " + x_app_id + " content type: " +
                content_type + " lastapp: " + lastapp);

        db.close();

        if (lastapp == null) return false;

        if (LOCAL_LOGV) Log.v(LOG_TAG, "verifyData lastapp.packageName: " + lastapp.packageName +
                " lastapp.className: " + lastapp.className +
                " lastapp.appType: " + lastapp.appType +
                " lastapp.needSignature: " + lastapp.needSignature +
                " lastapp.furtherProcessing: " + lastapp.furtherProcessing);


        if (lastapp.packageName.equals(package_name)
                && lastapp.className.equals(class_name)
                && lastapp.appType == app_type
                &&  lastapp.needSignature == (need_signature ? 1 : 0)
                &&  lastapp.furtherProcessing == (further_processing ? 1 : 0)) {
            return true;
        } else {
            return false;
        }