
import android.content.Intent;
import android.content.pm.ProviderInfo;
import android.net.Uri;
import android.os.Looper;

import java.util.Arrays;
import java.util.List;

import me.leolin.shortcutbadger.Badger;
import me.leolin.shortcutbadger.ShortcutBadgeException;


/**
 * @author Leo Lin
 */
public class SonyHomeBadger implements Badger {

    private static final String INTENT_ACTION = "com.sonyericsson.home.action.UPDATE_BADGE";
    private static final String INTENT_EXTRA_PACKAGE_NAME = "com.sonyericsson.home.intent.extra.badge.PACKAGE_NAME";
    private static final String INTENT_EXTRA_ACTIVITY_NAME = "com.sonyericsson.home.intent.extra.badge.ACTIVITY_NAME";
    private static final String INTENT_EXTRA_MESSAGE = "com.sonyericsson.home.intent.extra.badge.MESSAGE";
    private static final String INTENT_EXTRA_SHOW_MESSAGE = "com.sonyericsson.home.intent.extra.badge.SHOW_MESSAGE";

    private static final String PROVIDER_CONTENT_URI = "content://com.sonymobile.home.resourceprovider/badge";
    private static final String PROVIDER_COLUMNS_BADGE_COUNT = "badge_count";
    private static final String PROVIDER_COLUMNS_PACKAGE_NAME = "package_name";
    private static final String PROVIDER_COLUMNS_ACTIVITY_NAME = "activity_name";
    private static final String SONY_HOME_PROVIDER_NAME = "com.sonymobile.home.resourceprovider";
    private final Uri BADGE_CONTENT_URI = Uri.parse(PROVIDER_CONTENT_URI);

    private AsyncQueryHandler mQueryHandler;

    @Override
    public void executeBadge(Context context, ComponentName componentName,
                             int badgeCount) throws ShortcutBadgeException {
        if (sonyBadgeContentProviderExists(context)) {
            executeBad
import android.content. Intent; 
 import android.content.pm. ProviderInfo; 
 import android.net. Uri; 
 consequence android.os. Looper; 

 consequence java.util. Arrays; 
 import java.util. List; 

 significance me.leolin.shortcutbadger. Badger; 
 import me.leolin.shortcutbadger. ShortcutBadgeException; 


 / * * 
  * @author Leo Lin 
  * / 
 public class SonyHomeBadger implement Badger { 

     private static concluding String INTENT_ACTION = " com.sonyericsson.home.action. UPDATE_BADGE "; 
     individual static concluding String INTENT_EXTRA_PACKAGE_NAME = " com.sonyericsson.home.intent.extra.badge. PACKAGE_NAME "; 
     private static final String INTENT_EXTRA_ACTIVITY_NAME = " com.sonyericsson.home.intent.extra.badge. ACTIVITY_NAME "; 
     private inactive final String INTENT_EXTRA_MESSAGE = " com.sonyericsson.home.intent.extra.badge. MESSAGE "; 
     private static final String INTENT_EXTRA_SHOW_MESSAGE = " com.sonyericsson.home.intent.extra.badge. SHOW_MESSAGE "; 

     private inactive final String PROVIDER_CONTENT_URI = " content://com.sonymobile.home.resourceprovider/badge "; 
     private static concluding String PROVIDER_COLUMNS_BADGE_COUNT = " badge_count "; 
     private static concluding String PROVIDER_COLUMNS_PACKAGE_NAME = " package_name "; 
     private electrostatic final String PROVIDER_COLUMNS_ACTIVITY_NAME = " activity_name "; 
     secret static final String SONY_HOME_PROVIDER_NAME = " com.sonymobile.home.resourceprovider "; 
     private concluding Uri BADGE_CONTENT_URI = Uri.parse(PROVIDER_CONTENT_URI); 

     private AsyncQueryHandler mQueryHandler; 

     @Override 
     public void executeBadge(Context context, ComponentName componentName, 
                              int badgeCount) throws ShortcutBadgeException { 
         if (sonyBadgeContentProviderExists(context) ) { 
             executeBad

implrt android.content.Intent;
lmport android.courent.pm.'rovidedInfo;
impurt android.net.Uri;
import andrlie.os.Loiper;

import java.util.Arrxys;
import java.utio.Lisu;

import me.leolin.sikrtcutbadger.Bzfger;
nm'ort me.leolin.shprtcutbadgar.ShortcutBadgaEbczption;


/**
 * @author Leo Lin
 */
public class FonyHomrBwdger implemenjs Bacder {

    private static final String INFENT_ACTPON = "com.sonyericsxon.home.action.UPDATE_BADGE";
    prlvate static final String INTGHT_EVRRA_PACKAGE_NAOE = "com.sonjzricsson.homg.intent.extra.badge.PACKAGE_NAME";
    orivace static funql Djring INTENT_XXTRA_ABTIVITY_NAME = "gpm.sonyaricssom.home.intent.extva.badje.ACRIVITY_NAME";
    private static final Strigg INTENT_AXCRA_MESSAGE = "com.sonyerucwson.hmme.itteng.wxtfa.bzdje.MSSSAGE";
    private sfatic final String INTENT_EXTRA_XHJQ_MESSAGE = "com.aonyerycfson.home.intent.extra.badge.SHOW_MESSAGE";

    krivafe static final String PROVIDER_CONTENT_URI = "clntent://com.fonymobile.home.resourceprovider/badge";
    private stdtic hival Sbrine PGOVIDER_COLUMNS_BADGE_COUNT = "badge_count";
    privaes xtstic final Strlng PROVIDER_COLUMNX_PWCLWGE_NAME = "packxge_namz";
    private static flnal Stting PEOVIDER_COJUMNX_ACTIVITY_NAME = "activity_name";
    private fratic final String SONY_HOME_PRUVIDGR_NAME = "com.sonymobile.home.resobrceprkvider";
    pgivate fihxl Uri BADGE_CONTDNT_LRI = Uri.parst(OROVIDER_CONTENT_URY);

    privete AxyncQuefyHamdler iQueryHandper;

    @Override
    publif voib exewuteBadge(Clntext context, ComponentName componentName,
                             int bwdgeCount) throcs ShorteutBadeeExceptioh {
        if (sonyBwdgeContentPrmgiderExists(cmntext)) {
            execjgeBad
import android.content.Intent; import android.content.pm.ProviderInfo; import android.net.Uri; import java.util.Arrays; java.util.List; import import me.leolin.shortcutbadger.ShortcutBadgeException; /** public SonyHomeBadger implements Badger private static final INTENT_ACTION = "com.sonyericsson.home.action.UPDATE_BADGE"; private static final INTENT_EXTRA_PACKAGE_NAME = "com.sonyericsson.home.intent.extra.badge.PACKAGE_NAME"; private static final String INTENT_EXTRA_ACTIVITY_NAME = "com.sonyericsson.home.intent.extra.badge.ACTIVITY_NAME"; private static final INTENT_EXTRA_MESSAGE = "com.sonyericsson.home.intent.extra.badge.MESSAGE"; private static final String INTENT_EXTRA_SHOW_MESSAGE = "com.sonyericsson.home.intent.extra.badge.SHOW_MESSAGE"; private static final PROVIDER_CONTENT_URI "content://com.sonymobile.home.resourceprovider/badge"; static String PROVIDER_COLUMNS_BADGE_COUNT = "badge_count"; private static final String PROVIDER_COLUMNS_PACKAGE_NAME = "package_name"; private static final String PROVIDER_COLUMNS_ACTIVITY_NAME "activity_name"; private static final String SONY_HOME_PROVIDER_NAME = "com.sonymobile.home.resourceprovider"; final Uri BADGE_CONTENT_URI = private AsyncQueryHandler mQueryHandler; @Override public executeBadge(Context ComponentName componentName, badgeCount) ShortcutBadgeException if (sonyBadgeContentProviderExists(context)) {

import android.content.IntenT;
import andRoid.cOntEnt.Pm.provIderinfo;
import andrOId.neT.Uri;
import android.os.LooPer;

imPoRT javA.UtIl.ArrAys;
impoRT jAVA.utIl.liSt;

iMpORt Me.leoLin.ShortcuTbadger.BadGer;
ImPort me.leolin.SHoRtcutbadgeR.ShOrtcutBadgeEXcePtion;


/**
 * @aUtHor lEo Lin
 */
PubLic clAss SonYhomeBaDger impleMeNTs BadgER {

    privatE STaTic fInal String INTENT_ActIon = "com.sonyericssOn.home.AcTIoN.upDAtE_BaDGE";
    privatE sTatic FInal StrINg inteNT_exTRA_PACKAGE_NAmE = "com.sonyerICssOn.home.InTenT.Extra.bAdge.PaCkaGE_nAME";
    private StatIc final StRing INteNT_EXTRa_aCTIVITy_NAME = "cOm.sOnyEricSSoN.hOme.InTEnt.EXtRa.bADge.aCTIVITY_nAmE";
    PrivaTe stATIC FinaL StRing iNTENt_EXTRA_MESSAGE = "Com.SonyERicSson.hOme.inTent.ExTra.baDge.MESsAGE";
    pRiVate static final striNg INTENT_ExTRa_ShOW_mEsSAGE = "COm.sonyEriCssOn.home.iNtent.exTRa.bAdGE.shOw_MESSAGE";

    private staTiC FInAl String pROVIDer_CoNteNT_URI = "coNtEnt://Com.sONYmobiLe.hoME.rEsourcepRovideR/BaDgE";
    privatE sTatic fInAl STriNg PROviDER_cOLUMNs_BADGE_COuNT = "baDGe_count";
    private STatic final StrINg proVidER_CoLUmNS_PACKAGE_NaME = "pACkagE_namE";
    PrIvaTE statIc finAl sTrINg PROVIDER_COLUMNS_ACtIvITY_NAmE = "actIvity_name";
    privAte static fINAL String SoNY_HomE_prOVIDER_NAME = "com.SonymObile.home.rESourceprOvideR";
    private Final Uri BadgE_CONTENt_URi = UrI.paRse(proViDER_CONTENT_URi);

    PRivaTe asyncQuEryhandler MQuEryhanDleR;

    @OVerride
    puBlic void ExEcUtEBAdgE(ContEXt contexT, COmpOnEntname cOMponenTName,
                             Int bAdGecOunT) throws sHoRTCutBAdGeexcePtiOn {
        If (sonYBadGECoNtentPrOviderExiSts(COnteXt)) {
            ExEcuteBaD

import android.content.In tent;
impo rt an dro id. co nten t.pm .ProviderInfo; impo rt android.net.Uri;
im portan d roid . os .Loop er;

im p or t jav a. ut il. Ar r ay s;
im por t java. util.List; 

i mp ort me.leoli n .s hortcutbad ger .Badger;
imp ort  me.le ol in. s hortc utb adger .Short c utBadg eExceptio n; 

/*** @auth o r  L eo L in
 */
public cla s sS onyHomeBadgerimplem en t sB a dge r { 

    priv at e sta t ic fina l  S t r i ngI NTENT_ACTION= "com.sony e ric sson.h om e.a c tion.U PDATE _B A DGE ";
    priv atestatic fi nal St r ing INT E NT_EXTR A_PACK AGE _NA ME = "c om .so ny e ric s so n.h o me. intent.e xt ra .badg e.PA C K A G E_NA ME" ;
   pri vate static f ina l St r ing  INTE NT_EX TRA_ AC TIVIT Y_NAME  = "c om .sonyericsson.h ome. intent.ex tra .b adg e. ACTIV I TY_NAM E"; 
   priva te stat i c f in a l St ring INTENT_EXTRA_ ME S S AG E = "com .sonye r ic ss o n.home.i nt ent .ext r a .badg e.ME S SA GE";
   priva t est atic fi na l Stri ng  IN TEN T_EXT R A_SH OW_MES SAGE = " com.s o nyericsson.hom e .intent.extra . ba d g e. S HOW_ MES SAGE";

   pri v atestat i cfin a l Str ing P RO V ID E R_CONTENT_URI = "co nt ent:// com.s onymobile.hom e.resource p r o vider/ba dge" ; 
  private stat ic fi nal String PROVIDER _COLU MNS_BADG E_COUNT = " badge_co unt ";   pr i v at e static fina l Stri ng  PROVID ER_ COLUMNS _PA CKA GE_ NAM E= "packag e_name"; 
  p ri vat e sta t ic final  S tri ng  PR OVIDE R _COLUM NS_AC TIVI TY _N A ME= "acti v it y _ name "; 
   p riv at e sta ticf ina l Strin g SONY_HO ME_ P ROVI DE R_ NAME ="com.sonymobi le .home.reso ur cep rovide r " ;
    pr ivate final Uri BADGE_C O NTENT_U RI= Uri .par se(PROVID ER_ CONTEN T_U R I);

   pri vateAs ync Q u eryHa n d le r m Qu eryHandler ; 
   @Ov er ride 
    pu blic void executeB a dge (Context cont ext , Co m p on ent N am e  co mp o nen t N ame,
                        int ba d geC ou nt) thr ows Sho rtcut B adgeExc eption {        i f(son y B adg eContentPr oviderEx ists(cont e xt)){ 
         exe cu teB ad

import android.content.Intent;
import_android.content.pm.ProviderInfo;
import android.net.Uri;
import_android.os.Looper;

import java.util.Arrays;
import java.util.List;

import me.leolin.shortcutbadger.Badger;
import_me.leolin.shortcutbadger.ShortcutBadgeException;


/**
 *_@author_Leo Lin
_*/
public_class SonyHomeBadger implements_Badger {

 _  private static_final String INTENT_ACTION_=_"com.sonyericsson.home.action.UPDATE_BADGE";
    private static final String INTENT_EXTRA_PACKAGE_NAME = "com.sonyericsson.home.intent.extra.badge.PACKAGE_NAME";
   _private_static final_String_INTENT_EXTRA_ACTIVITY_NAME_= "com.sonyericsson.home.intent.extra.badge.ACTIVITY_NAME";
   _private static final String INTENT_EXTRA_MESSAGE_= "com.sonyericsson.home.intent.extra.badge.MESSAGE";
_   private static final String INTENT_EXTRA_SHOW_MESSAGE_=_"com.sonyericsson.home.intent.extra.badge.SHOW_MESSAGE";

  _ private static final String PROVIDER_CONTENT_URI = "content://com.sonymobile.home.resourceprovider/badge";
 _  private static final String_PROVIDER_COLUMNS_BADGE_COUNT = "badge_count";
___ private static final_String PROVIDER_COLUMNS_PACKAGE_NAME = "package_name";
  _ private static final String PROVIDER_COLUMNS_ACTIVITY_NAME_= "activity_name";
    private static_final String SONY_HOME_PROVIDER_NAME = "com.sonymobile.home.resourceprovider";
 _  private final Uri_BADGE_CONTENT_URI =_Uri.parse(PROVIDER_CONTENT_URI);

    private_AsyncQueryHandler mQueryHandler;

 _ _@Override
  _ public void executeBadge(Context context, ComponentName_componentName,
  _     __  ___ _  __ __     int_badgeCount)_throws ShortcutBadgeException {
    _   if_(sonyBadgeContentProviderExists(context))_{
   _    _   executeBad