|
|
@@ -796,8 +796,43 @@ public class SysAppUtil {
|
|
|
* 启动应用的设置
|
|
|
*/
|
|
|
public static void startAppSettings(Activity activity) {
|
|
|
- Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
|
|
- intent.setData(Uri.parse("package:" + BuildConfig.APPLICATION_ID));
|
|
|
+// Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
|
|
+// intent.setData(Uri.parse("package:" + BuildConfig.APPLICATION_ID));
|
|
|
+// activity.startActivity(intent);
|
|
|
+ // vivo 点击设置图标>加速白名单>我的app
|
|
|
+ // 点击软件管理>软件管理权限>软件>我的app>信任该软件
|
|
|
+ Intent appIntent = activity.getPackageManager().getLaunchIntentForPackage("com.iqoo.secure");
|
|
|
+ if(appIntent != null){
|
|
|
+ activity.startActivity(appIntent);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ // oppo 点击设置图标>应用权限管理>按应用程序管理>我的app>我信任该应用
|
|
|
+ // 点击权限隐私>自启动管理>我的app
|
|
|
+ appIntent = activity.getPackageManager().getLaunchIntentForPackage("com.oppo.safe");
|
|
|
+ if(appIntent != null){
|
|
|
+ activity.startActivity(appIntent);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ Intent intent = new Intent();
|
|
|
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
|
|
+ intent.setAction(Settings.ACTION_APP_NOTIFICATION_SETTINGS);
|
|
|
+ intent.putExtra(Settings.EXTRA_APP_PACKAGE, activity.getPackageName());
|
|
|
+ } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
|
|
+ intent.setAction(Settings.ACTION_APP_NOTIFICATION_SETTINGS);
|
|
|
+ intent.putExtra("app_package", activity.getPackageName());
|
|
|
+ intent.putExtra("app_uid", activity.getApplicationInfo().uid);
|
|
|
+ } else if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD){
|
|
|
+ intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
|
|
+ intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
|
|
+ intent.setData(Uri.fromParts("package", activity.getPackageName(), null));
|
|
|
+ } else {
|
|
|
+ intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
|
|
+ intent.setAction(Intent.ACTION_VIEW);
|
|
|
+ intent.setClassName("com.android.settings","com.android.settings.InstalledAppDetails");
|
|
|
+ intent.putExtra("com.android.settings.ApplicationPkgName", activity.getPackageName());
|
|
|
+ }
|
|
|
activity.startActivity(intent);
|
|
|
}
|
|
|
|
|
|
@@ -892,6 +927,7 @@ public class SysAppUtil {
|
|
|
if (!ShortcutSuperUtils.isShortCutExist(activity, mShortcutName, getShortCutIntent(activity))) {
|
|
|
ShortcutUtils.addShortcut(activity, getShortCutIntent(activity), mShortcutName, false,
|
|
|
BitmapFactory.decodeResource(activity.getResources(), R.drawable.icon_yf));
|
|
|
+ showShortcutTip(activity);
|
|
|
G.showToast("添加成功");
|
|
|
} else {
|
|
|
G.showToast("已经添加成功");
|