Revert "Secure => global bubble settings pt 2"

This reverts commit a978ab4526.

Reason for revert: fix test

Change-Id: Id6b49106ab7d8a42ea5de8b16a0dd3ed49d58817
This commit is contained in:
Lyn Han
2019-07-15 18:06:32 +00:00
parent a978ab4526
commit ca77022900
8 changed files with 51 additions and 40 deletions

View File

@@ -16,7 +16,7 @@
package com.android.settings.notification;
import static android.provider.Settings.Global.NOTIFICATION_BUBBLES;
import static android.provider.Settings.Secure.NOTIFICATION_BUBBLES;
import android.annotation.Nullable;
import android.content.Context;
@@ -113,7 +113,7 @@ public class BubblePreferenceController extends NotificationPreferenceController
}
private boolean isGloballyEnabled() {
return Settings.Global.getInt(mContext.getContentResolver(),
return Settings.Secure.getInt(mContext.getContentResolver(),
NOTIFICATION_BUBBLES, SYSTEM_WIDE_OFF) == SYSTEM_WIDE_ON;
}
@@ -124,7 +124,7 @@ public class BubblePreferenceController extends NotificationPreferenceController
backend.setAllowBubbles(pkg, uid, false);
// changing the global settings will cause the observer on the host page to reload
// correct preference state
Settings.Global.putInt(mContext.getContentResolver(),
Settings.Secure.putInt(mContext.getContentResolver(),
NOTIFICATION_BUBBLES, SYSTEM_WIDE_OFF);
}
@@ -134,7 +134,7 @@ public class BubblePreferenceController extends NotificationPreferenceController
backend.setAllowBubbles(pkg, uid, true);
// changing the global settings will cause the observer on the host page to reload
// correct preference state
Settings.Global.putInt(mContext.getContentResolver(),
Settings.Secure.putInt(mContext.getContentResolver(),
NOTIFICATION_BUBBLES, SYSTEM_WIDE_ON);
}
}

View File

@@ -16,7 +16,7 @@
package com.android.settings.notification;
import static android.provider.Settings.Global.NOTIFICATION_BUBBLES;
import static android.provider.Settings.Secure.NOTIFICATION_BUBBLES;
import android.app.settings.SettingsEnums;
import android.content.Context;
@@ -100,7 +100,7 @@ public class BubbleSummaryPreferenceController extends NotificationPreferenceCon
}
private boolean isGloballyEnabled() {
return Settings.Global.getInt(mContext.getContentResolver(),
return Settings.Secure.getInt(mContext.getContentResolver(),
NOTIFICATION_BUBBLES, SYSTEM_WIDE_OFF) == SYSTEM_WIDE_ON;
}
}

View File

@@ -16,6 +16,8 @@
package com.android.settings.notification;
import static android.provider.Settings.Secure.NOTIFICATION_BUBBLES;
import android.content.Context;
import android.provider.Settings;

View File

@@ -47,8 +47,8 @@ public class GlobalBubblePermissionObserverMixin extends ContentObserver {
public void onStart() {
mContext.getContentResolver().registerContentObserver(
Settings.Global.getUriFor(
Settings.Global.NOTIFICATION_BUBBLES),
Settings.Secure.getUriFor(
Settings.Secure.NOTIFICATION_BUBBLES),
false /* notifyForDescendants */,
this /* observer */);
}