|
20 | 20 | import android.graphics.Color; |
21 | 21 | import android.graphics.Typeface; |
22 | 22 | import android.hardware.SensorManager; |
23 | | -import android.os.Build; |
24 | 23 | import android.util.Pair; |
25 | 24 | import android.view.Gravity; |
26 | 25 | import android.view.View; |
@@ -1099,7 +1098,7 @@ private void reload() { |
1099 | 1098 | if (!mIsReceiverRegistered) { |
1100 | 1099 | IntentFilter filter = new IntentFilter(); |
1101 | 1100 | filter.addAction(getReloadAppAction(mApplicationContext)); |
1102 | | - compatRegisterReceiver(mApplicationContext, mReloadAppBroadcastReceiver, filter, true); |
| 1101 | + mApplicationContext.registerReceiver(mReloadAppBroadcastReceiver, filter); |
1103 | 1102 | mIsReceiverRegistered = true; |
1104 | 1103 | } |
1105 | 1104 |
|
@@ -1215,21 +1214,4 @@ public void setPackagerLocationCustomizer( |
1215 | 1214 |
|
1216 | 1215 | return mSurfaceDelegateFactory.createSurfaceDelegate(moduleName); |
1217 | 1216 | } |
1218 | | - |
1219 | | - /** |
1220 | | - * Starting with Android 14, apps and services that target Android 14 and use context-registered |
1221 | | - * receivers are required to specify a flag to indicate whether or not the receiver should be |
1222 | | - * exported to all other apps on the device: either RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED |
1223 | | - * |
1224 | | - * <p>https://developer.android.com/about/versions/14/behavior-changes-14#runtime-receivers-exported |
1225 | | - */ |
1226 | | - private void compatRegisterReceiver( |
1227 | | - Context context, BroadcastReceiver receiver, IntentFilter filter, boolean exported) { |
1228 | | - if (Build.VERSION.SDK_INT >= 34 && context.getApplicationInfo().targetSdkVersion >= 34) { |
1229 | | - context.registerReceiver( |
1230 | | - receiver, filter, exported ? Context.RECEIVER_EXPORTED : Context.RECEIVER_NOT_EXPORTED); |
1231 | | - } else { |
1232 | | - context.registerReceiver(receiver, filter); |
1233 | | - } |
1234 | | - } |
1235 | 1217 | } |
0 commit comments