Skip to content

Commit

Permalink
Fully Completed
Browse files Browse the repository at this point in the history
  • Loading branch information
techinessoverloaded committed Jul 24, 2021
1 parent dfb4379 commit c687e6f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<uses-feature android:name="android.hardware.camera2.full"/>
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
tools:ignore="ScopedStorage" />
android:maxSdkVersion="28"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="com.android.alarm.permission.SET_ALARM"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ else if(cmd.contains("setanalarm"))
},calendar.get(Calendar.HOUR_OF_DAY),calendar.get(Calendar.MINUTE),true);
setAlarmTimePicker.setCancelable(false);
setAlarmTimePicker.setCanceledOnTouchOutside(false);
setAlarmTimePicker.setOnDismissListener(dialog -> receiveMessage("Alarm Setting Task cancelled successfully !",false));
setAlarmTimePicker.setOnCancelListener(dialog -> receiveMessage("Alarm Setting Task cancelled successfully !",false));
setAlarmTimePicker.show();
}
else if(cmd.contains("deleteanalarm"))
Expand Down Expand Up @@ -606,9 +606,17 @@ private void sendSMS(String recipient,String message)
private void checkPermission()
{
PermissionHelper permissionHelper=new PermissionHelper();
permissionHelper.checkAndRequestPermissions(this,Manifest.permission.SEND_SMS,
Manifest.permission.CALL_PHONE,Manifest.permission.CAMERA,
Manifest.permission.WRITE_EXTERNAL_STORAGE,Manifest.permission.RECORD_AUDIO);
if(Build.VERSION.SDK_INT<=Build.VERSION_CODES.P) {
permissionHelper.checkAndRequestPermissions(this, Manifest.permission.SEND_SMS,
Manifest.permission.CALL_PHONE, Manifest.permission.CAMERA,
Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.RECORD_AUDIO);
}
else
{
permissionHelper.checkAndRequestPermissions(this, Manifest.permission.SEND_SMS,
Manifest.permission.CALL_PHONE, Manifest.permission.CAMERA,
Manifest.permission.RECORD_AUDIO);
}
}
@Override
public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults)
Expand Down

0 comments on commit c687e6f

Please sign in to comment.