Silent mode bug

This commit is contained in:
jens 2021-12-27 13:58:43 +01:00
parent 41cf907be3
commit 0463e0aa19
9 changed files with 21 additions and 24 deletions

View File

@ -11,8 +11,8 @@ android {
compileSdkVersion 29 compileSdkVersion 29
buildToolsVersion '29.0.2' buildToolsVersion '29.0.2'
useLibrary 'org.apache.http.legacy' useLibrary 'org.apache.http.legacy'
versionCode 114 versionCode 115
versionName "1.7" versionName "1.7.1"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
} }

View File

@ -11,8 +11,8 @@
"type": "SINGLE", "type": "SINGLE",
"filters": [], "filters": [],
"attributes": [], "attributes": [],
"versionCode": 114, "versionCode": 115,
"versionName": "1.7-googlePlay", "versionName": "1.7.1-googlePlay",
"outputFile": "app-googlePlayFlavor-release.apk" "outputFile": "app-googlePlayFlavor-release.apk"
} }
], ],

View File

@ -687,14 +687,14 @@ public class Actions
AudioManager myAudioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE); AudioManager myAudioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && desiredSoundSetting == AudioManager.RINGER_MODE_SILENT) // if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && desiredSoundSetting == AudioManager.RINGER_MODE_SILENT)
{ // {
AudioManager am = (AudioManager) Miscellaneous.getAnyContext().getSystemService(Context.AUDIO_SERVICE); // AudioManager am = (AudioManager) Miscellaneous.getAnyContext().getSystemService(Context.AUDIO_SERVICE);
am.setStreamVolume(AudioManager.STREAM_NOTIFICATION, 0, AudioManager.FLAG_PLAY_SOUND); // am.setStreamVolume(AudioManager.STREAM_NOTIFICATION, 0, AudioManager.FLAG_PLAY_SOUND);
am.setVibrateSetting(AudioManager.VIBRATE_TYPE_RINGER, AudioManager.VIBRATE_SETTING_OFF); // am.setVibrateSetting(AudioManager.VIBRATE_TYPE_RINGER, AudioManager.VIBRATE_SETTING_OFF);
} // }
else // else
myAudioManager.setRingerMode(desiredSoundSetting); // myAudioManager.setRingerMode(desiredSoundSetting);
} }
private static String getIPAddressUsb(final boolean useIPv4) private static String getIPAddressUsb(final boolean useIPv4)

View File

@ -301,8 +301,7 @@ public class ActivityPermissions extends Activity
public static boolean haveDeviceAdmin() public static boolean haveDeviceAdmin()
{ {
DevicePolicyManager deviceManger = (DevicePolicyManager)Miscellaneous.getAnyContext().getSystemService(Context.DEVICE_POLICY_SERVICE); DevicePolicyManager deviceManger = (DevicePolicyManager)Miscellaneous.getAnyContext().getSystemService(Context.DEVICE_POLICY_SERVICE);
// ComponentName compName = new ComponentName(ActivityPermissions.getInstance(), DeviceAdmin.class ) ; ComponentName compName = new ComponentName(Miscellaneous.getAnyContext(), DeviceAdmin.class);
ComponentName compName = new ComponentName(Miscellaneous.getAnyContext(), DeviceAdmin.class) ;
boolean active = deviceManger.isAdminActive(compName); boolean active = deviceManger.isAdminActive(compName);
return active; return active;
} }
@ -311,11 +310,7 @@ public class ActivityPermissions extends Activity
{ {
if(!haveDeviceAdmin()) if(!haveDeviceAdmin())
{ {
// deviceManger.removeActiveAdmin(compName); // DevicePolicyManager deviceManger = (DevicePolicyManager)Miscellaneous.getAnyContext().getSystemService(Context.DEVICE_POLICY_SERVICE);
// }
// else
// {
DevicePolicyManager deviceManger = (DevicePolicyManager)Miscellaneous.getAnyContext().getSystemService(Context.DEVICE_POLICY_SERVICE);
ComponentName compName = new ComponentName(ActivityPermissions.getInstance(), DeviceAdmin.class) ; ComponentName compName = new ComponentName(ActivityPermissions.getInstance(), DeviceAdmin.class) ;
Intent intent = new Intent(DevicePolicyManager.ACTION_ADD_DEVICE_ADMIN ); Intent intent = new Intent(DevicePolicyManager.ACTION_ADD_DEVICE_ADMIN );
@ -341,9 +336,6 @@ public class ActivityPermissions extends Activity
addToArrayListUnique("android.permission.RECEIVE_BOOT_COMPLETED", requiredPermissions); addToArrayListUnique("android.permission.RECEIVE_BOOT_COMPLETED", requiredPermissions);
*/ */
// if (!havePermission(ActivityPermissions.writeExternalStoragePermissionName, workingContext))
// addToArrayListUnique(ActivityPermissions.writeExternalStoragePermissionName, requiredPermissions);
if(!havePermission(Manifest.permission.WRITE_SETTINGS, workingContext)) if(!havePermission(Manifest.permission.WRITE_SETTINGS, workingContext))
{ {
for (Profile profile : Profile.getProfileCollection()) for (Profile profile : Profile.getProfileCollection())

View File

@ -0,0 +1 @@
* Behoben: Stumm-Modus konnte nicht geschaltet werden.

View File

@ -0,0 +1 @@
* Fixed: Silent mode did not set on newer phones.

View File

@ -0,0 +1 @@
* Corregido: El modo silencioso no se configuró en los teléfonos más nuevos.

View File

@ -0,0 +1 @@
* Risolto: la modalità silenziosa non è stata impostata sui telefoni più recenti.

View File

@ -0,0 +1 @@
* Opgelost: Stille modus is niet ingesteld op nieuwere telefoons.