Constants in Android are able to be "overwritten". Things like Ti.App.EVENT_ACCESSIBILITY_ANNOUNCEMENT should be truly constant and the user shouldn't be able to overwrite the value or delete the property.
Currently you can "overwrite" the value:
I think the underlying cause here is actually different than
TIMOB-23475. I Believe this is because we hang 'constants' on the prototype of the proxy (i.e. Object.getPrototypeOf(Ti.App);) while the global object living at Ti.App is an instance. So what's happening looks to be "property shadowing" where we're actually adding a new EVENT_ACCESSIBILITY_ANNOUNCEMENT property with our own value onto the instance of Ti.App that lives in the global namespace at Ti.App. This instance property "shadows" the original constant declared on the prototype.
To prove my point, calling Object.getPrototypeOf(Ti.App) gives:
You can clearly see the constants there.
It makes sense to hang the constants at the "prototype" level since they're supposed to be "class-level/static" constants and we shouldn't need to have every instance hold a copy. However, it looks like we're not preventing shadowing properly (even though it appears we're setting the constant property attributes to ReadOnly|DontDelete).
See https://github.com/getify/You-Dont-Know-JS/issues/91 for discussion on cases where there seems to be prevented shadowing.
One possible solution may be to do an Object.seal() on all our proxies after they're set up. This marks all properties as DontDelete and prevents new properties from being added.