Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove obsolete sdk version checks #1780

Merged
merged 1 commit into from
Nov 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions app/src/main/java/com/android/calendar/AllInOneActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ protected void onCreate(Bundle icicle) {

private void checkAppPermissions() {
// Here, thisActivity is the current activity
if (Build.VERSION.SDK_INT >= 23 && (ContextCompat.checkSelfPermission(this,
if ((ContextCompat.checkSelfPermission(this,
Manifest.permission.WRITE_CALENDAR)
!= PackageManager.PERMISSION_GRANTED ||
ContextCompat.checkSelfPermission(this,
Expand Down Expand Up @@ -423,7 +423,6 @@ private void checkAppPermissions() {
}

private void checkAndRequestDisablingDoze() {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) return;
boolean doNotCheckBatteryOptimization = Utils.getSharedPreference(getApplicationContext(), GeneralPreferences.KEY_DO_NOT_CHECK_BATTERY_OPTIMIZATION, false);
if (!dozeDisabled() && !doNotCheckBatteryOptimization) {
Intent intent = new Intent();
Expand All @@ -434,8 +433,6 @@ private void checkAndRequestDisablingDoze() {
}

private Boolean dozeDisabled() {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) return true;

String packageName = getApplicationContext().getPackageName();
PowerManager pm = (PowerManager) getApplicationContext().getSystemService(Context.POWER_SERVICE);
return pm.isIgnoringBatteryOptimizations(packageName);
Expand Down
Loading