Remove unnecessary settings state dump.

The settings provider now implements dump, hance special dump
code is no longer needed.

Change-Id: I93af3f6acac4ac70d6bbf569d2348cb16b8c0946
This commit is contained in:
Svetoslav 2015-02-17 12:49:15 -08:00
parent fc35dd8bc9
commit d527bcbc10
3 changed files with 0 additions and 48 deletions

View File

@ -239,8 +239,6 @@ static void dumpstate() {
dump_file("LAST PANIC CONSOLE", "/data/dontpanic/apanic_console");
dump_file("LAST PANIC THREADS", "/data/dontpanic/apanic_threads");
for_each_userid(do_dump_settings, NULL);
/* The following have a tendency to get wedged when wifi drivers/fw goes belly-up. */
run_command("NETWORK INTERFACES", 10, "ip", "link", NULL);

View File

@ -26,7 +26,6 @@
typedef void (for_each_pid_func)(int, const char *);
typedef void (for_each_tid_func)(int, int, const char *);
typedef void (for_each_userid_func)(int);
/* prints the contents of a file */
int dump_file(const char *title, const char *path);
@ -55,9 +54,6 @@ void for_each_pid(for_each_pid_func func, const char *header);
/* for each thread in the system, run the specified function */
void for_each_tid(for_each_tid_func func, const char *header);
/* for each user id in the system, run the specified function */
void for_each_userid(for_each_userid_func func, const char *header);
/* Displays a blocked processes in-kernel wait channel */
void show_wchan(int pid, int tid, const char *name);
@ -67,9 +63,6 @@ void do_showmap(int pid, const char *name);
/* Gets the dmesg output for the kernel */
void do_dmesg();
/* Dumps settings for a given user id */
void do_dump_settings(int userid);
/* Prints the contents of all the routing tables, both IPv4 and IPv6. */
void dump_route_tables();

View File

@ -53,29 +53,6 @@ static const char* native_processes_to_dump[] = {
NULL,
};
void for_each_userid(void (*func)(int), const char *header) {
DIR *d;
struct dirent *de;
if (header) printf("\n------ %s ------\n", header);
func(0);
if (!(d = opendir("/data/system/users"))) {
printf("Failed to open /data/system/users (%s)\n", strerror(errno));
return;
}
while ((de = readdir(d))) {
int userid;
if (de->d_type != DT_DIR || !(userid = atoi(de->d_name))) {
continue;
}
func(userid);
}
closedir(d);
}
static void __for_each_pid(void (*helper)(int, const char *, void *), const char *header, void *arg) {
DIR *d;
struct dirent *de;
@ -200,22 +177,6 @@ out_close:
return;
}
void do_dump_settings(int userid) {
char title[255];
char dbpath[255];
char sql[255];
sprintf(title, "SYSTEM SETTINGS (user %d)", userid);
if (userid == 0) {
strcpy(dbpath, "/data/data/com.android.providers.settings/databases/settings.db");
strcpy(sql, "pragma user_version; select * from system; select * from secure; select * from global;");
} else {
sprintf(dbpath, "/data/system/users/%d/settings.db", userid);
strcpy(sql, "pragma user_version; select * from system; select * from secure;");
}
run_command(title, 20, SU_PATH, "root", "sqlite3", dbpath, sql, NULL);
return;
}
void do_dmesg() {
printf("------ KERNEL LOG (dmesg) ------\n");
/* Get size of kernel buffer */