Migrate more Secure settings to Global.

Migrate networking, storage, battery, DropBox, and PackageManager
related Secure settings to Global table.

Bug: 7232014, 7231331, 7231198
Change-Id: I772c2a9586a2f708c9db95622477f235064b8f4d
diff --git a/services/java/com/android/server/DropBoxManagerService.java b/services/java/com/android/server/DropBoxManagerService.java
index 0b12410..5008270 100644
--- a/services/java/com/android/server/DropBoxManagerService.java
+++ b/services/java/com/android/server/DropBoxManagerService.java
@@ -146,7 +146,7 @@
         context.registerReceiver(mReceiver, filter);
 
         mContentResolver.registerContentObserver(
-            Settings.Secure.CONTENT_URI, true,
+            Settings.Global.CONTENT_URI, true,
             new ContentObserver(new Handler()) {
                 @Override
                 public void onChange(boolean selfChange) {
@@ -265,8 +265,8 @@
     }
 
     public boolean isTagEnabled(String tag) {
-        return !"disabled".equals(Settings.Secure.getString(
-                mContentResolver, Settings.Secure.DROPBOX_TAG_PREFIX + tag));
+        return !"disabled".equals(Settings.Global.getString(
+                mContentResolver, Settings.Global.DROPBOX_TAG_PREFIX + tag));
     }
 
     public synchronized DropBoxManager.Entry getNextEntry(String tag, long millis) {
@@ -688,10 +688,10 @@
     private synchronized long trimToFit() {
         // Expunge aged items (including tombstones marking deleted data).
 
-        int ageSeconds = Settings.Secure.getInt(mContentResolver,
-                Settings.Secure.DROPBOX_AGE_SECONDS, DEFAULT_AGE_SECONDS);
-        int maxFiles = Settings.Secure.getInt(mContentResolver,
-                Settings.Secure.DROPBOX_MAX_FILES, DEFAULT_MAX_FILES);
+        int ageSeconds = Settings.Global.getInt(mContentResolver,
+                Settings.Global.DROPBOX_AGE_SECONDS, DEFAULT_AGE_SECONDS);
+        int maxFiles = Settings.Global.getInt(mContentResolver,
+                Settings.Global.DROPBOX_MAX_FILES, DEFAULT_MAX_FILES);
         long cutoffMillis = System.currentTimeMillis() - ageSeconds * 1000;
         while (!mAllFiles.contents.isEmpty()) {
             EntryFile entry = mAllFiles.contents.first();
@@ -710,12 +710,12 @@
 
         long uptimeMillis = SystemClock.uptimeMillis();
         if (uptimeMillis > mCachedQuotaUptimeMillis + QUOTA_RESCAN_MILLIS) {
-            int quotaPercent = Settings.Secure.getInt(mContentResolver,
-                    Settings.Secure.DROPBOX_QUOTA_PERCENT, DEFAULT_QUOTA_PERCENT);
-            int reservePercent = Settings.Secure.getInt(mContentResolver,
-                    Settings.Secure.DROPBOX_RESERVE_PERCENT, DEFAULT_RESERVE_PERCENT);
-            int quotaKb = Settings.Secure.getInt(mContentResolver,
-                    Settings.Secure.DROPBOX_QUOTA_KB, DEFAULT_QUOTA_KB);
+            int quotaPercent = Settings.Global.getInt(mContentResolver,
+                    Settings.Global.DROPBOX_QUOTA_PERCENT, DEFAULT_QUOTA_PERCENT);
+            int reservePercent = Settings.Global.getInt(mContentResolver,
+                    Settings.Global.DROPBOX_RESERVE_PERCENT, DEFAULT_RESERVE_PERCENT);
+            int quotaKb = Settings.Global.getInt(mContentResolver,
+                    Settings.Global.DROPBOX_QUOTA_KB, DEFAULT_QUOTA_KB);
 
             mStatFs.restat(mDropBoxDir.getPath());
             int available = mStatFs.getAvailableBlocks();