hunk.code_window: {
     "name": "expo-template-bare-typescript",
     "description": "This bare project template includes TypeScript",
     "version": "40.0.13",
     "main": "index.js",
     "scripts": {
       "android": "react-native run-android",
       "ios": "react-native run-ios",
       "web": "expo start --web",
  
hunk.labels: keep keep keep replace keep keep keep keep keep
hunk.after_edit:   "version": "41.0.0",
  
hunk.file_path: templates/expo-template-bare-typescript/package.json
hunk.type: replace
file: package expo.modules.battery;
  
  import android.content.BroadcastReceiver;
  import android.content.Context;
  import android.content.Intent;
  import android.content.IntentFilter;
  import android.os.BatteryManager;
  import android.os.PowerManager;
  
  public class BatteryLevelReceiver extends BroadcastReceiver {
    public static String INTENT_ACTION = "expo.modules.battery.BatteryLevelReceiver";
  
    public BatteryLevelReceiver() {
    }
  
    @Override
    public void onReceive(Context context, Intent intent) {
      Intent batteryIntent = BatteryModule.mContext.getApplicationContext().registerReceiver(null, new IntentFilter(Intent.ACTION_BATTERY_CHANGED));
      int level = batteryIntent.getIntExtra(BatteryManager.EXTRA_LEVEL, -1);
      int scale = batteryIntent.getIntExtra(BatteryManager.EXTRA_SCALE, -1);
      float batteryLevel = (level != -1 && scale != -1) ? level / (float) scale : -1;
      BatteryModule.onBatteryLevelChange(batteryLevel);
    }
  }
  