auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
boolean disableWBS ( ) { enforceCallingOrSelfPermission ( com.android.bluetooth.hfp.BLUETOOTH_PERM , "Need BLUETOOTH permission" ) ; if ( ! ( mStateMachine.isConnected ( ) ) ) { return false ; } if ( mStateMachine.isAudioOn ( ) ) { return false ; } for ( android.bluetooth.BluetoothDevice device : getConnectedDevices ( ) ) { mStateMachine.sendMessage ( HeadsetStateMachine.DISABLE_WBS , device ) ; } return true ; }

Target:
boolean connectAudio ( ) { enforceCallingOrSelfPermission ( com.android.bluetooth.hfp.BLUETOOTH_PERM , "Need BLUETOOTH permission" ) ; if ( ( mStateMachine.getConnectionState ( mStateMachine.getCurrentDevice ( ) ) ) != ( android.bluetooth.BluetoothProfile.STATE_CONNECTED ) ) { android.util.Log.w ( com.android.bluetooth.hfp.HeadsetService.TAG , "connectAudio: profile not connected" ) ; return false ; } if ( isAudioOn ( ) ) { android.util.Log.w ( com.android.bluetooth.hfp.HeadsetService.TAG , ( "connectAudio: audio is not idle, current state " + ( mStateMachine.getAudioState ( ) ) ) ) ; return false ; } mStateMachine.sendMessage ( HeadsetStateMachine.CONNECT_AUDIO , mStateMachine.getCurrentDevice ( ) ) ; return true ; }
Source:
public boolean addGpsStatusListener ( android.location.IGpsStatusListener listener ) { if ( ( mGpsLocationProvider ) == null ) { return false ; } if ( ( mContext.checkCallingPermission ( com.android.server.LocationManagerService.ACCESS_FINE_LOCATION ) ) != ( android.content.pm.PackageManager.PERMISSION_GRANTED ) ) { throw new java.lang.SecurityException ( "Requires ACCESS_FINE_LOCATION permission" ) ; } try { mGpsLocationProvider.addGpsStatusListener ( listener ) ; } catch ( android.os.RemoteException e ) { android.util.Log.w ( com.android.server.LocationManagerService.TAG , "RemoteException in addGpsStatusListener" ) ; return false ; } return true ; }

Target:
public void removeGpsStatusListener ( android.location.IGpsStatusListener listener ) { synchronized ( mLock ) { try { mGpsStatusProvider.removeGpsStatusListener ( listener ) ; } catch ( java.lang.Exception e ) { android.util.Log.e ( com.android.server.LocationManagerService.TAG , "mGpsStatusProvider.removeGpsStatusListener failed" , e ) ; } } }
Source:
public void exiting ( java.lang.String sourceClass , java.lang.String sourceMethod , java.lang.Object result ) { if ( ( java.util.logging.Level.FINER.intValue ( ) ) < ( levelValue ) ) { return ; } java.lang.Object [ ] params = new java.lang.Object [ ] { result } ; logp ( java.util.logging.Level.FINER , sourceClass , sourceMethod , "RETURN {0}" , result ) ; }

Target:
public void throwing ( java.lang.String sourceClass , java.lang.String sourceMethod , java.lang.Throwable thrown ) { if ( ! ( isLoggable ( java.util.logging.Level.FINER ) ) ) { return ; } java.util.logging.LogRecord lr = new java.util.logging.LogRecord ( java.util.logging.Level.FINER , "THROW" ) ; lr.setSourceClassName ( sourceClass ) ; lr.setSourceMethodName ( sourceMethod ) ; lr.setThrown ( thrown ) ; doLog ( lr ) ; }
Source:
private void addElement ( @ javax.annotation.Nonnull com.android.jack.ir.ast.JStatement statement , @ javax.annotation.Nonnull com.android.jack.ir.ast.cfg.JBasicBlockElement element ) { assert ! ( sealed ) ; this . elements.put ( element , statement ) ; this . block.appendElement ( element ) ; this . sealed = element.isTerminal ( ) ; }

Target:
private void addElement ( @ javax.annotation.Nonnull com.android.jack.ir.ast.JStatement statement , @ javax.annotation.Nonnull com.android.jack.ir.ast.cfg.JBasicBlockElement element ) { assert ! ( sealed ) ; this . elements.put ( element , statement ) ; this . block.appendElement ( element ) ; this . sealed = ( element.isTerminal ( ) ) && ( ! ( element instanceof com.android.jack.ir.ast.cfg.JCaseBlockElement ) ) ; }
Source:
public void testDefaultKeystore ( ) { java.lang.String type = java.security.KeyStore.getDefaultType ( ) ; assertEquals ( "Default keystore type must be Bouncy Castle" , "BKS" , type ) ; try { java.security.KeyStore store = java.security.KeyStore.getInstance ( java.security.KeyStore.getDefaultType ( ) ) ; assertNotNull ( "Keystore must not be null" , store ) ; } catch ( java.lang.Exception ex ) { throw new java.lang.RuntimeException ( ex ) ; } try { java.security.KeyStore store = java.security.KeyStore.getInstance ( "BKS" ) ; assertNotNull ( "Keystore must not be null" , store ) ; } catch ( java.lang.Exception ex ) { throw new java.lang.RuntimeException ( ex ) ; } }

Target:
public void testDefaultKeystore ( ) { java.lang.String type = java.security.KeyStore.getDefaultType ( ) ; assertEquals ( StandardNames.KEY_STORE_ALGORITHM , type ) ; try { java.security.KeyStore store = java.security.KeyStore.getInstance ( java.security.KeyStore.getDefaultType ( ) ) ; assertNotNull ( "Keystore must not be null" , store ) ; } catch ( java.lang.Exception ex ) { throw new java.lang.RuntimeException ( ex ) ; } try { java.security.KeyStore store = java.security.KeyStore.getInstance ( StandardNames.KEY_STORE_ALGORITHM ) ; assertNotNull ( "Keystore must not be null" , store ) ; } catch ( java.lang.Exception ex ) { throw new java.lang.RuntimeException ( ex ) ; } }
Source:
public static void main ( java.lang.String [ ] args ) { if ( ( args.length ) == 0 ) { args = new java.lang.String [ ] { "com.android.ahat.DiffTest" , "com.android.ahat.InstanceTest" , "com.android.ahat.ObjectHandlerTest" , "com.android.ahat.OverviewHandlerTest" , "com.android.ahat.PerformanceTest" , "com.android.ahat.RootedHandlerTest" , "com.android.ahat.QueryTest" , "com.android.ahat.SiteHandlerTest" } ; } org.junit.runner.JUnitCore.main ( args ) ; }

Target:
public static void main ( java.lang.String [ ] args ) { if ( ( args.length ) == 0 ) { args = new java.lang.String [ ] { "com.android.ahat.DiffTest" , "com.android.ahat.InstanceTest" , "com.android.ahat.NativeAllocationTest" , "com.android.ahat.ObjectHandlerTest" , "com.android.ahat.OverviewHandlerTest" , "com.android.ahat.PerformanceTest" , "com.android.ahat.RootedHandlerTest" , "com.android.ahat.QueryTest" , "com.android.ahat.SiteHandlerTest" } ; } org.junit.runner.JUnitCore.main ( args ) ; }
Source:
private boolean _isProviderEnabledLocked ( java.lang.String provider ) { checkPermissionsSafe ( provider , null ) ; com.android.server.location.LocationProviderInterface p = mProvidersByName.get ( provider ) ; if ( p == null ) { return false ; } return isAllowedBySettingsLocked ( provider ) ; }

Target:
public boolean isProviderEnabled ( java.lang.String provider ) { checkResolutionLevelIsSufficientForProviderUse ( getCallerAllowedResolutionLevel ( ) , provider ) ; if ( LocationManager.FUSED_PROVIDER.equals ( provider ) ) return false ; long identity = android.os.Binder.clearCallingIdentity ( ) ; try { synchronized ( mLock ) { com.android.server.location.LocationProviderInterface p = mProvidersByName.get ( provider ) ; if ( p == null ) return false ; return isAllowedBySettingsLocked ( provider , mCurrentUserId ) ; } } finally { android.os.Binder.restoreCallingIdentity ( identity ) ; } }
Source:
public java.lang.String getHttpMethod ( com.google.gct.intellij.endpoints.validation.PsiMethod psiMethod ) { com.google.gct.intellij.endpoints.validation.PsiModifierList modifierList = psiMethod.getModifierList ( ) ; java.lang.String httpMethod = null ; for ( com.google.gct.intellij.endpoints.validation.PsiAnnotation annotation : modifierList.getAnnotations ( ) ) { try { httpMethod = getAttributeFromAnnotation ( annotation , GctConstants.APP_ENGINE_ANNOTATION_API_METHOD , "httpMethod" ) ; } catch ( com.google.gct.intellij.endpoints.validation.InvalidAnnotationException e ) { } catch ( com.google.gct.intellij.endpoints.validation.AttributeDoesNotExistException e ) { break ; } if ( httpMethod != null ) { if ( ! ( httpMethod.isEmpty ( ) ) ) { return httpMethod ; } } } return getDefaultHttpMethod ( psiMethod ) ; }

Target:
public java.lang.String getHttpMethod ( com.google.gct.idea.appengine.validation.PsiMethod psiMethod ) { com.google.gct.idea.appengine.validation.PsiModifierList modifierList = psiMethod.getModifierList ( ) ; java.lang.String httpMethod = null ; for ( com.google.gct.idea.appengine.validation.PsiAnnotation annotation : modifierList.getAnnotations ( ) ) { try { httpMethod = getAttributeFromAnnotation ( annotation , GctConstants.APP_ENGINE_ANNOTATION_API_METHOD , "httpMethod" ) ; } catch ( com.google.gct.idea.appengine.validation.InvalidAnnotationException e ) { } catch ( com.google.gct.idea.appengine.validation.AttributeDoesNotExistException e ) { break ; } if ( httpMethod != null ) { if ( ! ( httpMethod.isEmpty ( ) ) ) { return httpMethod ; } } } return getDefaultHttpMethod ( psiMethod ) ; }
Source:
private void fillInProcMemInfo ( com.android.server.am.ProcessRecord app , android.app.ActivityManager.RunningAppProcessInfo outInfo ) { outInfo.pid = app.pid ; outInfo.uid = app.info.uid ; if ( ( mHeavyWeightProcess ) == app ) { outInfo.flags |= ActivityManager.RunningAppProcessInfo.FLAG_CANT_SAVE_STATE ; } if ( app.persistent ) { outInfo.flags |= ActivityManager.RunningAppProcessInfo.FLAG_PERSISTENT ; } outInfo.lastTrimLevel = app.trimMemoryLevel ; int adj = app.curAdj ; outInfo.importance = com.android.server.am.ActivityManagerService.oomAdjToImportance ( adj , outInfo ) ; outInfo.importanceReasonCode = app.adjTypeCode ; }

Target:
private void fillInProcMemInfo ( com.android.server.am.ProcessRecord app , android.app.ActivityManager.RunningAppProcessInfo outInfo ) { outInfo.pid = app.pid ; outInfo.uid = app.info.uid ; if ( ( mHeavyWeightProcess ) == app ) { outInfo.flags |= ActivityManager.RunningAppProcessInfo.FLAG_CANT_SAVE_STATE ; } if ( app.persistent ) { outInfo.flags |= ActivityManager.RunningAppProcessInfo.FLAG_PERSISTENT ; } if ( app.hasActivities ) { outInfo.flags |= ActivityManager.RunningAppProcessInfo.FLAG_HAS_ACTIVITIES ; } outInfo.lastTrimLevel = app.trimMemoryLevel ; int adj = app.curAdj ; outInfo.importance = com.android.server.am.ActivityManagerService.oomAdjToImportance ( adj , outInfo ) ; outInfo.importanceReasonCode = app.adjTypeCode ; }
Source:
public static boolean getBoolean ( java.lang.String key , boolean def ) { if ( ( key.length ( ) ) > ( android.os.SystemProperties.PROP_NAME_MAX ) ) { throw new java.lang.IllegalArgumentException ( ( "key.length > " + ( android.os.SystemProperties.PROP_NAME_MAX ) ) ) ; } return android.os.SystemProperties.native_get_boolean ( key , def ) ; }

Target:
public static boolean getBoolean ( java.lang.String key , boolean def ) { if ( ( key.length ( ) ) > ( android.os.SystemProperties.PROP_NAME_MAX ) ) { throw new java.lang.IllegalArgumentException ( ( "key.length > " + ( android.os.SystemProperties.PROP_NAME_MAX ) ) ) ; } if ( android.os.SystemProperties.TRACK_KEY_ACCESS ) android.os.SystemProperties.onKeyAccess ( key ) ; return android.os.SystemProperties.native_get_boolean ( key , def ) ; }
Source:
protected boolean assertNotEquals ( java.lang.String message , java.lang.Object expected , java.lang.Object actual ) { boolean result = ! ( expected == null ? actual == null : expected.equals ( actual ) ) ; return handleAssert ( result , message , stringFor ( expected ) , stringFor ( actual ) , "not equal to" , true ) ; }

Target:
protected static boolean assertNotEquals ( java.lang.String message , java.lang.Object expected , java.lang.Object actual ) { boolean result = ! ( expected == null ? actual == null : expected.equals ( actual ) ) ; return com.ibm.icu.dev.test.TestFmwk.handleAssert ( result , message , com.ibm.icu.dev.test.TestFmwk.stringFor ( expected ) , com.ibm.icu.dev.test.TestFmwk.stringFor ( actual ) , "not equal to" , true ) ; }
Source:
public void linkNativeLibraryDirectory ( java.lang.String uuid , java.lang.String dataPath , java.lang.String nativeLibPath32 , int userId ) throws com.android.internal.os.InstallerConnection.InstallerException { mInstaller.execute ( "linklib" , uuid , dataPath , nativeLibPath32 , userId ) ; }

Target:
public void linkNativeLibraryDirectory ( java.lang.String uuid , java.lang.String packageName , java.lang.String nativeLibPath32 , int userId ) throws com.android.internal.os.InstallerConnection.InstallerException { checkLock ( ) ; try { mInstalld.linkNativeLibraryDirectory ( uuid , packageName , nativeLibPath32 , userId ) ; } catch ( android.os.RemoteException | android.os.ServiceSpecificException e ) { throw new com.android.internal.os.InstallerConnection.InstallerException ( e.getMessage ( ) ) ; } }
Source:
public java.lang.String getCdmaMdn ( int subId ) { enforceModifyPermissionOrCarrierPrivilege ( subId ) ; final com.android.internal.telephony.Phone phone = getPhone ( subId ) ; if ( ( ( mPhone.getPhoneType ( ) ) == ( com.android.internal.telephony.PhoneConstants.PHONE_TYPE_CDMA ) ) && ( phone != null ) ) { return phone.getLine1Number ( ) ; } else { return null ; } }

Target:
public java.lang.String getCdmaMdn ( int subId ) { com.android.internal.telephony.TelephonyPermissions.enforceCallingOrSelfModifyPermissionOrCarrierPrivilege ( mApp , subId , "getCdmaMdn" ) ; final com.android.internal.telephony.Phone phone = getPhone ( subId ) ; if ( ( ( mPhone.getPhoneType ( ) ) == ( com.android.internal.telephony.PhoneConstants.PHONE_TYPE_CDMA ) ) && ( phone != null ) ) { return phone.getLine1Number ( ) ; } else { return null ; } }
Source:
public void onUnavailable ( ) { com.googlecode.android_scripting.Log.d ( "NetworkCallback onUnavailable" ) ; if ( ( ( mEvents ) & ( com.googlecode.android_scripting.facade.ConnectivityManagerFacade.NetworkCallback.EVENT_UNAVAILABLE ) ) == ( com.googlecode.android_scripting.facade.ConnectivityManagerFacade.NetworkCallback.EVENT_UNAVAILABLE ) ) { mEventFacade.postEvent ( ConnectivityConstants.EventNetworkCallback , new com.googlecode.android_scripting.facade.ConnectivityEvents.NetworkCallbackEventBase ( mId , com.googlecode.android_scripting.facade.ConnectivityManagerFacade.getNetworkCallbackEventString ( com.googlecode.android_scripting.facade.ConnectivityManagerFacade.NetworkCallback.EVENT_UNAVAILABLE ) ) ) ; } }

Target:
public void onUnavailable ( ) { com.googlecode.android_scripting.Log.d ( "NetworkCallback onUnavailable" ) ; if ( ( ( mEvents ) & ( com.googlecode.android_scripting.facade.ConnectivityManagerFacade.NetworkCallback.EVENT_UNAVAILABLE ) ) == ( com.googlecode.android_scripting.facade.ConnectivityManagerFacade.NetworkCallback.EVENT_UNAVAILABLE ) ) { mEventFacade.postEvent ( TelephonyConstants.EventNetworkCallback , new com.googlecode.android_scripting.facade.telephony.TelephonyEvents.NetworkCallbackEvent ( mId , com.googlecode.android_scripting.facade.ConnectivityManagerFacade.getNetworkCallbackEventString ( com.googlecode.android_scripting.facade.ConnectivityManagerFacade.NetworkCallback.EVENT_UNAVAILABLE ) , TelephonyEvents.NetworkCallbackEvent.INVALID_VALUE , TelephonyEvents.NetworkCallbackEvent.INVALID_VALUE ) ) ; } }
Source:
private int getApiLevel ( ) { if ( ( mApiLevel ) > 0 ) { return mApiLevel ; } try { java.lang.String buildApi = getProperty ( com.android.ddmlib.PROP_BUILD_API_LEVEL ) ; mApiLevel = ( buildApi == null ) ? - 1 : java.lang.Integer.parseInt ( buildApi ) ; return mApiLevel ; } catch ( java.lang.Exception e ) { return - 1 ; } }

Target:
public int getApiLevel ( ) { if ( ( mApiLevel ) > 0 ) { return mApiLevel ; } java.lang.String buildApi = getProperty ( com.android.ddmlib.PROP_BUILD_API_LEVEL ) ; if ( buildApi == null ) { throw new java.lang.IllegalStateException ( "Unexpected error: Device does not have a build API level." ) ; } try { mApiLevel = java.lang.Integer.parseInt ( buildApi ) ; return mApiLevel ; } catch ( java.lang.NumberFormatException e ) { throw new java.lang.IllegalStateException ( ( ( "Unexpected error: Build API level '" + buildApi ) + "' is not an integer: " ) ) ; } }
Source:
private synchronized void connectionStateChanged ( android.bluetooth.BluetoothDevice device , int fromState , int toState ) { }

Target:
private synchronized void connectionStateChanged ( android.bluetooth.BluetoothDevice device , int fromState , int toState ) { if ( ( device == null ) || ( fromState == toState ) ) { return ; } if ( toState == ( android.bluetooth.BluetoothProfile.STATE_DISCONNECTED ) ) { int bondState = mAdapterService.getBondState ( device ) ; if ( bondState == ( android.bluetooth.BluetoothDevice.BOND_NONE ) ) { removeStateMachine ( device ) ; } } }
Source:
protected static void processCRLI ( java.util.Date validDate , java.security.cert.X509CRL deltacrl , java.lang.Object cert , org.bouncycastle.jce.provider.CertStatus certStatus , org.bouncycastle.x509.ExtendedPKIXParameters pkixParams ) throws org.bouncycastle.jce.provider.AnnotatedException { if ( ( pkixParams.isUseDeltasEnabled ( ) ) && ( deltacrl != null ) ) { org.bouncycastle.jce.provider.CertPathValidatorUtilities.getCertStatus ( validDate , deltacrl , cert , certStatus ) ; } }

Target:
protected static void processCRLI ( java.util.Date validDate , java.security.cert.X509CRL deltacrl , java.lang.Object cert , org.bouncycastle.jce.provider.CertStatus certStatus , org.bouncycastle.jcajce.PKIXExtendedParameters pkixParams ) throws org.bouncycastle.jce.provider.AnnotatedException { if ( ( pkixParams.isUseDeltasEnabled ( ) ) && ( deltacrl != null ) ) { org.bouncycastle.jce.provider.CertPathValidatorUtilities.getCertStatus ( validDate , deltacrl , cert , certStatus ) ; } }
Source:
public void setScope ( @ com.android.annotations.NonNull com.android.build.gradle.internal.scope.VariantScope scope ) { this . scope = scope ; }

Target:
private static < T > java.util.Set < T > removeAllNullEntries ( java.util.Collection < T > input ) { java.util.HashSet < T > output = new java.util.HashSet < T > ( ) ; for ( T element : input ) { if ( element != null ) { output.add ( element ) ; } } return output ; }
Source:
public void testSingleOutput ( ) { com.android.build.VariantOutput match ; java.util.List < com.android.build.VariantOutput > list = com.google.common.collect.Lists.newArrayList ( ) ; list.add ( ( match = com.android.ide.common.build.SplitOutputMatcherTest.getUniversalOutput ( 1 ) ) ) ; java.util.List < com.android.build.OutputFile > result = com.android.ide.common.build.SplitOutputMatcherTest.computeBestOutput ( list , 160 , "foo" ) ; assertEquals ( 1 , result.size ( ) ) ; assertEquals ( match.getMainOutputFile ( ) , result.get ( 0 ) ) ; }

Target:
public void testSingleOutput ( ) throws com.android.ide.common.process.ProcessException { com.android.build.VariantOutput match ; java.util.List < com.android.build.VariantOutput > list = com.google.common.collect.Lists.newArrayList ( ) ; list.add ( ( match = com.android.ide.common.build.SplitOutputMatcherTest.getUniversalOutput ( 1 ) ) ) ; java.util.List < java.io.File > result = com.android.ide.common.build.SplitOutputMatcherTest.computeBestOutput ( list , 160 , "foo" ) ; assertEquals ( 1 , result.size ( ) ) ; assertEquals ( match.getMainOutputFile ( ) . getOutputFile ( ) , result.get ( 0 ) ) ; }
Source:
public void onInitializeAccessibilityEvent ( final android.view.accessibility.AccessibilityEvent event ) { mFactory.startYourEngines ( false ) ; if ( checkNeedsPost ( ) ) { runVoidTaskOnUiThreadBlocking ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { onInitializeAccessibilityEvent ( event ) ; } } ) ; return ; } mAwContents.onInitializeAccessibilityEvent ( event ) ; }

Target:
public boolean performAccessibilityAction ( final int action , final android.os.Bundle arguments ) { mFactory.startYourEngines ( false ) ; if ( checkNeedsPost ( ) ) { boolean ret = runOnUiThreadBlocking ( new java.util.concurrent.Callable < java.lang.Boolean > ( ) { @ java.lang.Override public java.lang.Boolean call ( ) { return performAccessibilityAction ( action , arguments ) ; } } ) ; return ret ; } if ( mAwContents.supportsAccessibilityAction ( action ) ) { return mAwContents.performAccessibilityAction ( action , arguments ) ; } return mWebViewPrivate.super_performAccessibilityAction ( action , arguments ) ; }
Source:
public void forEach ( android.renderscript.Allocation aout , android.renderscript.Script.LaunchOptions opt ) { forEach ( 0 , ( ( android.renderscript.Allocation ) ( null ) ) , aout , null , opt ) ; }

Target:
public void forEach ( android.renderscript.Allocation aout , android.renderscript.Script.LaunchOptions opt ) { if ( ( aout.getType ( ) . getY ( ) ) == 0 ) { throw new android.renderscript.RSIllegalArgumentException ( "Output is a 1D Allocation" ) ; } forEach ( 0 , ( ( android.renderscript.Allocation ) ( null ) ) , aout , null , opt ) ; }
Source:
public void getSimIdentityEapSim ( ) { android.telephony.TelephonyManager tm = mock ( android.telephony.TelephonyManager.class ) ; when ( tm.getSubscriberId ( ) ) . thenReturn ( "3214561234567890" ) ; when ( tm.getSimState ( ) ) . thenReturn ( TelephonyManager.SIM_STATE_READY ) ; when ( tm.getSimOperator ( ) ) . thenReturn ( "321456" ) ; assertEquals ( "13214561234567890@wlan.mnc456.mcc321.3gppnetwork.org" , com.android.server.wifi.util.TelephonyUtil.getSimIdentity ( tm , WifiEnterpriseConfig.Eap.SIM ) ) ; }

Target:
public void getSimIdentityEapSim ( ) { android.telephony.TelephonyManager tm = mock ( android.telephony.TelephonyManager.class ) ; when ( tm.getSubscriberId ( ) ) . thenReturn ( "3214561234567890" ) ; when ( tm.getSimState ( ) ) . thenReturn ( TelephonyManager.SIM_STATE_READY ) ; when ( tm.getSimOperator ( ) ) . thenReturn ( "321456" ) ; assertEquals ( "13214561234567890@wlan.mnc456.mcc321.3gppnetwork.org" , com.android.server.wifi.util.TelephonyUtil.getSimIdentity ( tm , com.android.server.wifi.WifiConfigurationTestUtil.createEapNetwork ( WifiEnterpriseConfig.Eap.SIM , WifiEnterpriseConfig.Phase2.NONE ) ) ) ; assertEquals ( "13214561234567890@wlan.mnc456.mcc321.3gppnetwork.org" , com.android.server.wifi.util.TelephonyUtil.getSimIdentity ( tm , com.android.server.wifi.WifiConfigurationTestUtil.createEapNetwork ( WifiEnterpriseConfig.Eap.PEAP , WifiEnterpriseConfig.Phase2.SIM ) ) ) ; }
Source:
private void testWithMargins ( ) { doLayoutParamTest ( ( android.view.WindowManager.LayoutParams params ) -> { params.gravity = ( android.view.Gravity.LEFT ) | ( android.view.Gravity.TOP ) ; params.horizontalMargin = 0.25F ; params.verticalMargin = 0.35F ; params.width = 200 ; params.height = 200 ; params.x = 0 ; params.y = 0 ; } ) ; }

Target:
private void testWithMargins ( ) { doLayoutParamTest ( ( android.view.WindowManager.LayoutParams params ) -> { params.gravity = ( android.view.Gravity.LEFT ) | ( android.view.Gravity.TOP ) ; params.horizontalMargin = 0.25F ; params.verticalMargin = 0.25F ; params.width = ( 200 - ( mOutsets.left ) ) - ( mOutsets.right ) ; params.height = ( 200 - ( mOutsets.bottom ) ) - ( mOutsets.top ) ; params.x = 0 ; params.y = 0 ; } ) ; }
Source:
void regularScanTimeout ( ) { for ( com.android.bluetooth.gatt.ScanClient client : mRegularScanClients ) { if ( ( ! ( isOpportunisticScanClient ( client ) ) ) && ( ! ( isFirstMatchScanClient ( client ) ) ) ) { logd ( ( "clientIf set to scan opportunisticly: " + ( client.clientIf ) ) ) ; setOpportunisticScanClient ( client ) ; client.stats.setScanTimeout ( ) ; } } configureRegularScanParams ( ) ; if ( ( numRegularScanClients ( ) ) == 0 ) { logd ( "stop scan" ) ; gattClientScanNative ( false ) ; } }

Target:
private boolean isExemptFromScanDowngrade ( com.android.bluetooth.gatt.ScanClient client ) { return ( ( isOpportunisticScanClient ( client ) ) || ( isFirstMatchScanClient ( client ) ) ) || ( ! ( shouldUseAllPassFilter ( client ) ) ) ; }
Source:
public void testSingleBound ( ) throws java.lang.Exception { java.lang.Class < ? extends org.apache.harmony.tests.java.lang.reflect.TypeVariableTest.G > clazz = org.apache.harmony.tests.java.lang.reflect.TypeVariableTest.G.class ; java.lang.reflect.TypeVariable [ ] typeParameters = clazz.getTypeParameters ( ) ; java.lang.reflect.TypeVariable < java.lang.Class > typeVariable = typeParameters [ 0 ] ; java.lang.reflect.Type [ ] bounds = typeVariable.getBounds ( ) ; assertLenghtOne ( bounds ) ; assertEquals ( java.lang.Number.class , bounds [ 0 ] ) ; }

Target:
public void testSingleBound ( ) throws java.lang.Exception { java.lang.Class < ? extends org.apache.harmony.tests.java.lang.reflect.TypeVariableTest.G > clazz = org.apache.harmony.tests.java.lang.reflect.TypeVariableTest.G.class ; java.lang.reflect.TypeVariable [ ] typeParameters = clazz.getTypeParameters ( ) ; java.lang.reflect.TypeVariable < java.lang.Class > typeVariable = typeParameters [ 0 ] ; java.lang.reflect.Type [ ] bounds = typeVariable.getBounds ( ) ; assertLenghtOne ( bounds ) ; assertEquals ( java.lang.Number.class , bounds [ 0 ] ) ; assertEquals ( "T" , typeVariable.toString ( ) ) ; assertEquals ( "T" , typeVariable.getTypeName ( ) ) ; }
Source:
public static void main ( java.lang.String [ ] args ) throws java.lang.Throwable { Main.testThrowException ( ) ; Main.testDropArguments ( ) ; Main.testCatchException ( ) ; Main.testGuardWithTest ( ) ; Main.testArrayElementGetter ( ) ; Main.testArrayElementSetter ( ) ; Main.testIdentity ( ) ; Main.testConstant ( ) ; }

Target:
public static void main ( java.lang.String [ ] args ) throws java.lang.Throwable { Main.testThrowException ( ) ; Main.testDropArguments ( ) ; Main.testCatchException ( ) ; Main.testGuardWithTest ( ) ; Main.testArrayElementGetter ( ) ; Main.testArrayElementSetter ( ) ; Main.testIdentity ( ) ; Main.testConstant ( ) ; Main.testBindTo ( ) ; }
Source:
private void unregisterEvent ( int event , int slotId ) { switch ( event ) { case com.android.internal.telephony.cat.CatCmdMessage.SetupEventListConstants.IDLE_SCREEN_AVAILABLE_EVENT : unregisterProcessObserver ( AppInterface.CommandType.SET_UP_EVENT_LIST , slotId ) ; break ; case com.android.internal.telephony.cat.CatCmdMessage.SetupEventListConstants.LANGUAGE_SELECTION_EVENT : default : break ; } }

Target:
private void registerEvents ( int slotId ) { if ( ( mStkContext [ slotId ] . mSetupEventListSettings ) == null ) { return ; } for ( int event : mStkContext [ slotId ] . mSetupEventListSettings.eventList ) { switch ( event ) { case com.android.internal.telephony.cat.CatCmdMessage.SetupEventListConstants.IDLE_SCREEN_AVAILABLE_EVENT : registerProcessObserver ( ) ; break ; case com.android.internal.telephony.cat.CatCmdMessage.SetupEventListConstants.LANGUAGE_SELECTION_EVENT : registerLocaleChangeReceiver ( ) ; break ; default : break ; } } }
Source:
private void updatePrimaryCallContext ( com.android.incallui.call.DialerCall call ) { if ( call == null ) { primaryCall = null ; prevCallState = com.android.incallui.call.DialerCall.State.INVALID ; wasVideoCall = false ; } else { primaryCall = call ; prevCallState = call.getState ( ) ; wasVideoCall = call.isVideoCall ( ) ; } }

Target:
private void updatePrimaryCallContext ( com.android.incallui.call.DialerCall call ) { if ( call == null ) { primaryCall = null ; prevCallState = com.android.incallui.call.state.DialerCallState.INVALID ; wasVideoCall = false ; } else { primaryCall = call ; prevCallState = call.getState ( ) ; wasVideoCall = call.isVideoCall ( ) ; } }
Source:
public void visibleAreaChanged ( com.intellij.execution.impl.VisibleAreaEvent e ) { java.awt.Rectangle oldR = e.getOldRectangle ( ) ; if ( ( ( ( oldR != null ) && ( ( oldR.height ) <= 0 ) ) && ( ( e.getNewRectangle ( ) . height ) > 0 ) ) && ( ! ( shouldPreserveCurrentVisualArea ( ) ) ) ) { scrollToEnd ( ) ; } }

Target:
public void visibleAreaChanged ( com.intellij.execution.impl.VisibleAreaEvent e ) { java.awt.Rectangle oldR = e.getOldRectangle ( ) ; if ( ( ( ( oldR != null ) && ( ( oldR.height ) <= 0 ) ) && ( ( e.getNewRectangle ( ) . height ) > 0 ) ) && ( isStickingToEnd ( ) ) ) { scrollToEnd ( ) ; } }
Source:
public void addJavascriptInterface ( final java.lang.Object obj , final java.lang.String interfaceName ) { if ( checkNeedsPost ( ) ) { mRunQueue.addTask ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { addJavascriptInterface ( obj , interfaceName ) ; } } ) ; return ; } java.lang.Class < ? extends java.lang.annotation.Annotation > requiredAnnotation = null ; if ( ( mAppTargetSdkVersion ) >= ( Build.VERSION_CODES.JELLY_BEAN_MR1 ) ) { requiredAnnotation = android.webkit.JavascriptInterface.class ; } mAwContents.addPossiblyUnsafeJavascriptInterface ( obj , interfaceName , requiredAnnotation ) ; }

Target:
public void removeJavascriptInterface ( final java.lang.String interfaceName ) { if ( checkNeedsPost ( ) ) { mRunQueue.addTask ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { removeJavascriptInterface ( interfaceName ) ; } } ) ; return ; } mAwContents.removeJavascriptInterface ( interfaceName ) ; }
Source:
public synchronized void acknowledgeLastIncomingGsmSms ( boolean success , int cause , android.os.Message response ) { android.util.Log.d ( com.android.internal.telephony.gsm.UsimDataDownloadCommands.TAG , ( ( ( "acknowledgeLastIncomingGsmSms: success=" + success ) + ", cause=" ) + cause ) ) ; junit.framework.Assert.assertTrue ( "unexpected call to acknowledge SMS" , mExpectingAcknowledgeGsmSms ) ; junit.framework.Assert.assertEquals ( mExpectingAcknowledgeGsmSmsSuccess , success ) ; junit.framework.Assert.assertEquals ( mExpectingAcknowledgeGsmSmsFailureCause , cause ) ; mExpectingAcknowledgeGsmSms = false ; if ( response != null ) { android.os.AsyncResult.forMessage ( response ) ; response.sendToTarget ( ) ; } notifyAll ( ) ; }

Target:
public synchronized void acknowledgeLastIncomingGsmSms ( boolean success , int cause , android.os.Message response ) { android.telephony.Rlog.d ( com.android.internal.telephony.gsm.UsimDataDownloadCommands.TAG , ( ( ( "acknowledgeLastIncomingGsmSms: success=" + success ) + ", cause=" ) + cause ) ) ; junit.framework.Assert.assertTrue ( "unexpected call to acknowledge SMS" , mExpectingAcknowledgeGsmSms ) ; junit.framework.Assert.assertEquals ( mExpectingAcknowledgeGsmSmsSuccess , success ) ; junit.framework.Assert.assertEquals ( mExpectingAcknowledgeGsmSmsFailureCause , cause ) ; mExpectingAcknowledgeGsmSms = false ; if ( response != null ) { android.os.AsyncResult.forMessage ( response ) ; response.sendToTarget ( ) ; } notifyAll ( ) ; }
Source:
protected android.graphics.Bitmap compute ( android.graphics.Bitmap inputImage , com.android.rs.test.BlurStack blurStack ) { initializeScriptAndBuffers ( inputImage , blurStack.getLayerInfo ( blurStack.getFocusLayer ( ) ) ) ; if ( ! ( processLayersFromBackToFocus ( blurStack ) ) ) { return null ; } if ( ! ( processLayersFromFrontToFocus ( blurStack ) ) ) { return null ; } android.graphics.Bitmap resultImage = extractResultImage ( ) ; renderScript.finish ( ) ; android.util.Log.d ( com.android.rs.test.RefocusFilter.TAG , "filterAndBlendAllLayersUsingKernel is finished" ) ; return resultImage ; }

Target:
protected android.graphics.Bitmap compute ( android.graphics.Bitmap inputImage , com.android.rs.refocus.BlurStack blurStack ) { initializeScriptAndBuffers ( inputImage , blurStack.getLayerInfo ( blurStack.getFocusLayer ( ) ) ) ; if ( ! ( processLayersFromBackToFocus ( blurStack ) ) ) { return null ; } if ( ! ( processLayersFromFrontToFocus ( blurStack ) ) ) { return null ; } android.graphics.Bitmap resultImage = extractResultImage ( ) ; renderScript.finish ( ) ; android.util.Log.d ( com.android.rs.refocus.RefocusFilter.TAG , "filterAndBlendAllLayersUsingKernel is finished" ) ; return resultImage ; }
Source:
private void stopDhcpServer ( java.lang.String intf ) { try { mNwService.stopTethering ( ) ; } catch ( java.lang.Exception e ) { loge ( ( "Error stopping Dhcp server" + e ) ) ; return ; } logd ( "Stopped Dhcp server" ) ; }

Target:
private void stopDhcpServer ( java.lang.String intf ) { try { for ( java.lang.String temp : mNwService.listTetheredInterfaces ( ) ) { logd ( ( "List all interfaces " + temp ) ) ; if ( ( temp.compareTo ( intf ) ) != 0 ) { logd ( "Found other tethering interface so keep tethering alive" ) ; mNwService.untetherInterface ( intf ) ; return ; } } mNwService.stopTethering ( ) ; } catch ( java.lang.Exception e ) { loge ( ( "Error stopping Dhcp server" + e ) ) ; return ; } logd ( "Stopped Dhcp server" ) ; }
Source:
public void remove ( ) { if ( ( lastRet ) == ( - 1 ) ) throw new java.lang.IllegalStateException ( ) ; synchronized ( this ) { checkForComodification ( ) ; this . remove ( lastRet ) ; expectedModCount = modCount ; } cursor = lastRet ; lastRet = - 1 ; }

Target:
public void remove ( ) { if ( ( lastRet ) == ( - 1 ) ) throw new java.lang.IllegalStateException ( ) ; synchronized ( this ) { checkForComodification ( ) ; this . remove ( lastRet ) ; expectedModCount = modCount ; ( limit ) -- ; } cursor = lastRet ; lastRet = - 1 ; }
Source:
private boolean extendsClass ( com.google.doclava.ClassInfo cl , java.lang.String ext ) { if ( cl.qualifiedName ( ) . equals ( ext ) ) { return true ; } if ( ( ( cl.mSuperclass ) != null ) && ( extendsClass ( cl.mSuperclass , ext ) ) ) { return true ; } return false ; }

Target:
public boolean extendsClass ( java.lang.String cl ) { if ( qualifiedName ( ) . equals ( cl ) ) { return true ; } if ( ( ( mSuperclass ) != null ) && ( mSuperclass.extendsClass ( cl ) ) ) { return true ; } return false ; }
Source:
public java.lang.String nvReadItem ( int itemID ) { enforceModifyPermissionOrCarrierPrivilege ( getDefaultSubscription ( ) ) ; if ( com.android.phone.PhoneInterfaceManager.DBG ) com.android.phone.PhoneInterfaceManager.log ( ( "nvReadItem: item " + itemID ) ) ; java.lang.String value = ( ( java.lang.String ) ( sendRequest ( com.android.phone.PhoneInterfaceManager.CMD_NV_READ_ITEM , itemID ) ) ) ; if ( com.android.phone.PhoneInterfaceManager.DBG ) com.android.phone.PhoneInterfaceManager.log ( ( ( ( ( "nvReadItem: item " + itemID ) + " is \"" ) + value ) + '"' ) ) ; return value ; }

Target:
public boolean nvResetConfig ( int resetType ) { com.android.internal.telephony.TelephonyPermissions.enforceCallingOrSelfModifyPermissionOrCarrierPrivilege ( mApp , getDefaultSubscription ( ) , "nvResetConfig" ) ; if ( com.android.phone.PhoneInterfaceManager.DBG ) com.android.phone.PhoneInterfaceManager.log ( ( "nvResetConfig: type " + resetType ) ) ; java.lang.Boolean success = ( ( java.lang.Boolean ) ( sendRequest ( com.android.phone.PhoneInterfaceManager.CMD_NV_RESET_CONFIG , resetType ) ) ) ; if ( com.android.phone.PhoneInterfaceManager.DBG ) com.android.phone.PhoneInterfaceManager.log ( ( ( ( "nvResetConfig: type " + resetType ) + ' ' ) + ( success ? "ok" : "fail" ) ) ) ; return success ; }
Source:
protected void runTest ( ) throws java.lang.Throwable { try { super . runTest ( ) ; } catch ( java.lang.RuntimeException e ) { if ( e.getMessage ( ) . startsWith ( "Test requires build-tools 22" ) ) { com.android.builder.png.NinePatchAsyncAaptProcessTest.sLogger.warning ( ( ( "Skipped " + ( this . getName ( ) ) ) + " as it requires build tools 22." ) ) ; } else { throw e ; } } }

Target:
public void run ( ) throws com.android.ide.common.internal.PngException , java.io.IOException { java.io.File outFile = com.android.builder.png.NinePatchAaptProcessorTestUtils.crunchFile ( mFile , com.android.builder.png.NinePatchAsyncAaptProcessTest.getCruncher ( ) ) ; com.android.builder.png.NinePatchAsyncAaptProcessTest.mSourceAndCrunchedFiles.put ( mFile , outFile ) ; }
Source:
void setProfileAutoConnectionPriority ( android.bluetooth.BluetoothDevice device , int profileId ) { if ( profileId == ( android.bluetooth.BluetoothProfile.HEADSET ) ) { com.android.bluetooth.hfp.HeadsetService hsService = com.android.bluetooth.hfp.HeadsetService.getHeadsetService ( ) ; java.util.List < android.bluetooth.BluetoothDevice > deviceList = hsService.getConnectedDevices ( ) ; if ( ( hsService != null ) && ( ( android.bluetooth.BluetoothProfile.PRIORITY_AUTO_CONNECT ) != ( hsService.getPriority ( device ) ) ) ) { adjustOtherHeadsetPriorities ( hsService , deviceList ) ; hsService.setPriority ( device , BluetoothProfile.PRIORITY_AUTO_CONNECT ) ; } } }

Target:
private void autoConnectPbapClient ( ) { com.android.bluetooth.pbapclient.PbapClientService pbapClientService = com.android.bluetooth.pbapclient.PbapClientService.getPbapClientService ( ) ; android.bluetooth.BluetoothDevice [ ] bondedDevices = getBondedDevices ( ) ; if ( ( bondedDevices == null ) || ( pbapClientService == null ) ) { return ; } for ( android.bluetooth.BluetoothDevice device : bondedDevices ) { if ( ( pbapClientService.getPriority ( device ) ) == ( android.bluetooth.BluetoothProfile.PRIORITY_AUTO_CONNECT ) ) { debugLog ( ( "autoConnectPbapClient() - Connecting PBAP Client with " + ( device.toString ( ) ) ) ) ; pbapClientService.connect ( device ) ; } } }
Source:
private void registerForStayAwakeModeChange ( android.os.Handler handler ) { android.database.ContentObserver contentObserver = new android.database.ContentObserver ( handler ) { @ java.lang.Override public void onChange ( boolean selfChange ) { readStayAwakeConditions ( ) ; } } ; mContext.getContentResolver ( ) . registerContentObserver ( Settings.Global.getUriFor ( Settings.Global.STAY_ON_WHILE_PLUGGED_IN ) , false , contentObserver ) ; }

Target:
private void registerForStayAwakeModeChange ( android.os.Handler handler ) { android.database.ContentObserver contentObserver = new android.database.ContentObserver ( handler ) { @ java.lang.Override public void onChange ( boolean selfChange ) { readStayAwakeConditions ( ) ; } } ; mFacade.registerContentObserver ( mContext , Settings.Global.getUriFor ( Settings.Global.STAY_ON_WHILE_PLUGGED_IN ) , false , contentObserver ) ; }
Source:
public java.util.List < com.android.tools.lint.client.api.JavaParser.ResolvedAnnotation > getAnnotations ( @ com.android.annotations.NonNull com.android.tools.lint.client.api.JavaParser.ResolvedAnnotation cls ) { com.android.tools.lint.ExternalAnnotationRepository.ClassInfo c = findClass ( cls ) ; if ( c == null ) { return null ; } return c.annotations ; }

Target:
public com.android.tools.lint.client.api.JavaParser.ResolvedAnnotation getAnnotation ( @ com.android.annotations.NonNull com.android.tools.lint.client.api.JavaParser.ResolvedClass cls , @ com.android.annotations.NonNull java.lang.String type ) { com.android.tools.lint.ExternalAnnotationRepository.ClassInfo c = findClass ( cls ) ; if ( c == null ) { return null ; } java.util.List < com.android.tools.lint.client.api.JavaParser.ResolvedAnnotation > annotations = c.getAnnotations ( ) ; if ( annotations != null ) { for ( com.android.tools.lint.client.api.JavaParser.ResolvedAnnotation annotation : annotations ) { if ( type.equals ( annotation.getSignature ( ) ) ) { return annotation ; } } } return null ; }
Source:
public int getCallState ( int subId ) { try { com.android.internal.telephony.ITelephony telephony = getITelephony ( ) ; if ( telephony == null ) return android.telephony.TelephonyManager.CALL_STATE_IDLE ; return telephony.getCallStateForSubscriber ( subId ) ; } catch ( android.os.RemoteException ex ) { return android.telephony.TelephonyManager.CALL_STATE_IDLE ; } catch ( java.lang.NullPointerException ex ) { return android.telephony.TelephonyManager.CALL_STATE_IDLE ; } }

Target:
public void enableVisualVoicemailSmsFilter ( int subId , android.telephony.VisualVoicemailSmsFilterSettings settings ) { if ( settings == null ) { throw new java.lang.IllegalArgumentException ( "Settings cannot be null" ) ; } try { com.android.internal.telephony.ITelephony telephony = getITelephony ( ) ; if ( telephony != null ) { telephony.enableVisualVoicemailSmsFilter ( mContext.getOpPackageName ( ) , subId , settings ) ; } } catch ( android.os.RemoteException ex ) { } catch ( java.lang.NullPointerException ex ) { } }
Source:
public void disconnectIndication ( int token , int disconnectType ) { android.util.Log.d ( com.android.bluetooth.sap.SapRilReceiver.TAG , ( ( ( "disconnectIndication: token " + token ) + " disconnectType " ) + disconnectType ) ) ; com.android.bluetooth.sap.SapMessage sapMessage = new com.android.bluetooth.sap.SapMessage ( SapMessage.ID_RIL_UNSOL_DISCONNECT_IND ) ; sapMessage.setDisconnectionType ( disconnectType ) ; sendSapMessage ( sapMessage ) ; }

Target:
public void disconnectIndication ( int token , int disconnectType ) { android.util.Log.d ( com.android.bluetooth.sap.SapRilReceiver.TAG , ( ( ( "disconnectIndication: token " + token ) + " disconnectType " ) + disconnectType ) ) ; com.android.bluetooth.sap.SapService.notifyUpdateWakeLock ( mSapServiceHandler ) ; com.android.bluetooth.sap.SapMessage sapMessage = new com.android.bluetooth.sap.SapMessage ( SapMessage.ID_RIL_UNSOL_DISCONNECT_IND ) ; sapMessage.setDisconnectionType ( disconnectType ) ; sendSapMessage ( sapMessage ) ; }
Source:
public void clientCertificateRequested ( byte [ ] keyTypes , byte [ ] [ ] asn1DerEncodedX500Principals ) { if ( org.apache.harmony.xnet.provider.jsse.NativeCryptoTest.DEBUG ) { java.lang.System.out.println ( ( ( ( ( ( ( "ssl=0x" + ( java.lang.Integer.toString ( sslNativePointer , 16 ) ) ) + " clientCertificateRequested" ) + " keyTypes=" ) + keyTypes ) + " asn1DerEncodedX500Principals=" ) + asn1DerEncodedX500Principals ) ) ; } this . keyTypes = keyTypes ; this . asn1DerEncodedX500Principals = asn1DerEncodedX500Principals ; this . clientCertificateRequestedCalled = true ; if ( ( hooks ) != null ) { hooks.clientCertificateRequested ( sslNativePointer ) ; } }

Target:
public void clientCertificateRequested ( byte [ ] keyTypes , byte [ ] [ ] asn1DerEncodedX500Principals ) { if ( org.apache.harmony.xnet.provider.jsse.NativeCryptoTest.DEBUG ) { java.lang.System.out.println ( ( ( ( ( ( ( "ssl=0x" + ( java.lang.Long.toString ( sslNativePointer , 16 ) ) ) + " clientCertificateRequested" ) + " keyTypes=" ) + keyTypes ) + " asn1DerEncodedX500Principals=" ) + asn1DerEncodedX500Principals ) ) ; } this . keyTypes = keyTypes ; this . asn1DerEncodedX500Principals = asn1DerEncodedX500Principals ; this . clientCertificateRequestedCalled = true ; if ( ( hooks ) != null ) { hooks.clientCertificateRequested ( sslNativePointer ) ; } }
Source:
public android.telephony.IccOpenLogicalChannelResponse iccOpenLogicalChannel ( int subId , java.lang.String AID ) { enforceModifyPermissionOrCarrierPrivilege ( subId ) ; if ( com.android.phone.PhoneInterfaceManager.DBG ) com.android.phone.PhoneInterfaceManager.log ( ( ( ( "iccOpenLogicalChannel: subId=" + subId ) + " aid=" ) + AID ) ) ; android.telephony.IccOpenLogicalChannelResponse response = ( ( android.telephony.IccOpenLogicalChannelResponse ) ( sendRequest ( com.android.phone.PhoneInterfaceManager.CMD_OPEN_CHANNEL , AID , subId ) ) ) ; if ( com.android.phone.PhoneInterfaceManager.DBG ) com.android.phone.PhoneInterfaceManager.log ( ( "iccOpenLogicalChannel: " + response ) ) ; return response ; }

Target:
public int getDataActivationState ( int subId , java.lang.String callingPackage ) { if ( ! ( canReadPhoneState ( callingPackage , "getDataActivationStateForSubscriber" ) ) ) { return android.telephony.TelephonyManager.SIM_ACTIVATION_STATE_UNKNOWN ; } final com.android.internal.telephony.Phone phone = getPhone ( subId ) ; if ( phone != null ) { return phone.getDataActivationState ( ) ; } else { return android.telephony.TelephonyManager.SIM_ACTIVATION_STATE_UNKNOWN ; } }
Source:
private boolean startIpReachabilityMonitor ( ) { try { mIpReachabilityMonitor = new android.net.ip.IpReachabilityMonitor ( mContext , mInterfaceName , new android.net.ip.IpReachabilityMonitor.Callback ( ) { @ java.lang.Override public void notifyLost ( java.net.InetAddress ip , java.lang.String logMsg ) { mCallback.onReachabilityLost ( logMsg ) ; } } , mMultinetworkPolicyTracker ) ; } catch ( java.lang.IllegalArgumentException iae ) { logError ( "IpReachabilityMonitor failure: %s" , iae ) ; mIpReachabilityMonitor = null ; } return ( mIpReachabilityMonitor ) != null ; }

Target:
private boolean startIpReachabilityMonitor ( ) { try { mIpReachabilityMonitor = new android.net.ip.IpReachabilityMonitor ( mContext , mInterfaceName , mLog , new android.net.ip.IpReachabilityMonitor.Callback ( ) { @ java.lang.Override public void notifyLost ( java.net.InetAddress ip , java.lang.String logMsg ) { mCallback.onReachabilityLost ( logMsg ) ; } } , mMultinetworkPolicyTracker ) ; } catch ( java.lang.IllegalArgumentException iae ) { logError ( "IpReachabilityMonitor failure: %s" , iae ) ; mIpReachabilityMonitor = null ; } return ( mIpReachabilityMonitor ) != null ; }
Source:
public void widgetSelected ( org.eclipse.swt.events.SelectionEvent e ) { if ( ( mCurrentDevice ) != null ) { com.android.ddmuilib.ScreenShotDialog dlg = new com.android.ddmuilib.ScreenShotDialog ( shell ) ; dlg.open ( mCurrentDevice ) ; } }

Target:
public void widgetSelected ( org.eclipse.swt.events.SelectionEvent e ) { if ( ( mCurrentDevice ) == null ) { return ; } if ( ( e.getSource ( ) ) == screenShotItem ) { com.android.ddmuilib.ScreenShotDialog dlg = new com.android.ddmuilib.ScreenShotDialog ( shell ) ; dlg.open ( mCurrentDevice ) ; } else if ( ( e.getSource ( ) ) == screenRecordItem ) { new com.android.ddmuilib.screenrecord.ScreenRecorderAction ( shell , mCurrentDevice ) . performAction ( ) ; } }
Source:
public void setVisualVoicemailEnabled ( java.lang.String callingPackage , android.telecom.PhoneAccountHandle phoneAccountHandle , boolean enabled ) { mAppOps.checkPackage ( android.os.Binder.getCallingUid ( ) , callingPackage ) ; if ( ! ( android.text.TextUtils.equals ( callingPackage , android.telecom.TelecomManager.from ( mPhone.getContext ( ) ) . getDefaultDialerPackage ( ) ) ) ) { enforceModifyPermissionOrCarrierPrivilege ( com.android.phone.PhoneUtils.getSubIdForPhoneAccountHandle ( phoneAccountHandle ) ) ; } com.android.phone.settings.VisualVoicemailSettingsUtil.setEnabled ( mPhone.getContext ( ) , phoneAccountHandle , enabled ) ; }

Target:
public void setVoicemailRingtoneUri ( java.lang.String callingPackage , android.telecom.PhoneAccountHandle phoneAccountHandle , android.net.Uri uri ) { mAppOps.checkPackage ( android.os.Binder.getCallingUid ( ) , callingPackage ) ; if ( ! ( android.text.TextUtils.equals ( callingPackage , android.telecom.TelecomManager.from ( mPhone.getContext ( ) ) . getDefaultDialerPackage ( ) ) ) ) { enforceModifyPermissionOrCarrierPrivilege ( com.android.phone.PhoneUtils.getSubIdForPhoneAccountHandle ( phoneAccountHandle ) ) ; } com.android.internal.telephony.Phone phone = com.android.phone.PhoneUtils.getPhoneForPhoneAccountHandle ( phoneAccountHandle ) ; if ( phone == null ) { phone = mPhone ; } com.android.phone.settings.VoicemailNotificationSettingsUtil.setRingtoneUri ( phone , uri ) ; }
Source:
void cleanup ( ) { logd ( "cleanup()" ) ; cleanupNative ( ) ; mAdvertisers.clear ( ) ; com.android.bluetooth.gatt.AdvertiseManager.sTempRegistrationId = - 1 ; if ( ( mHandler ) != null ) { mHandler.removeCallbacksAndMessages ( null ) ; android.os.Looper looper = mHandler.getLooper ( ) ; if ( looper != null ) { looper.quit ( ) ; } mHandler = null ; } }

Target:
void cleanup ( ) { if ( com.android.bluetooth.gatt.AdvertiseManager.DBG ) android.util.Log.d ( com.android.bluetooth.gatt.AdvertiseManager.TAG , "cleanup()" ) ; cleanupNative ( ) ; mAdvertisers.clear ( ) ; com.android.bluetooth.gatt.AdvertiseManager.sTempRegistrationId = - 1 ; if ( ( mHandler ) != null ) { mHandler.removeCallbacksAndMessages ( null ) ; android.os.Looper looper = mHandler.getLooper ( ) ; if ( looper != null ) { looper.quit ( ) ; } mHandler = null ; } }
Source:
android.telecom.cts.MockConnection verifyConnectionForIncomingCall ( int connectionIndex ) { try { if ( ! ( connectionService.lock.tryAcquire ( TestUtils.WAIT_FOR_STATE_CHANGE_TIMEOUT_MS , java.util.concurrent.TimeUnit.MILLISECONDS ) ) ) { fail ( "No outgoing call connection requested by Telecom" ) ; } } catch ( java.lang.InterruptedException e ) { android.util.Log.i ( android.telecom.cts.TAG , "Test interrupted!" ) ; } org.junit.Assert.assertThat ( "Telecom should create incoming connections for incoming calls" , connectionService.incomingConnections.size ( ) , org.hamcrest.CoreMatchers.not ( org.hamcrest.CoreMatchers.equalTo ( 0 ) ) ) ; android.telecom.cts.MockConnection connection = connectionService.incomingConnections.get ( connectionIndex ) ; setAndVerifyConnectionForIncomingCall ( connection ) ; return connection ; }

Target:
android.telecom.cts.MockConnection verifyConnectionForOutgoingCall ( int connectionIndex ) { try { if ( ! ( connectionService.lock.tryAcquire ( TestUtils.WAIT_FOR_STATE_CHANGE_TIMEOUT_MS , java.util.concurrent.TimeUnit.MILLISECONDS ) ) ) { fail ( "No outgoing call connection requested by Telecom" ) ; } } catch ( java.lang.InterruptedException e ) { android.util.Log.i ( android.telecom.cts.TestUtils.TAG , "Test interrupted!" ) ; } org.junit.Assert.assertThat ( "Telecom should create outgoing connection for outgoing call" , connectionService.outgoingConnections.size ( ) , org.hamcrest.CoreMatchers.not ( org.hamcrest.CoreMatchers.equalTo ( 0 ) ) ) ; android.telecom.cts.MockConnection connection = connectionService.outgoingConnections.get ( connectionIndex ) ; return connection ; }