|
@@ -33,30 +33,30 @@ public class PresentationManager {
|
|
|
}
|
|
|
|
|
|
public static void checkAndShow(Context context){
|
|
|
- Timber.e("checkAndShow");
|
|
|
- if(PresentationManager.canMuteScreen(context)){
|
|
|
- Timber.e("canMuteScreen");
|
|
|
- if(PresentationManager.permissionsMuteScreen(context)){
|
|
|
- Timber.e("permissionsMuteScreen");
|
|
|
- if(!PresentationManager.hasInit())PresentationManager.instanceInit(DisplayWelcome.class,context);
|
|
|
- PresentationManager.show();
|
|
|
- }else{
|
|
|
- if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) {
|
|
|
- new AlertDialog.Builder(context).setTitle("开启副屏权限")
|
|
|
- .setMessage("需要打开在其他应用上层显示,请去设置中开启此权限")
|
|
|
- .setNegativeButton("取消",null)
|
|
|
- .setPositiveButton("开启", new DialogInterface.OnClickListener() {
|
|
|
- @Override
|
|
|
- public void onClick(DialogInterface dialog, int which) {
|
|
|
- Intent intent = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION);
|
|
|
- intent.setData(Uri.parse("package:" + context.getPackageName()));
|
|
|
- context.startActivity(intent);
|
|
|
- }
|
|
|
- }).create().show();
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
+// Timber.e("checkAndShow");
|
|
|
+// if(PresentationManager.canMuteScreen(context)){
|
|
|
+// Timber.e("canMuteScreen");
|
|
|
+// if(PresentationManager.permissionsMuteScreen(context)){
|
|
|
+// Timber.e("permissionsMuteScreen");
|
|
|
+// if(!PresentationManager.hasInit())PresentationManager.instanceInit(DisplayWelcome.class,context);
|
|
|
+// PresentationManager.show();
|
|
|
+// }else{
|
|
|
+// if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) {
|
|
|
+// new AlertDialog.Builder(context).setTitle("开启副屏权限")
|
|
|
+// .setMessage("需要打开在其他应用上层显示,请去设置中开启此权限")
|
|
|
+// .setNegativeButton("取消",null)
|
|
|
+// .setPositiveButton("开启", new DialogInterface.OnClickListener() {
|
|
|
+// @Override
|
|
|
+// public void onClick(DialogInterface dialog, int which) {
|
|
|
+// Intent intent = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION);
|
|
|
+// intent.setData(Uri.parse("package:" + context.getPackageName()));
|
|
|
+// context.startActivity(intent);
|
|
|
+// }
|
|
|
+// }).create().show();
|
|
|
+// }
|
|
|
+//
|
|
|
+// }
|
|
|
+// }
|
|
|
}
|
|
|
|
|
|
public static boolean canMuteScreen(Context context){
|