示例#1
0
 public static void register(Context context) {
   if (sRegisteredCount++ != 0) {
     // Already registered
     return;
   }
   sInstance.start(context);
 }
示例#2
0
 public static void unregister() {
   if (sRegisteredCount == 0) {
     Log.w(LOGTAG, "register/unregister mismatch");
     return;
   }
   if (--sRegisteredCount != 0) {
     // Should still be registered
     return;
   }
   sInstance.stop();
 }