In an optical data reader, light is aimed out through a window at objects located
in front of the window, and reflections from the objects and/or the window itself
are detected. The amount of detected light is compared to one or more expected
levels to determine when an object is present in front of the window and/or whether
the window is properly installed. The optical reader is controlled based on this
determination. Control functions that may be implemented in this manner include,
for example, waking up the data reader when an object is detected in front of the
glass, and disabling the data reader if the window is removed.