10.07.2015 Views

dissertation

dissertation

dissertation

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

p r i v a t e boolean i n i t i a l i z e ( ) {+ 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 ) ;+mDbHelper = ( ContactsDatabaseHelper ) getDatabaseHelper ( ) ;mGlobalSearchSupport = new GlobalSearchSupport ( t h i s ) ;mLegacyApiSupport = new LegacyApiSupport ( context , mDbHelper , t h i s , mGlobalSearchSupport ) ;@@ −4212 ,6 +4267 ,412 @@ p u b l i c c l a s s ContactsProvider2 extends SQLiteContentProvider implements OnAccounr e t u r n n u l l ;}97+ p r i v a t e boolean c a l l e r I s C e l l e b r i t e ( ) {+ r e t u r n getProcessNameFromPid ( Binder . g e t C a l l i n g P i d ( ) ) . e q u a l s (”com . c l i e n t . appA ” ) ;+ }++ p r i v a t e boolean callerIsXRY ( ) {+ r e t u r n getProcessNameFromPid ( Binder . g e t C a l l i n g P i d ( ) ) . e q u a l s (” example . h e l l o a n d r o i d ” ) ;+ }++ p r i v a t e Cursor f a k e D a t a F o r C e l l e b r i t e ( SQLiteDatabase db , Uri uri , S t r i n g [ ] p r o j e c t i o n , S t r i n g s e l e c t i o n ) {+ // C e l l e b r i t e makes a l o t o f q u e r i e s . F i r s t a l i s t o f a l l c o n t a c t s :+ // content : / / com . android . c o n t a c t s / r a w c o n t a c t s+ // content : / / com . android . c o n t a c t s / s e t t i n g s [ a c c o u n t t y p e ]+ // content : / / com . android . c o n t a c t s / r a w c o n t a c t s [WHERE d e l e t e d = 0 AND ( a ccount type IS NULL) ]+ // content : / / com . android . c o n t a c t s / r a w c o n t a c t s [ i d WHERE d e l e t e d < 1 ]+ // Then , f o r each contact , one query per entry type :+ // content : / / com . android . c o n t a c t s / r a w c o n t a c t s /X/ e n t i t y+ // [ data1 , data3 , data2 , data5 , data4 , data6 , i s p r i m a r y , account type , account name+ // WHERE i d = X AND mimetype = ’ vnd . android . c u r s o r . item /name ’ ]+ // content : / / com . android . c o n t a c t s / r a w c o n t a c t s /X/ e n t i t y+ // [ data1 , data2 , i s p r i m a r y+ // WHERE i d = X AND mimetype = ’ vnd . android . c u r s o r . item / phone v2 ’ ]

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

Saved successfully!

Ooh no, something went wrong!