DeskClock: Add receiver flags for SDK 34
Change-Id: Ia3c09fa52ea4b7388b5a383222221e46724b8f18
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
diff --git a/src/com/android/alarmclock/DigitalAppWidgetProvider.java b/src/com/android/alarmclock/DigitalAppWidgetProvider.java
index ec6fac4..7bda493 100644
--- a/src/com/android/alarmclock/DigitalAppWidgetProvider.java
+++ b/src/com/android/alarmclock/DigitalAppWidgetProvider.java
@@ -183,7 +183,8 @@
intentFilter.addAction(ACTION_WORLD_CITIES_CHANGED);
intentFilter.addAction(ACTION_ON_DAY_CHANGE);
intentFilter.addAction(ACTION_CONFIGURATION_CHANGED);
- context.getApplicationContext().registerReceiver(receiver, intentFilter);
+ context.getApplicationContext().registerReceiver(receiver, intentFilter,
+ Context.RECEIVER_NOT_EXPORTED);
sReceiversRegistered = true;
}
diff --git a/src/com/android/deskclock/AnalogClock.java b/src/com/android/deskclock/AnalogClock.java
index d4022be..4f375f9 100644
--- a/src/com/android/deskclock/AnalogClock.java
+++ b/src/com/android/deskclock/AnalogClock.java
@@ -116,7 +116,7 @@
filter.addAction(Intent.ACTION_TIME_TICK);
filter.addAction(Intent.ACTION_TIME_CHANGED);
filter.addAction(Intent.ACTION_TIMEZONE_CHANGED);
- getContext().registerReceiver(mIntentReceiver, filter);
+ getContext().registerReceiver(mIntentReceiver, filter, Context.RECEIVER_NOT_EXPORTED);
// Refresh the calendar instance since the time zone may have changed while the receiver
// wasn't registered.
diff --git a/src/com/android/deskclock/ClockFragment.java b/src/com/android/deskclock/ClockFragment.java
index a6dbdfe..7591a18 100644
--- a/src/com/android/deskclock/ClockFragment.java
+++ b/src/com/android/deskclock/ClockFragment.java
@@ -143,7 +143,7 @@
// Watch for system events that effect clock time or format.
if (activity != null && mAlarmChangeReceiver != null) {
final IntentFilter filter = new IntentFilter(ACTION_NEXT_ALARM_CLOCK_CHANGED);
- activity.registerReceiver(mAlarmChangeReceiver, filter);
+ activity.registerReceiver(mAlarmChangeReceiver, filter, Context.RECEIVER_NOT_EXPORTED);
}
// Resume can be invoked after changing the clock style or seconds display.
diff --git a/src/com/android/deskclock/Screensaver.java b/src/com/android/deskclock/Screensaver.java
index ad92b11..1031f37 100644
--- a/src/com/android/deskclock/Screensaver.java
+++ b/src/com/android/deskclock/Screensaver.java
@@ -105,7 +105,8 @@
// Setup handlers for time reference changes and date updates.
registerReceiver(mAlarmChangedReceiver,
- new IntentFilter(AlarmManager.ACTION_NEXT_ALARM_CLOCK_CHANGED));
+ new IntentFilter(AlarmManager.ACTION_NEXT_ALARM_CLOCK_CHANGED),
+ Context.RECEIVER_NOT_EXPORTED);
Utils.updateDate(mDateFormat, mDateFormatForAccessibility, mContentView);
Utils.refreshAlarm(this, mContentView);
diff --git a/src/com/android/deskclock/ScreensaverActivity.java b/src/com/android/deskclock/ScreensaverActivity.java
index 2cfd2c2..ab0e8b2 100644
--- a/src/com/android/deskclock/ScreensaverActivity.java
+++ b/src/com/android/deskclock/ScreensaverActivity.java
@@ -134,7 +134,7 @@
filter.addAction(Intent.ACTION_POWER_DISCONNECTED);
filter.addAction(Intent.ACTION_USER_PRESENT);
filter.addAction(AlarmManager.ACTION_NEXT_ALARM_CLOCK_CHANGED);
- registerReceiver(mIntentReceiver, filter);
+ registerReceiver(mIntentReceiver, filter, Context.RECEIVER_NOT_EXPORTED);
}
@Override
@@ -147,7 +147,8 @@
startPositionUpdater();
UiDataModel.getUiDataModel().addMidnightCallback(mMidnightUpdater);
- final Intent intent = registerReceiver(null, new IntentFilter(ACTION_BATTERY_CHANGED));
+ final Intent intent = registerReceiver(null, new IntentFilter(ACTION_BATTERY_CHANGED),
+ Context.RECEIVER_NOT_EXPORTED);
final boolean pluggedIn = intent != null && intent.getIntExtra(EXTRA_PLUGGED, 0) != 0;
updateWakeLock(pluggedIn);
}
diff --git a/src/com/android/deskclock/data/CityModel.java b/src/com/android/deskclock/data/CityModel.java
index ac0e294..458a7a3 100644
--- a/src/com/android/deskclock/data/CityModel.java
+++ b/src/com/android/deskclock/data/CityModel.java
@@ -85,7 +85,8 @@
// Clear caches affected by locale when locale changes.
final IntentFilter localeBroadcastFilter = new IntentFilter(Intent.ACTION_LOCALE_CHANGED);
- mContext.registerReceiver(mLocaleChangedReceiver, localeBroadcastFilter);
+ mContext.registerReceiver(mLocaleChangedReceiver, localeBroadcastFilter,
+ Context.RECEIVER_NOT_EXPORTED);
// Clear caches affected by preferences when preferences change.
prefs.registerOnSharedPreferenceChangeListener(mPreferenceListener);
diff --git a/src/com/android/deskclock/data/RingtoneModel.java b/src/com/android/deskclock/data/RingtoneModel.java
index d765ba8..de7e9a2 100644
--- a/src/com/android/deskclock/data/RingtoneModel.java
+++ b/src/com/android/deskclock/data/RingtoneModel.java
@@ -78,7 +78,8 @@
// Clear caches affected by locale when locale changes.
final IntentFilter localeBroadcastFilter = new IntentFilter(Intent.ACTION_LOCALE_CHANGED);
- mContext.registerReceiver(mLocaleChangedReceiver, localeBroadcastFilter);
+ mContext.registerReceiver(mLocaleChangedReceiver, localeBroadcastFilter,
+ Context.RECEIVER_NOT_EXPORTED);
}
void addCustomRingtone(Uri uri, String title) {
diff --git a/src/com/android/deskclock/data/SilentSettingsModel.java b/src/com/android/deskclock/data/SilentSettingsModel.java
index 1cfc188..052dbf3 100644
--- a/src/com/android/deskclock/data/SilentSettingsModel.java
+++ b/src/com/android/deskclock/data/SilentSettingsModel.java
@@ -94,7 +94,8 @@
cr.registerContentObserver(DEFAULT_ALARM_ALERT_URI, false, contentChangeWatcher);
final IntentFilter filter = new IntentFilter(ACTION_INTERRUPTION_FILTER_CHANGED);
- context.registerReceiver(new DoNotDisturbChangeReceiver(), filter);
+ context.registerReceiver(new DoNotDisturbChangeReceiver(), filter,
+ Context.RECEIVER_NOT_EXPORTED);
}
void addSilentSettingsListener(OnSilentSettingsListener listener) {
diff --git a/src/com/android/deskclock/data/StopwatchModel.java b/src/com/android/deskclock/data/StopwatchModel.java
index ba24893..804bea9 100644
--- a/src/com/android/deskclock/data/StopwatchModel.java
+++ b/src/com/android/deskclock/data/StopwatchModel.java
@@ -70,7 +70,8 @@
// Update stopwatch notification when locale changes.
final IntentFilter localeBroadcastFilter = new IntentFilter(Intent.ACTION_LOCALE_CHANGED);
- mContext.registerReceiver(mLocaleChangedReceiver, localeBroadcastFilter);
+ mContext.registerReceiver(mLocaleChangedReceiver, localeBroadcastFilter,
+ Context.RECEIVER_NOT_EXPORTED);
}
/**
diff --git a/src/com/android/deskclock/data/TimerModel.java b/src/com/android/deskclock/data/TimerModel.java
index cc06add..47bafe3 100644
--- a/src/com/android/deskclock/data/TimerModel.java
+++ b/src/com/android/deskclock/data/TimerModel.java
@@ -144,7 +144,8 @@
// Update timer notification when locale changes.
final IntentFilter localeBroadcastFilter = new IntentFilter(Intent.ACTION_LOCALE_CHANGED);
- mContext.registerReceiver(mLocaleChangedReceiver, localeBroadcastFilter);
+ mContext.registerReceiver(mLocaleChangedReceiver, localeBroadcastFilter,
+ Context.RECEIVER_NOT_EXPORTED);
}
/**
diff --git a/src/com/android/deskclock/uidata/FormattedStringModel.java b/src/com/android/deskclock/uidata/FormattedStringModel.java
index c05d220..0c951b2 100644
--- a/src/com/android/deskclock/uidata/FormattedStringModel.java
+++ b/src/com/android/deskclock/uidata/FormattedStringModel.java
@@ -56,7 +56,8 @@
FormattedStringModel(Context context) {
// Clear caches affected by locale when locale changes.
final IntentFilter localeBroadcastFilter = new IntentFilter(Intent.ACTION_LOCALE_CHANGED);
- context.registerReceiver(mLocaleChangedReceiver, localeBroadcastFilter);
+ context.registerReceiver(mLocaleChangedReceiver, localeBroadcastFilter,
+ Context.RECEIVER_NOT_EXPORTED);
}
/**
diff --git a/src/com/android/deskclock/uidata/PeriodicCallbackModel.java b/src/com/android/deskclock/uidata/PeriodicCallbackModel.java
index 4928244..1b0e00f 100644
--- a/src/com/android/deskclock/uidata/PeriodicCallbackModel.java
+++ b/src/com/android/deskclock/uidata/PeriodicCallbackModel.java
@@ -70,7 +70,8 @@
timeChangedBroadcastFilter.addAction(ACTION_TIME_CHANGED);
timeChangedBroadcastFilter.addAction(ACTION_DATE_CHANGED);
timeChangedBroadcastFilter.addAction(ACTION_TIMEZONE_CHANGED);
- context.registerReceiver(mTimeChangedReceiver, timeChangedBroadcastFilter);
+ context.registerReceiver(mTimeChangedReceiver, timeChangedBroadcastFilter,
+ Context.RECEIVER_NOT_EXPORTED);
}
/**