forked from organicmaps/organicmaps
[android] Added push token hidden command
This commit is contained in:
parent
d71caf0f48
commit
2d0e96b225
1 changed files with 35 additions and 15 deletions
|
@ -4,22 +4,22 @@ import android.app.Activity;
|
|||
import android.content.Intent;
|
||||
import android.location.Location;
|
||||
import android.os.Bundle;
|
||||
import androidx.annotation.CallSuper;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import com.google.android.material.appbar.AppBarLayout;
|
||||
import com.google.android.material.appbar.CollapsingToolbarLayout;
|
||||
import com.google.android.material.tabs.TabLayout;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import android.text.TextUtils;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.CallSuper;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
import com.google.android.material.appbar.AppBarLayout;
|
||||
import com.google.android.material.appbar.CollapsingToolbarLayout;
|
||||
import com.google.android.material.tabs.TabLayout;
|
||||
import com.mapswithme.maps.Framework;
|
||||
import com.mapswithme.maps.MwmActivity;
|
||||
import com.mapswithme.maps.R;
|
||||
|
@ -37,7 +37,10 @@ import com.mapswithme.maps.widget.SearchToolbarController;
|
|||
import com.mapswithme.util.SharedPropertiesUtils;
|
||||
import com.mapswithme.util.UiUtils;
|
||||
import com.mapswithme.util.Utils;
|
||||
import com.mapswithme.util.log.Logger;
|
||||
import com.mapswithme.util.log.LoggerFactory;
|
||||
import com.mapswithme.util.statistics.Statistics;
|
||||
import com.pushwoosh.Pushwoosh;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
@ -471,7 +474,8 @@ public class SearchFragment extends BaseMwmFragment
|
|||
{
|
||||
mHiddenCommands.addAll(Arrays.asList(new BadStorageCommand("?emulateBadStorage"),
|
||||
new JavaCrashCommand("?emulateJavaCrash"),
|
||||
new NativeCrashCommand("?emulateNativeCrash")));
|
||||
new NativeCrashCommand("?emulateNativeCrash"),
|
||||
new PushTokenCommand("?pushToken")));
|
||||
}
|
||||
|
||||
return mHiddenCommands;
|
||||
|
@ -736,7 +740,7 @@ public class SearchFragment extends BaseMwmFragment
|
|||
|
||||
private static class BadStorageCommand extends HiddenCommand.BaseHiddenCommand
|
||||
{
|
||||
protected BadStorageCommand(@NonNull String command)
|
||||
BadStorageCommand(@NonNull String command)
|
||||
{
|
||||
super(command);
|
||||
}
|
||||
|
@ -750,7 +754,7 @@ public class SearchFragment extends BaseMwmFragment
|
|||
|
||||
private static class JavaCrashCommand extends HiddenCommand.BaseHiddenCommand
|
||||
{
|
||||
protected JavaCrashCommand(@NonNull String command)
|
||||
JavaCrashCommand(@NonNull String command)
|
||||
{
|
||||
super(command);
|
||||
}
|
||||
|
@ -764,7 +768,7 @@ public class SearchFragment extends BaseMwmFragment
|
|||
|
||||
private static class NativeCrashCommand extends HiddenCommand.BaseHiddenCommand
|
||||
{
|
||||
protected NativeCrashCommand(@NonNull String command)
|
||||
NativeCrashCommand(@NonNull String command)
|
||||
{
|
||||
super(command);
|
||||
}
|
||||
|
@ -775,4 +779,20 @@ public class SearchFragment extends BaseMwmFragment
|
|||
Framework.nativeMakeCrash();
|
||||
}
|
||||
}
|
||||
|
||||
private static class PushTokenCommand extends HiddenCommand.BaseHiddenCommand
|
||||
{
|
||||
PushTokenCommand(@NonNull String command)
|
||||
{
|
||||
super(command);
|
||||
}
|
||||
|
||||
@Override
|
||||
void executeInternal()
|
||||
{
|
||||
Logger logger = LoggerFactory.INSTANCE.getLogger(LoggerFactory.Type.THIRD_PARTY);
|
||||
String tag = PushTokenCommand.class.getSimpleName();
|
||||
logger.i(tag, "Push token: " + Pushwoosh.getInstance().getPushToken());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue