summaryrefslogtreecommitdiffstats
path: root/services/java/com/android/server/DropBoxManagerService.java
diff options
context:
space:
mode:
Diffstat (limited to 'services/java/com/android/server/DropBoxManagerService.java')
-rw-r--r--services/java/com/android/server/DropBoxManagerService.java30
1 files changed, 16 insertions, 14 deletions
diff --git a/services/java/com/android/server/DropBoxManagerService.java b/services/java/com/android/server/DropBoxManagerService.java
index 932cba1..5008270 100644
--- a/services/java/com/android/server/DropBoxManagerService.java
+++ b/services/java/com/android/server/DropBoxManagerService.java
@@ -31,6 +31,7 @@ import android.os.Handler;
import android.os.Message;
import android.os.StatFs;
import android.os.SystemClock;
+import android.os.UserHandle;
import android.provider.Settings;
import android.text.format.Time;
import android.util.Slog;
@@ -145,7 +146,7 @@ public final class DropBoxManagerService extends IDropBoxManagerService.Stub {
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) {
@@ -157,7 +158,8 @@ public final class DropBoxManagerService extends IDropBoxManagerService.Stub {
@Override
public void handleMessage(Message msg) {
if (msg.what == MSG_SEND_BROADCAST) {
- mContext.sendBroadcast((Intent)msg.obj, android.Manifest.permission.READ_LOGS);
+ mContext.sendBroadcastAsUser((Intent)msg.obj, UserHandle.OWNER,
+ android.Manifest.permission.READ_LOGS);
}
}
};
@@ -263,8 +265,8 @@ public final class DropBoxManagerService extends IDropBoxManagerService.Stub {
}
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) {
@@ -686,10 +688,10 @@ public final class DropBoxManagerService extends IDropBoxManagerService.Stub {
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();
@@ -708,12 +710,12 @@ public final class DropBoxManagerService extends IDropBoxManagerService.Stub {
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();