[XPERIA X10 Android Development] alzbac:
part 2 for sound smali

>getResources()Landroid/content/res/Resources;

move-result-object v4

const/high16 v5, 0x7f06

invoke-virtual {v4, v5}, Landroid/content/res/Resources;->getBoolean(I)Z

move-result v4

if-nez v4, :cond_6

.line 169
iget-object v4, p0, Lcom/android/settings/SoundSettings;->mSoundSettings:Landroid/preference/PreferenceGroup;

iget-object v5, p0, Lcom/android/settings/SoundSettings;->mNotificationPulse:Landroid/preference/CheckBoxPreference;

invoke-virtual {v4, v5}, Landroid/preference/PreferenceGroup;->removePreference(Landroid/preference/Preference;)Z

.line 180
:goto_4
const-string v4, "ro.semc.xloud.supported"

invoke-static {v4, v6}, Landroid/os/SystemProperties;->getBoolean(Ljava/lang/String;Z)Z

move-result v4

if-eqz v4, :cond_8

.line 181
const-string v4, "xloud"

invoke-virtual {p0, v4}, Lcom/android/settings/SoundSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

move-result-object v4

check-cast v4, Landroid/preference/CheckBoxPreference;

iput-object v4, p0, Lcom/android/settings/SoundSettings;->mXLoudEnabled:Landroid/preference/CheckBoxPreference;

.line 182
iget-object v4, p0, Lcom/android/settings/SoundSettings;->mXLoudEnabled:Landroid/preference/CheckBoxPreference;

invoke-virtual {v4, v6}, Landroid/preference/CheckBoxPreference;->setPersistent(Z)V

.line 188
:goto_5
return-void

:cond_2
move v5, v6

.line 141
goto/16 :goto_0

:cond_3
move v5, v6

.line 145
goto/16 :goto_1

:cond_4
move v5, v6

.line 149
goto/16 :goto_2

:cond_5
move v5, v6

.line 153
goto :goto_3

.line 172
:cond_6
:try_start_0
iget-object v4, p0, Lcom/android/settings/SoundSettings;->mNotificationPulse:Landroid/preference/CheckBoxPreference;

const-string v5, "notification_light_pulse"

invoke-static {v2, v5}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;)I

move-result v5

if-ne v5, v7, :cond_7

move v5, v7

:goto_6
invoke-virtual {v4, v5}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V

.line 174
iget-object v4, p0, Lcom/android/settings/SoundSettings;->mNotificationPulse:Landroid/preference/CheckBoxPreference;

invoke-virtual {v4, p0}, Landroid/preference/CheckBoxPreference;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V
:try_end_0
.catch Landroid/provider/Settings$SettingNotFoundException; {:try_start_0 .. :try_end_0} :catch_0

goto :goto_4

.line 175
:catch_0
move-exception v4

move-object v3, v4

.line 176
.local v3, snfe:Landroid/provider/Settings$SettingNotFoundException;
const-string v4, "SoundAndDisplaysSettings"

const-string v5, "notification_light_pulse not found"

invoke-static {v4, v5}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I

goto :goto_4

.end local v3 #snfe:Landroid/provider/Settings$SettingNotFoundException;
:cond_7
move v5, v6

.line 172
goto :goto_6

.line 185
:cond_8
invoke-virtual {p0}, Lcom/android/settings/SoundSettings;->getPreferenceScreen()Landroid/preference/PreferenceScreen;

move-result-object v4

const-string v5, "xloud"

invoke-virtual {p0, v5}, Lcom/android/settings/SoundSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

move-result-object v5

invoke-virtual {v4, v5}, Landroid/preference/PreferenceScreen;->removePreference(Landroid/preference/Preference;)Z

.line 186
const/4 v4, 0x0

iput-object v4, p0, Lcom/android/settings/SoundSettings;->mXLoudEnabled:Landroid/preference/CheckBoxPreference;

goto :goto_5
.end method

.method protected onPause()V
.locals 1

.prologue
.line 208
invoke-super {p0}, Landroid/preference/PreferenceActivity;->onPause()V

.line 210
iget-object v0, p0, Lcom/android/settings/SoundSettings;->mReceiver:Landroid/content/BroadcastReceiver;

invoke-virtual {p0, v0}, Lcom/android/settings/SoundSettings;->unregisterReceiver(Landroid/content/BroadcastReceiver;)V

.line 211
return-void
.end method

.method public onPreferenceChange(Landroid/preference/Preference;Ljava/lang/Object;)Z
.locals 5
.parameter "preference"
.parameter "objValue"

.prologue
const-string v4, "emergency_tone"

.line 368
invoke-virtual {p1}, Landroid/preference/Preference;->getKey()Ljava/lang/String;

move-result-object v1

.line 369
.local v1, key:Ljava/lang/String;
const-string v3, "emergency_tone"

invoke-virtual {v4, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

move-result v3

if-eqz v3, :cond_1

.line 370
check-cast p2, Ljava/lang/String;

.end local p2
invoke-static {p2}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I

move-result v2

.line 372
.local v2, value:I
:try_start_0
invoke-virtual {p0}, Lcom/android/settings/SoundSettings;->getContentResolver()Landroid/content/ContentResolver;

move-result-object v3

const-string v4, "emergency_tone"

invoke-static {v3, v4, v2}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
:try_end_0
.catch Ljava/lang/NumberFormatException; {:try_start_0 .. :try_end_0} :catch_0

.line 382
.end local v2 #value:I
:cond_0
:goto_0
const/4 v3, 0x1

return v3

.line 374
.restart local v2 #value:I
:catch_0
move-exception v3

move-object v0, v3

.line 375
.local v0, e:Ljava/lang/NumberFormatException;
const-string v3, "SoundAndDisplaysSettings"

const-string v4, "could not persist emergency tone setting"

invoke-static {v3, v4, v0}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

goto :goto_0

.line 377
.end local v0 #e:Ljava/lang/NumberFormatException;
.end local v2 #value:I
.restart local p2
:cond_1
iget-object v3, p0, Lcom/android/settings/SoundSettings;->mVibrate:Landroid/preference/ListPreference;

if-ne p1, v3, :cond_0

.line 378
invoke-virtual {p2}, Ljava/lang/Object;->toString()Ljava/lang/String;

move-result-object v3

invoke-direct {p0, v3}, Lcom/android/settings/SoundSettings;->setPhoneVibrateSettingValue(Ljava/lang/String;)V

.line 379
const/4 v3, 0x0

invoke-direct {p0, v3}, Lcom/android/settings/SoundSettings;->updateState(Z)V

goto :goto_0
.end method

.method public onPreferenceTreeClick(Landroid/preference/PreferenceScreen;Landroid/preference/Preference;)Z
.locals 9
.parameter "preferenceScreen"
.parameter "preference"

.prologue
const/4 v8, 0x0

const/4 v7, 0x1

.line 316
iget-object v4, p0, Lcom/android/settings/SoundSettings;->mSilent:Landroid/preference/CheckBoxPreference;

if-ne p2, v4, :cond_4

.line 317
iget-object v4, p0, Lcom/android/settings/SoundSettings;->mSilent:Landroid/preference/CheckBoxPreference;

invoke-virtual {v4}, Landroid/preference/CheckBoxPreference;->isChecked()Z

move-result v4

if-eqz v4, :cond_3

.line 318
invoke-virtual {p0}, Lcom/android/settings/SoundSettings;->getContentResolver()Landroid/content/ContentResolver;

move-result-object v4

const-string v5, "vibrate_in_silent"

invoke-static {v4, v5, v7}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

move-result v4

if-ne v7, v4, :cond_1

move v2, v7

.line 322
.local v2, vibeInSilent:Z
:goto_0
iget-object v4, p0, Lcom/android/settings/SoundSettings;->mAudioManager:Landroid/media/AudioManager;

if-eqz v2, :cond_2

move v5, v7

:goto_1
invoke-virtual {v4, v5}, Landroid/media/AudioManager;->setRingerMode(I)V

.line 328
.end local v2 #vibeInSilent:Z
:goto_2
invoke-direct {p0, v8}, Lcom/android/settings/SoundSettings;->updateState(Z)V

.line 364
:cond_0
:goto_3
return v7

:cond_1
move v2, v8

.line 318
goto :goto_0

.restart local v2 #vibeInSilent:Z
:cond_2
move v5, v8

.line 322
goto :goto_1

.line 326
.end local v2 #vibeInSilent:Z
:cond_3
iget-object v4, p0, Lcom/android/settings/SoundSettings;->mAudioManager:Landroid/media/AudioManager;

const/4 v5, 0x2

invoke-virtual {v4, v5}, Landroid/media/AudioManager;->setRingerMode(I)V

goto :goto_2

.line 329
:cond_4
iget-object v4, p0, Lcom/android/settings/SoundSettings;->mDtmfTone:Landroid/preference/CheckBoxPreference;

if-ne p2, v4, :cond_6

.line 330
invoke-virtual {p0}, Lcom/android/settings/SoundSettings;->getContentResolver()Landroid/content/ContentResolver;

move-result-object v4

const-string v5, "dtmf_tone"

iget-object v6, p0, Lcom/android/settings/SoundSettings;->mDtmfTone:Landroid/preference/CheckBoxPreference;

invoke-virtual {v6}, Landroid/preference/CheckBoxPreference;->isChecked()Z

move-result v6

if-eqz v6, :cond_5

move v6, v7

:goto_4
invoke-static {v4, v5, v6}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z

goto :goto_3

:cond_5
move v6, v8

goto :goto_4

.line 333
:cond_6
iget-object v4, p0, Lcom/android/settings/SoundSettings;->mSoundEffects:Landroid/preference/CheckBoxPreference;

if-ne p2, v4, :cond_9

.line 334
iget-object v4, p0, Lcom/android/settings/SoundSettings;->mSoundEffects:Landroid/preference/CheckBoxPreference;

invoke-virtual {v4}, Landroid/preference/CheckBoxPreference;->isChecked()Z

move-result v4

if-eqz v4, :cond_7

.line 335
iget-object v4, p0, Lcom/android/settings/SoundSettings;->mAudioManager:Landroid/media/AudioManager;

invoke-virtual {v4}, Landroid/media/AudioManager;->loadSoundEffects()V

.line 339
:goto_5
invoke-virtual {p0}, Lcom/android/settings/SoundSettings;->getContentResolver()Landroid/content/ContentResolver;

move-result-object v4

const-string v5, "sound_effects_enabled"

iget-object v6, p0, Lcom/android/settings/SoundSettings;->mSoundEffects:Landroid/preference/CheckBoxPreference;

invoke-virtual {v6}, Landroid/preference/CheckBoxPreference;->isChecked()Z

move-result v6

if-eqz v6, :cond_8

move v6, v7

:goto_6
invoke-static {v4, v5, v6}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z

goto :goto_3

.line 337
:cond_7
iget-object v4, p0, Lcom/android/settings/SoundSettings;->mAudioManager:Landroid/media/AudioManager;

invoke-virtual {v4}, Landroid/media/AudioManager;->unloadSoundEffects()V

goto :goto_5

:cond_8
move v6, v8

.line 339
goto :goto_6

.line 342
:cond_9
iget-object v4, p0, Lcom/android/settings/SoundSettings;->mHapticFeedback:Landroid/preference/CheckBoxPreference;

if-ne p2, v4, :cond_b

.line 343
invoke-virtual {p0}, Lcom/android/settings/SoundSettings;->getContentResolver()Landroid/content/ContentResolver;

move-result-object v4

const-string v5, "haptic_feedback_enabled"

iget-object v6, p0, Lcom/android/settings/SoundSettings;->mHapticFeedback:Landroid/preference/CheckBoxPreference;

invoke-virtual {v6}, Landroid/preference/CheckBoxPreference;->isChecked()Z

move-result v6

if-eqz v6, :cond_a

move v6, v7

:goto_7
invoke-static {v4, v5, v6}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z

goto :goto_3

:cond_a
move v6, v8

goto :goto_7

.line 346
:cond_b
iget-object v4, p0, Lcom/android/settings/SoundSettings;->mLockSounds:Landroid/preference/CheckBoxPreference;

if-ne p2, v4, :cond_d

.line 347
invoke-virtual {p0}, Lcom/android/settings/SoundSettings;->getContentResolver()Landroid/content/ContentResolver;

move-result-object v4

const-string v5, "lockscreen_sounds_enabled"

iget-object v6, p0, Lcom/android/settings/SoundSettings;->mLockSounds:Landroid/preference/CheckBoxPreference;

invoke-virtual {v6}, Landroid/preference/CheckBoxPreference;->isChecked()Z

move-result v6

if-eqz v6, :cond_c

move v6, v7

:goto_8
invoke-static {v4, v5, v6}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z

goto :goto_3

:cond_c
move v6, v8

goto :goto_8

.line 350
:cond_d
iget-object v4, p0, Lcom/android/settings/SoundSettings;->mNotificationPulse:Landroid/preference/CheckBoxPreference;

if-ne p2, v4, :cond_f

.line 351
iget-object v4, p0, Lcom/android/settings/SoundSettings;->mNotificationPulse:Landroid/preference/CheckBoxPreference;

invoke-virtual {v4}, Landroid/preference/CheckBoxPreference;->isChecked()Z

move-result v1

.line 352
.local v1, value:Z
invoke-virtual {p0}, Lcom/android/settings/SoundSettings;->getContentResolver()Landroid/content/ContentResolver;

move-result-object v4

const-string v5, "notification_light_pulse"

if-eqz v1, :cond_e

move v6, v7

:goto_9
invoke-static {v4, v5, v6}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z

goto/16 :goto_3

:cond_e
move v6, v8

goto :goto_9

.line 355
.end local v1 #value:Z
:cond_f
iget-object v4, p0, Lcom/android/settings/SoundSettings;->mXLoudEnabled:Landroid/preference/CheckBoxPreference;

if-ne p2, v4, :cond_0

iget-object v4, p0, Lcom/android/settings/SoundSettings;->mXLoudEnabled:Landroid/preference/CheckBoxPreference;

if-eqz v4, :cond_0

.line 356
iget-object v4, p0, Lcom/android/settings/SoundSettings;->mXLoudEnabled:Landroid/preference/CheckBoxPreference;

invoke-virtual {v4}, Landroid/preference/CheckBoxPreference;->isChecked()Z

move-result v3

.line 359
.local v3, xloudEnabled:Z
new-instance v0, Landroid/content/Intent;

const-string v4, "com.sonyericsson.audioeffectservice.intent.action.XLOUD_REQUEST"

invoke-direct {v0, v4}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

.line 360
.local v0, intent:Landroid/content/Intent;
const-string v4, "com.sonyericsson.audioeffectservice.intent.extra.XLOUD_STATUS"

if-eqz v3, :cond_10

move v5, v7

:goto_a
invoke-virtual {v0, v4, v5}, Landroid/content/Intent;->putExtra(Ljava/lang/String;I)Landroid/content/Intent;

.line 361
invoke-virtual {p0, v0}, Lcom/android/settings/SoundSettings;->sendBroadcast(Landroid/content/Intent;)V

goto/16 :goto_3

:cond_10
move v5, v8

.line 360
goto :goto_a
.end method

.method protected onResume()V
.locals 5

.prologue
const/4 v4, 0x1

.line 192
invoke-super {p0}, Landroid/preference/PreferenceActivity;->onResume()V

.line 194
invoke-direct {p0, v4}, Lcom/android/settings/SoundSettings;->updateState(Z)V

.line 196
new-instance v0, Landroid/content/IntentFilter;

const-string v1, "android.media.RINGER_MODE_CHANGED"

invoke-direct {v0, v1}, Landroid/content/IntentFilter;-><init>(Ljava/lang/String;)V

.line 197
.local v0, filter:Landroid/content/IntentFilter;
iget-object v1, p0, Lcom/android/settings/SoundSettings;->mReceiver:Landroid/content/BroadcastReceiver;

invoke-virtual {p0, v1, v0}, Lcom/android/settings/SoundSettings;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;

.line 199
iget-object v1, p0, Lcom/android/settings/SoundSettings;->mXLoudEnabled:Landroid/preference/CheckBoxPreference;

if-eqz v1, :cond_0

.line 201
iget-object v1, p0, Lcom/android/settings/SoundSettings;->mXLoudEnabled:Landroid/preference/CheckBoxPreference;

invoke-virtual {p0}, Lcom/android/settings/SoundSettings;->getContentResolver()Landroid/content/ContentResolver;

move-result-object v2

const-string v3, "com.sonyericsson.xloud_enabled"

invoke-static {v2, v3, v4}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

move-result v2

if-eqz v2, :cond_1

move v2, v4

:goto_0
invoke-virtual {v1, v2}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V

.line 204
:cond_0
return-void

.line 201
:cond_1
const/4 v2, 0x0

goto :goto_0
.end method

Search xloud and swiqi

Please Help