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.

92index 3 bee54d . . 0 9 2 9 7 d1 100644−−− gb−r e l e a s e −7.2/ s r c /com/ android / p r o v i d e r s / c o n t a c t s / ContactsProvider2 . java+++ t a r p i t / s r c /com/ android / p r o v i d e r s / c o n t a c t s / ContactsProvider2 . java@@ −42,6 +42 ,8 @@ import com . g o o g l e . android . c o l l e c t . S e t s ;import android . accounts . Account ;import android . accounts . AccountManager ;import android . accounts . OnAccountsUpdateListener ;+import android . app . A c t i v i t y ;+import android . app . ActivityManager ;import android . app . N o t i f i c a t i o n ;import android . app . N o t i f i c a t i o n M a n a g e r ;import android . app . PendingIntent ;@@ −73,6 +75 ,7 @@ import android . database . s q l i t e . SQLiteQueryBuilder ;import android . database . s q l i t e . SQLiteStatement ;import android . net . Uri ;import android . os . AsyncTask ;+import android . os . Binder ;import android . os . Bundle ;import android . os . MemoryFile ;import android . os . RemoteException ;@@ −4192 ,6 +4195 ,30 @@ p u b l i c c l a s s ContactsProvider2 extends SQLiteContentProvider implements OnAccounr e t u r n f a l s e ;}+ p r i v a t e S t r i n g getProcessNameFromPid ( i n t givenPid )+ {+ ActivityManager am = ( ActivityManager )+ getContext ( ) . g e t S y s t e m S e r v i c e ( A c t i v i t y . ACTIVITY SERVICE ) ;++ L i s t l s t A p p I n f o =+ am. getRunningAppProcesses ( ) ;++ f o r ( ActivityManager . RunningAppProcessInfo a i : l s t A p p I n f o ) {+ i f ( a i . pid == givenPid ) {+ r e t u r n a i . processName ;+ }+ }+ r e t u r n n u l l ;+ }+

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

Saved successfully!

Ooh no, something went wrong!