Code example for Context

Methods: getPackageManagergetPackageName

0
 
        /** 
         * Compare the package signature with WapPushManager package 
         */ 
        protected boolean signatureCheck(String package_name) {
            PackageManager pm = mContext.getPackageManager();
            int match = pm.checkSignatures(mContext.getPackageName(), package_name);
 
            if (LOCAL_LOGV) Log.v(LOG_TAG, "compare signature " + mContext.getPackageName()
                    + " and " +  package_name + ", match=" + match);
 
            return match == PackageManager.SIGNATURE_MATCH;
        } 
 
        /** 
         * Returns the status value of the message processing. 
         * The message will be processed as follows: 
         * 1.Look up Application ID Table with x-wap-application-id + content type 
         * 2.Check the signature of package name that is found in the 
         *   Application ID Table by using PackageManager.checkSignature 
         * 3.Trigger the Application