[MA] only send certain manufacturers to appinfo
This commit is contained in:
parent
c640e3c6be
commit
93398afc8e
|
|
@ -380,6 +380,8 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
|
|||
String manufacturer = Build.MANUFACTURER.toLowerCase();
|
||||
String message = getString(R.string.battery_opt_msg);
|
||||
|
||||
if (manufacturer.contains("oppo") || manufacturer.contains("realme") || manufacturer.contains("xiaomi")) {
|
||||
|
||||
if (manufacturer.contains("oppo") || manufacturer.contains("realme")) {
|
||||
message += getString(R.string.battery_opt_oppo_extra);
|
||||
} else if (manufacturer.contains("xiaomi")) {
|
||||
|
|
@ -393,6 +395,12 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
|
|||
.setNegativeButton(R.string.cancel, null)
|
||||
.show();
|
||||
}
|
||||
else {
|
||||
Intent intent = new Intent(Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS);
|
||||
intent.setData(Uri.parse("package:" + getPackageName()));
|
||||
startActivity(intent);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue