File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
app/src/main/java/moe/yuuta/mipushtester Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -116,6 +116,11 @@ public void handleToggleRegister (View v) {
116116 } else {
117117 XLog .i ("Unregistering" );
118118 MiPushClient .unregisterPush (requireContext ());
119+ requireContext ().getSharedPreferences ("mipush" , Context .MODE_PRIVATE )
120+ .edit ()
121+ // It will check if all settings are valid. If it's invalid, it won't register.
122+ .putString ("devId" , null )
123+ .apply ();
119124 mRegistrationStatus .registered .set (false );
120125 }
121126 }
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ private RegistrationStatus(@NonNull Context context) {
3030
3131 public void fetchStatus (@ NonNull Context context ) {
3232 useMIUIPush .set (MiPushClient .shouldUseMIUIPush (context ));
33- // FIXME: It will start push, we should prevent it
33+ // It will register push
3434 regId .set (MiPushClient .getRegId (context ));
3535 // SDK will detect it's registered or not. Only registered client will return a non-null value.
3636 // The detection code is optimized, the best way is to use public APIs.
You can’t perform that action at this time.
0 commit comments