Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • A Android-IMSI-Catcher-Detector
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 162
    • Issues 162
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 5
    • Merge requests 5
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • CellularPrivacy
  • Android-IMSI-Catcher-Detector
  • Issues
  • #581
Closed
Open
Issue created Jul 30, 2015 by Administrator@rootContributor

Re-implement deleting and resetting DB

Created by: E3V3A

For some still unknown reason the possibility to clear and reset the AIMSICD DB was removed. The only comments present are these found in AIMSICD.java

        } else if (selectedItem.getId() == DrawerMenu.ID.SETTINGS.RESET_DB) {
            //Helpers.askAndDeleteDb(this); Todo this isnt a good method for deleting database
            // @banjaxbanjo  If it isn't good, that it not a good enough reason to remove it.
            // or what did you mean?
            // "If it ain't broke, don't fix."

Following this lead we get the following code segment in Helpers.java:

    /**
     * Very cool method. Completely erases the entire database.
     * Apply on medical prescription.
     * Also asks the user, whether he wants to erase its database ...
     *
     * @param pContext Context of Activity
     */
    public static void askAndDeleteDb(final Context pContext) {
        AlertDialog lAlertDialog = new AlertDialog.Builder(pContext)
                .setNegativeButton(R.string.open_cell_id_button_cancel, new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                        //Do nothing
                    }
                })
                .setPositiveButton(R.string.open_cell_id_button_ok, new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                        //FIXME need to remove hardcoded string into constants
                        pContext.deleteDatabase("aimsicd.db");
                    }
                })
                .setMessage(pContext.getString(R.string.clear_database_question))
                .setTitle(R.string.clear_database)
                .setCancelable(false)
                .setIcon(R.drawable.ic_action_delete_database).create();
        lAlertDialog.show();
    }

It's hard to tell if these comments is an attempt to be ironic, so it would be much more appreciated to rather describe the problem or present a method of solution. @banjaxbanjo Can you please explain?

Assignee
Assign to
Time tracking