From d64d1763c590b1c954b759156683abf39ff22945 Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Tue, 20 Aug 2013 14:37:16 -0700 Subject: Removing workspace screens on load and ensuring we don't bind on new apps until returning to Launcher. - Updating print_db to print workspace screens Change-Id: Id477f5a5649c0d3b7ab0cce5ed99ca0a519d7706 --- print_db.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'print_db.py') diff --git a/print_db.py b/print_db.py index 6caa7bb87..05237d0b9 100755 --- a/print_db.py +++ b/print_db.py @@ -34,6 +34,10 @@ def make_dir(): shutil.rmtree(DIR, True) os.makedirs(DIR) +def adb_root_remount(): + os.system("adb root") + os.system("adb remount") + def pull_file(fn): print "pull_file: " + fn rv = os.system("adb pull" @@ -52,6 +56,15 @@ def get_favorites(conn): rows.append(row) return columns,rows +def get_screens(conn): + c = conn.cursor() + c.execute("SELECT * FROM workspaceScreens") + columns = [d[0] for d in c.description] + rows = [] + for row in c: + rows.append(row) + return columns,rows + def print_intent(out, id, i, cell): if cell: out.write("""shortcut""" % ( @@ -127,13 +140,21 @@ def render_cell_info(out, cell, occupied): out.write("unknown type: %d" % itemType) out.write("\n") +def render_screen_info(out, screen): + out.write("") + out.write("%s" % (screen["_id"])) + out.write("%s" % (screen["screenRank"])) + out.write("") + def process_file(fn): global SCREENS, COLUMNS, ROWS, HOTSEAT_SIZE print "process_file: " + fn conn = sqlite3.connect(fn) columns,rows = get_favorites(conn) + screenCols, screenRows = get_screens(conn) data = [dict(zip(columns,row)) for row in rows] + screenData = [dict(zip(screenCols, screenRow)) for screenRow in screenRows] # Calculate the proper number of screens, columns, and rows in this db screensIdMap = [] @@ -198,6 +219,14 @@ def process_file(fn): out.write(""" """) + # Screens + out.write("
Screens
\n") + out.write("\n") + out.write("\n") + for screen in screenData: + render_screen_info(out, screen) + out.write("
Screen IDRank
\n") + # Hotseat hotseat = [] for i in range(0, HOTSEAT_SIZE): @@ -274,6 +303,7 @@ def updateDeviceClassConstants(str): def main(argv): if len(argv) == 1 or (len(argv) == 2 and updateDeviceClassConstants(argv[1])): make_dir() + adb_root_remount() pull_file(AUTO_FILE) process_file(AUTO_FILE) elif len(argv) == 2 or (len(argv) == 3 and updateDeviceClassConstants(argv[2])): -- cgit v1.2.3