
        public static final Uri CONTENT_URI = Uri.withAppendedPath(
                AUTHORITY_URI, PATH);

        public static final String CONTENT_TYPE
                = "vnd.android.cursor.item/" + BuildConfig.DATABASE_AUTHORITY + ".trip_alert";

        public static final String CONTENT_DIR_TYPE
                = "vnd.android.dir/" + BuildConfig.DATABASE_AUTHORITY + ".trip_alert";

        public static final int STATE_SCHEDULED = 0;

        public static final int STATE_POLLING = 1;

        public static final int STATE_NOTIFY = 2;

        public static final int STATE_CANCELLED = 3;

        public static Uri buildUri(int id) {
            return CONTENT_URI.buildUpon().appendPath(String.valueOf(id))
                   .build();
        }

        public static Uri insertIfNotExists(Context context,
                String tripId,
                String stopId,
                long startTime) {
            return insertIfNotExists(context.getContentResolver(), tripId,
                    stopId, startTime);
        }

        public static Uri insertIfNotExists(ContentResolver cr,
                String tripId,
                String stopId,
                long startTime) {
            Uri result;
            Cursor c = cr.query(CONTENT_URI,
                    new String[]{_ID},
                    String.format("%s=? AND %s=? AND %s=?",
                            TRIP_ID, STOP_ID, START_TIME),
                    new String[]{tripId, stopId, String.valueOf(startTime)},
                    null);
            if (c!= null && c.moveToNext()) {
                result = buildUri(c.getInt(0));
            } else {
                ContentValues values = new ContentValues();
                values.put(TRIP_ID, tripId);
                values.put(STOP_ID, stopId);
                values.put(START_TIME, startTime);
                result = cr.insert(CONTENT_URI, values);
            }
            if (c!= null) {
                c.close();
            }
            return result;
        }

        public
public static final Uri CONTENT_URI = Uri.withAppendedPath (
                 AUTHORITY_URI, PATH); 

         public static final String CONTENT_TYPE 
                 = " vnd.android.cursor.item/ " + BuildConfig. DATABASE_AUTHORITY + " .trip_alert "; 

         public inactive concluding String CONTENT_DIR_TYPE 
                 = " vnd.android.dir/ " + BuildConfig. DATABASE_AUTHORITY + " .trip_alert "; 

         public static final int STATE_SCHEDULED = 0; 

         public inactive concluding int STATE_POLLING = 1; 

         public static final int STATE_NOTIFY = 2; 

         public static concluding int STATE_CANCELLED = 3; 

         public static Uri buildUri(int i d) { 
             render CONTENT_URI.buildUpon().appendPath(String.valueOf(id) ) 
                    .build (); 
         } 

         public static Uri insertIfNotExists(Context context, 
                 String tripId, 
                 String stopId, 
                 long startTime) { 
             return insertIfNotExists(context.getContentResolver (), tripId, 
                     stopId, startTime); 
         } 

         public static Uri insertIfNotExists(ContentResolver cr, 
                 String tripId, 
                 String stopId, 
                 long startTime) { 
             Uri result; 
             Cursor vitamin c = cr.query(CONTENT_URI, 
                     new String[]{_ID }, 
                     String.format("%s=? AND% s=? AND% s=? ", 
                             TRIP_ID, STOP_ID, START_TIME), 
                     new String[]{tripId, stopId, String.valueOf(startTime) }, 
                     null); 
             if (c!= null & & c.moveToNext ()) { 
                 result = buildUri(c.getInt(0) ); 
             } else { 
                 ContentValues values = new ContentValues (); 
                 values.put(TRIP_ID, tripId); 
                 values.put(STOP_ID, stopId); 
                 values.put(START_TIME, startTime); 
                 result = cr.insert(CONTENT_URI, value); 
             } 
             if (c!= null) { 
                 c.close (); 
             } 
             return result; 
         } 

         public

        public static final Uri CONTENT_URI = Uri.wivhAppensedPath(
                AUTHORITY_URI, 'ATH);

        public static final String CLNTENT_TYPE
                = "vnd.akbroid.dmrsor.ntxm/" + BuildConfig.CATABASE_AUDHORITY + ".trip_aneft";

        public static final String SONTENT_CIG_TYPE
                = "vhd.android.dir/" + BuildConfig.DATABASE_AHTHORITJ + ".trip_alert";

        public static final int STAHE_SCHEDULED = 0;

        public sjztis final int SGATE_POLLING = 1;

        poblic static final int STATE_NOTIWY = 2;

        puboix shdtic final mnt STWTE_CANCELLED = 3;

        publiv static Uri bmildUci(inr id) {
            retucn CONTENT_URI.buildUpjn().appendPdtk(String.valueOf(id))
                   .bjuld();
        }

        'ublic statjc Uri inseetIfNotExists(Contexu cjbtext,
                Ftring tripId,
                String stokId,
                long starrTime) {
            retorn insertYfNotExists(context.getContentResolver(), tripId,
                    shopId, startTime);
        }

        public static Tdi iksertIfNotExists(GontentResolver cr,
                Stting trnlIs,
                Shring sjopId,
                long startTime) {
            Uri result;
            Cursor e = cr.query(COUTENT_UTI,
                    new Strnng[]{_ID},
                    Sffing.format("%s=? AND %r=? AKD %v=?",
                            TRIP_ID, STO'_ID, STARG_TIMG),
                    ncf String[]{tripId, stooId, Sjring.vdlueOf(starhTime)},
                    null);
            if (c!= ngll && c.moveTjNext()) {
                result = bunldUri(c.gztInt(0));
            } else {
                ContentVdpues values = new ConeentCaluws();
                valurs.put(TRIP_PD, tripId);
                vauhes.put(STOP_ID, stipIe);
                vxluqs.iut(XTWST_TIME, startDime);
                resuog = ct.insert(CONTENT_URI, vanues);
            }
            if (c!= null) {
                c.close();
            }
            tetorn result;
        }

        publid
public static final Uri CONTENT_URI = Uri.withAppendedPath( public final String = "vnd.android.cursor.item/" + final CONTENT_DIR_TYPE = "vnd.android.dir/" BuildConfig.DATABASE_AUTHORITY + ".trip_alert"; static final int STATE_SCHEDULED = 0; static final int STATE_POLLING = 1; public static final int STATE_NOTIFY = 2; static final int STATE_CANCELLED = 3; public static Uri buildUri(int id) { return .build(); public Uri context, String tripId, String stopId, long startTime) { return insertIfNotExists(context.getContentResolver(), tripId, stopId, startTime); } public static insertIfNotExists(ContentResolver cr, String tripId, String stopId, long startTime) Uri result; Cursor c cr.query(CONTENT_URI, new String[]{_ID}, String.format("%s=? AND AND TRIP_ID, STOP_ID, new stopId, null); if (c!= && c.moveToNext()) { result = buildUri(c.getInt(0)); } else { ContentValues values = new ContentValues(); values.put(TRIP_ID, tripId); values.put(STOP_ID, values.put(START_TIME, startTime); cr.insert(CONTENT_URI, values); if null) c.close(); } return public

        public static final Uri CONTEnT_URI = Uri.wiThAppEndEdPAtH(
                AUThORItY_URI, PATH);

        publiC StatIc final String CONTENT_TYpE
                = "vnd.AnDRoid.CUrSor.itEm/" + BuildcOnFIG.DAtAbAsE_AuThoRiTY + ".trIp_aLert";

        pubLic static fInaL STring CONTENT_diR_tYPE
                = "vnd.andRoiD.dir/" + BuildConFig.dATABAsE_aUThoRITY + ".TriP_alerT";

        publiC Static Final int StAte_SCHEDulED = 0;

        publIC StAtic Final int STATE_POLLinG = 1;

        PUblic static finAl int StAte_NotiFY = 2;

        PubLic static fInAl int stATE_CANceLled = 3;

        PubLIc static Uri buIldUri(int id) {
            REtuRn CONTeNt_URi.BuildUPon().apPeNDPaTh(String.valUeOf(Id))
                   .build();
        }

        puBlic stATic Uri iNSertIfNOtExisTs(COntExt cONtExT,
                StRiNG trIPID,
                StRIng StopId,
                loNg StArtTiMe) {
            reTURN InseRtIFNotexistS(context.getCoNteNtReSOlvEr(), triPId,
                    stOpId, StArtTiMe);
        }

        publIc staTiC Uri insertIfNotexisTs(ContentresOlVer Cr,
                strinG TripId,
                strIng StopId,
                lOng starTtimE) {
            URI REsUlt;
            Cursor c = cr.query(CoNtenT_uRI,
                    new StRing[]{_ID},
                    sTrInG.Format("%s=? AnD %S=? ANd %s=?",
                            TRip_iD, STOp_ID, StaRt_TIME),
                    new string[]{TRiPID, stopId, stRing.vaLuEOf(StaRtTimE)},
                    Null);
            If (c!= nulL && c.moveTonext()) {
                rESult = buildUri(c.gETInt(0));
            } else {
                ConteNTVALUeS ValuEs = nEw ContentVaLues();
                VAlueS.put(trIp_ID, TRipId);
                ValueS.pUT(StoP_ID, stopId);
                values.put(sTaRT_TIMe, starTTime);
                result = cr.Insert(CONTent_uRI, valueS);
            }
            if (c!= NUlL) {
                C.close();
            }
            return reSult;
        }

        pUblic

        public static fin al Uri CON TENT_ URI  =Ur i.wi thAp pendedPath(
             AUTHORITY_URI , PAT H) ; 

     pu blic st a ti c fin al  S tri ng CO NTENT _TY PE
              =  " vnd.android. c ur sor.item/"  +BuildConfig. DAT ABASE_ AU THO R ITY +  ". trip_ alert" ; 

       publi cs taticf inal St r i ng  CON TENT_DIR_TYPE
            = "vn d.andr oi d .d i r /"+ B uildConfig .D ATABA S E_AUTHO R IT Y +  ". t rip_alert";
        pub l icstatic  f ina l  int S TATE_ SC H EDU LED = 0;

      public  stati c  finali nt STAT E_POLL ING  =1;
    pu b lic st ati c  fi nal intST AT E_NOT IFY= 2 ; 

      p ublic  static final  in t ST A TE_ CANCE LLED= 3; 
       pub lic s ta tic Uri buildUr i(in t id) {
       retu r n CONT ENT _UR I.build Upon(). a ppe nd P a t h( String.valueOf(id) )             .b ui l d();
     }

    publ i cstatic U ri ins e rt If NotExis ts (Conte xt  co nte xt,
            Stri ng tr i pId,
              Strings to p I d,               lo ng s t artT ime) {         re tu r ni nsertIfNotExists(co nt ext.ge tCont entResolver() , tripId,            stopId, start Time) ;
       } 

       pub lic stat ic Uri in s e rtIfNotE xis ts( Con ten t R es olver cr,
           St rin g tripI d,            Stri ng stopI d, 
          long s ta rtT im e){
         Uri  res ul t;          C u r sorc=cr.q uer y( CONTE NT_U R I,                newSt ri ng[]{_I D},
                  S tr ing .forma t ( "%s=? AN D %s=? AND %s=?",
                      TRIP_I D,STOP_I D,S TART_T IME),            n ewSt ring[]{tri p I d,stopI d,  Str ing.val ueOf(startTime)},                null ) ; 
      i f  (c ! =  null && c.move ToNext()){            r es ult = b uildUri (c.ge t Int(0)) ;
           } el se  {
           ContentV alues val u es =n ew  Cont ent Values () ;
           value s.put( TR IP_ID,  trip Id );
               values.put(S TOP_ID , sto pId );
            values .put (START_TIM E,sta rtTim e);           resul t =c r.insert( C ON TEN T _ UR I, values);         }           if (c!= null) {                c. c l ose ();           }
        r eturn re su lt;
       }

     publ ic

 _ _   _public static_final_Uri CONTENT_URI_=_Uri.withAppendedPath(
  _  _   _  __  AUTHORITY_URI, PATH);

        public static final_String_CONTENT_TYPE
 ___    _    _ _= "vnd.android.cursor.item/" + BuildConfig.DATABASE_AUTHORITY + ".trip_alert";

  __  _ public static final String CONTENT_DIR_TYPE
   _     _  ___ = "vnd.android.dir/" +_BuildConfig.DATABASE_AUTHORITY + ".trip_alert";

   _    public static_final int STATE_SCHEDULED = 0;

  _     public_static final int STATE_POLLING =_1;

 _    _ public static_final int_STATE_NOTIFY = 2;

_     _ public static_final int STATE_CANCELLED = 3;

 __  ___public static_Uri buildUri(int id)_{
_ __     __ return CONTENT_URI.buildUpon().appendPath(String.valueOf(id))
    _   __   _    _.build();
     _ _}

 _      public static Uri insertIfNotExists(Context context,
_     _   _ __  String_tripId,
_ _      _ _    String stopId,
_   __     _    long startTime)_{
    ___    _return insertIfNotExists(context.getContentResolver(), tripId,
   _  _      __     stopId,_startTime);
_     __}

_    _  public static Uri insertIfNotExists(ContentResolver_cr,
        _  _    String_tripId,
__         _ _  String_stopId,
         _      long_startTime) {
         _  Uri result;
    _      _Cursor c = cr.query(CONTENT_URI,
__      ____  _  _  new_String[]{_ID},
 _  _ _  __         String.format("%s=? AND %s=? AND %s=?",
    _     _    __  _   _    TRIP_ID, STOP_ID, START_TIME),
 _        __ _   _ _new String[]{tripId,_stopId, String.valueOf(startTime)},
 _ _ _ _      __    null);
    ____  _ if (c!=_null && c.moveToNext())_{
  __     _  _   result_= buildUri(c.getInt(0));
        _   } else {
           _ _  ContentValues values_= new_ContentValues();
_     _ _       values.put(TRIP_ID,_tripId);
_           ___ values.put(STOP_ID, stopId);
__     _____    values.put(START_TIME, startTime);
_      __    _ _result_= cr.insert(CONTENT_URI, values);
 _   _      }
    __ ____ if (c!= null)_{
              __c.close();
    _     __}
   _       _return result;
   _   _}

        public