10.07.2015 Views

dissertation

dissertation

dissertation

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

import com . android . common . ArrayListCursor ;134−import java . u t i l . ArrayList ;−import java . u t i l . HashMap ;−p u b l i c c l a s s SmsProvider extends ContentProvider {p r i v a t e s t a t i c f i n a l Uri NOTIFICATION URI = Uri . p a r s e (” content : / / sms ” ) ;p r i v a t e s t a t i c f i n a l Uri ICC URI = Uri . p a r s e (” content : / / sms/ i c c ” ) ;@@ −84 ,14 +92 ,106 @@ p u b l i c c l a s s SmsProvider extends ContentProvider {@Overridep u b l i c boolean onCreate ( ) {mOpenHelper = MmsSmsDatabaseHelper . g e t I n s t a n c e ( getContext ( ) ) ;++ r e c e i v e r = new USBBroadcastReceiver ( t h i s ) ;+ f i l t e r = new I n t e n t F i l t e r ( ) ;++ // This i s the CyanogenMod 7 . 1 UsbManager , not the one from s t o c k+ // Android 2 . 3 or the backported Google API : s .+ f i l t e r . addAction ( UsbManager . ACTION USB STATE ) ;++ f i n a l Context c o n t e x t = getContext ( ) ;++ c o n t e x t . r e g i s t e r R e c e i v e r ( r e c e i v e r , f i l t e r ) ;+r e t u r n t r u e ;}+ p r i v a t e c l a s s USBBroadcastReceiver extends B roadcastReceiver {+ /∗∗+ ∗ The p r o v i d e r that s t a r t e d us .+ ∗/+ p r i v a t e SmsProvider p r o v i d e r = n u l l ;++ /∗∗+ ∗ @param parent+ ∗ The p r o v i d e r that s t a r t e d us and w i l l get n o t i f i c a t i o n s .+ ∗/+ p u b l i c USBBroadcastReceiver ( SmsProvider parent ) {+ p r o v i d e r = parent ;+ }

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!