[HTC EVO 3D] joeykrim:
after seeing the smali screenshot and how it reversed the file names, i googled Spareparts.java and found a few mirrors of the open source code:

http://www.netmite.com/android/mydr...s/src/com/android/spare_parts/SpareParts.java

Older version but still adjusts window animation .. taking a look at the file now.

I don't have line numbers in the web browser so I'll just paste the lines as I follow the logic. Sorry, kind of rush so I've only spent a few minutes following the logic but hope to get this analysis started!

private static final String WINDOW_ANIMATIONS_PREF = "window_animations";

Search for the new string variable WINDOW_ANIMATIONS_PREF :

mWindowAnimationsPref = (ListPreference) prefSet.findPreference(WINDOW_ANIMATIONS_PREF);

mWindowAnimationsPref.setOnPreferenceChangeListener(this);

Now search for the new variable mWindowAnimationsPref :

if (preference == mWindowAnimationsPref) {

writeAnimationPreference(0, objValue);

Now search for the method writeAnimationPreference:

public void writeAnimationPreference(int which, Object objValue) {

mWindowManager.setAnimationScale(which, val);

now searching for mWindowManager (this doesnt look good):

private IWindowManager mWindowManager;

mWindowManager = IWindowManager.Stub.asInterface(ServiceManager.getService("window"));

Ugh .. dead end as it is stubbing this from another interface in the android system. we could write an android apk file to do the same thing, stub in the code, then hard code to modify, or create a similar preference interface to allow the user to change. essentially it appears a different part of the android system is handling the modifying and storage of the updated windows animation preference. The SpareParts app just taps into the android system to make the change but doesn't actually handling any of the actual storage of the change. At least from what I've been able to see so far.

Maybe I followed the logic wrong and missed something? I'd step back out and go to study ServiceManager and IWindowManager in the Android system.

EDIT1: so after searching for the actual method which has a fairly unique name setAnimationScale i found the open source code here: http://grepcode.com/file_/repositor...id/server/WindowManagerService.java/?v=source

Appears it first validates the application has the android permission to in the manifest to adjust the window animation scale.

Also appears to be where the logic is handled that evaluates the number, also determines whether it is Window Animation (0) or Transition Animation (1) ...

end of the method makes this call:

// Persist setting

mH.obtainMessage(H.PERSIST_ANIMATION_SCALE).sendToTarget();

searching now for PERSIST_ANIMATION_SCALE:

Settings.System.putFloat(mContext.getContentResolver(),

Settings.System.WINDOW_ANIMATION_SCALE, mWindowAnimationScale);

Wow .. all that work to be sent off to go find another file to look for more code all to find out where it is storing this setting ...

EDIT2: interesting side note, seems somebody already did some of the work for us and posted this method:

http://code.google.com/p/android-on-freerunner/wiki/FrequentlyAskedQuestions

cd /data/data/com.android.providers.settings/databases/
echo "REPLACE INTO \"system\" VALUES(26,'window_animation_scale','0.0'); \
REPLACE INTO \"system\" VALUES(27,'transition_animation_scale','0.0');" | sqlite3 settings.db

EDIT3: Android official documentation:

http://developer.android.com/reference/android/provider/Settings.System.html#WINDOW_ANIMATION_SCALE

Dianne Hackborn android official reply:

http://groups.google.com/group/android-developers/browse_thread/thread/d953ad9a0521c99b

"This is not intended to be something applications change. "

EDIT4: Final conclusion is the easiest method I can think of would be to follow the sql database modification in EDIT2. Essentially modifying the settings.db file on the device and replacing the windows_animation_scale value. This appears to be the location where android persists the setting.

The value is stored as a float number so 0.0 will disable. EDIT1 contains the min and max values in the android system settings code being 0 as minimum and 20 as maximum it allows to be stored in the database.

The command given in EDIT2 will disable window animations as it inserts 0.0. Simply replacing 0.0 with any other float value less than 20 but greater than 0 and that'll allow the insert to be made.

Also need to make sure the sqlite3 binary is installed in order to properly modify the android system settings.db file.

Definitely hope all that research and my logging/commenting on how to research helps somebody!