Closed GoogleCodeExporter closed 9 years ago
Cause: The VM was not able to find the classes because the
monitorPackage did not reflect the recent change in the directory
structure made by r697. The effect of this is that Omnidroid rules
related to phone ring, location change or time change will not work even
when turned on.
Fix: Instead of relying on reflection to instantiate classes, I used the
normal way - using the new operator. Apparently, the reason behind using
the reflection utilities was to allow 3rd party developers to add their
own monitor classes in our database and we could instatiate them
dynamically using reflection. However, I believe the better and safer
way is to let the 3rd party application start their own service by
having its own manifest file, installation to the device, etc.
Afterwards, they just need to send OmniDroid the necessary intents which
is exactly what the current monitoring classes are doing right now (we
still need the intrastracture to support this one).
I also took this opportunity to clean up the code in
EventMonitoringService.java.
I also removed receiver element at the manifest file for TIME_TICK as it
serves no purpose, and thus, misleading. In reference to to the Android
API:
public static final String ACTION_TIME_TICK
Since: API Level 1
Broadcast Action: The current time has changed. Sent every minute. You
can not receive this through components declared in manifests, only by
explicitly registering for it with Context.registerReceiver().
This is a protected intent that can only be sent by the system.
Constant Value: "android.intent.action.TIME_TICK"
Tested rules with phone ring, location change and time events to be
working on the emulator.
Original comment by renc...@gmail.com
on 2 Jun 2010 at 3:53
I have not tested or tried this yet, but I would also would like to add that I
am quite
skeptical that EventMonitoringService would be able to instantiate the classes
outside
of our project as every process has its own copy of the DVM, and what the
original code
was trying to do is like trying to dynamically link the codes.
Original comment by renc...@gmail.com
on 2 Jun 2010 at 2:23
Committed on r734.
Review path: http://codereview.appspot.com/1446043/
Original comment by renc...@gmail.com
on 2 Jun 2010 at 7:59
Original issue reported on code.google.com by
renc...@gmail.com
on 26 May 2010 at 8:26