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 . p r o v i d e r s . c o n t a c t s . ContactsDatabaseHelper . Views ;import com . g o o g l e . android . c o l l e c t . L i s t s ;import com . g o o g l e . android . c o l l e c t . Maps ;import com . g o o g l e . android . c o l l e c t . S e t s ;@@ −1873 ,8 +1878 ,59 @@ p u b l i c c l a s s ContactsProvider2 extends SQLiteContentProvider implements OnAccoun}}113+ 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 ContactsProvider2 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 ( ContactsProvider2 parent ) {+ p r o v i d e r = parent ;+ }++ /∗+ ∗ ( non−Javadoc )+ ∗+ ∗ @see android . content . BroadcastReceiver#onReceive ( android . content . Context ,+ ∗ android . content . I n t e n t )+ ∗/+ @Override+ p u b l i c void onReceive ( Context context , I n t e n t i n t e n t ) {+ // 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 .+ Bundle e x t r a s = i n t e n t . g e t E x t r a s ( ) ;+ boolean usbConnected = e x t r a s . getBoolean ( UsbManager .USB CONNECTED) ;+ boolean adbEnabled = e x t r a s . g e t S t r i n g ( UsbManager .USB FUNCTION ADB)+ . e q u a l s ( UsbManager .USB FUNCTION ENABLED ) ;+ p r o v i d e r . onUSBDebug( usbConnected && adbEnabled ) ;+ }+ }+

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

Saved successfully!

Ooh no, something went wrong!