Tabnine Logo
VNotificationManager
Code IndexAdd Tabnine to your IDE (free)

How to use
VNotificationManager
in
com.lody.virtual.client.ipc

Best Java code snippets using com.lody.virtual.client.ipc.VNotificationManager (Showing top 20 results out of 315)

origin: android-hacker/VirtualXposed

  private void postNotification(int userId, int id, String pkg, Notification notification) {
    id = VNotificationManager.get().dealNotificationId(id, pkg, null, userId);
    String tag = VNotificationManager.get().dealNotificationTag(id, pkg, null, userId);
//        VNotificationManager.get().dealNotification(id, notification, pkg);
    VNotificationManager.get().addNotification(id, tag, pkg, userId);
    try {
      nm.notify(tag, id, notification);
    } catch (Throwable e) {
      e.printStackTrace();
    }
  }

origin: android-hacker/VirtualXposed

  @Override
  public Object call(Object who, Method method, Object... args) throws Throwable {
    String pkg = (String) args[0];
    if (getHostPkg().equals(pkg)) {
      return method.invoke(who, args);
    }
    return VNotificationManager.get().areNotificationsEnabledForPackage(pkg, getAppUserId());
  }
}
origin: android-hacker/VirtualXposed

  @Override
  public Object call(Object who, Method method, Object... args) throws Throwable {
    String pkg = MethodParameterUtils.replaceFirstAppPkg(args);
    if (VirtualCore.get().isAppInstalled(pkg)) {
      VNotificationManager.get().cancelAllNotification(pkg, getAppUserId());
      return 0;
    }
    return method.invoke(who, args);
  }
}
origin: android-hacker/VirtualXposed

private void cancelNotification(int userId, int id, String pkg) {
  id = VNotificationManager.get().dealNotificationId(id, pkg, null, userId);
  String tag = VNotificationManager.get().dealNotificationTag(id, pkg, null, userId);
  nm.cancel(tag, id);
}
origin: android-hacker/VirtualXposed

public boolean areNotificationsEnabledForPackage(String packageName, int userId) {
  try {
    return getService().areNotificationsEnabledForPackage(packageName, userId);
  } catch (RemoteException e) {
    e.printStackTrace();
    return true;
  }
}
origin: android-hacker/VirtualXposed

  @Override
  public Object call(Object who, Method method, Object... args) throws Throwable {
    String pkg = (String) args[0];
    if (getHostPkg().equals(pkg)) {
      return method.invoke(who, args);
    }
    int enableIndex = ArrayUtils.indexOfFirst(args, Boolean.class);
    boolean enable = (boolean) args[enableIndex];
    VNotificationManager.get().setNotificationsEnabledForPackage(pkg, enable, getAppUserId());
    return 0;
  }
}
origin: android-hacker/VirtualXposed

  VLog.e(getClass().getSimpleName(), "Unknown flag : " + args[4]);
VNotificationManager.get().dealNotification(id, notification, getAppPkg());
origin: android-hacker/VirtualXposed

  @Override
  public Object call(Object who, Method method, Object... args) throws Throwable {
    String pkg = MethodParameterUtils.replaceFirstAppPkg(args);
    if (getHostPkg().equals(pkg)) {
      return method.invoke(who, args);
    }
    String tag = (String) args[1];
    int id = (int) args[2];
    id = VNotificationManager.get().dealNotificationId(id, pkg, tag, getAppUserId());
    tag = VNotificationManager.get().dealNotificationTag(id, pkg, tag, getAppUserId());
    args[1] = tag;
    args[2] = id;
    return method.invoke(who, args);
  }
}
origin: android-hacker/VirtualXposed

public int dealNotificationId(int id, String packageName, String tag, int userId) {
  try {
    return getService().dealNotificationId(id, packageName, tag, userId);
  } catch (RemoteException e) {
    e.printStackTrace();
  }
  return id;
}
origin: bzsome/VirtualApp-x326

  @Override
  public Object call(Object who, Method method, Object... args) throws Throwable {
    String pkg = (String) args[0];
    if (getHostPkg().equals(pkg)) {
      return method.invoke(who, args);
    }
    int enableIndex = ArrayUtils.indexOfFirst(args, Boolean.class);
    boolean enable = (boolean) args[enableIndex];
    VNotificationManager.get().setNotificationsEnabledForPackage(pkg, enable, getAppUserId());
    return 0;
  }
}
origin: bzsome/VirtualApp-x326

  VLog.e(getClass().getSimpleName(), "Unknown flag : " + args[4]);
VNotificationManager.get().dealNotification(id, notification, getAppPkg());
origin: android-hacker/VirtualXposed

  @Override
  public Object call(Object who, Method method, Object... args) throws Throwable {
    String pkg = (String) args[0];
    if (getHostPkg().equals(pkg)) {
      return method.invoke(who, args);
    }
    int notificationIndex = ArrayUtils.indexOfFirst(args, Notification.class);
    int idIndex = ArrayUtils.indexOfFirst(args, Integer.class);
    int id = (int) args[idIndex];
    id = VNotificationManager.get().dealNotificationId(id, pkg, null, getAppUserId());
    args[idIndex] = id;
    Notification notification = (Notification) args[notificationIndex];
    if (!VNotificationManager.get().dealNotification(id, notification, pkg)) {
      return 0;
    }
    VNotificationManager.get().addNotification(id, null, pkg, getAppUserId());
    args[0] = getHostPkg();
    return method.invoke(who, args);
  }
}
origin: bzsome/VirtualApp-x326

private void cancelNotification(int userId, int id, String pkg) {
  id = VNotificationManager.get().dealNotificationId(id, pkg, null, userId);
  String tag = VNotificationManager.get().dealNotificationTag(id, pkg, null, userId);
  nm.cancel(tag, id);
}
origin: android-hacker/VirtualXposed

public String dealNotificationTag(int id, String packageName, String tag, int userId) {
  try {
    return getService().dealNotificationTag(id, packageName, tag, userId);
  } catch (RemoteException e) {
    e.printStackTrace();
  }
  return tag;
}
origin: darkskygit/VirtualApp

  @Override
  public Object call(Object who, Method method, Object... args) throws Throwable {
    String pkg = (String) args[0];
    if (getHostPkg().equals(pkg)) {
      return method.invoke(who, args);
    }
    int enableIndex = ArrayUtils.indexOfFirst(args, Boolean.class);
    boolean enable = (boolean) args[enableIndex];
    VNotificationManager.get().setNotificationsEnabledForPackage(pkg, enable, getAppUserId());
    return 0;
  }
}
origin: bzsome/VirtualApp-x326

  @Override
  public Object call(Object who, Method method, Object... args) throws Throwable {
    String pkg = (String) args[0];
    if (getHostPkg().equals(pkg)) {
      return method.invoke(who, args);
    }
    return VNotificationManager.get().areNotificationsEnabledForPackage(pkg, getAppUserId());
  }
}
origin: darkskygit/VirtualApp

  @Override
  public Object call(Object who, Method method, Object... args) throws Throwable {
    String pkg = MethodParameterUtils.replaceFirstAppPkg(args);
    if (VirtualCore.get().isAppInstalled(pkg)) {
      VNotificationManager.get().cancelAllNotification(pkg, getAppUserId());
      return 0;
    }
    return method.invoke(who, args);
  }
}
origin: darkskygit/VirtualApp

  VLog.e(getClass().getSimpleName(), "Unknown flag : " + args[4]);
VNotificationManager.get().dealNotification(id, notification, getAppPkg());
origin: android-hacker/VirtualXposed

  @Override
  public Object call(Object who, Method method, Object... args) throws Throwable {
    String pkg = (String) args[0];
    if (getHostPkg().equals(pkg)) {
      return method.invoke(who, args);
    }
    int notificationIndex = ArrayUtils.indexOfFirst(args, Notification.class);
    int idIndex = ArrayUtils.indexOfFirst(args, Integer.class);
    int tagIndex = (Build.VERSION.SDK_INT >= 18 ? 2 : 1);
    int id = (int) args[idIndex];
    String tag = (String) args[tagIndex];
    id = VNotificationManager.get().dealNotificationId(id, pkg, tag, getAppUserId());
    tag = VNotificationManager.get().dealNotificationTag(id, pkg, tag, getAppUserId());
    args[idIndex] = id;
    args[tagIndex] = tag;
    //key(tag,id)
    Notification notification = (Notification) args[notificationIndex];
    if (!VNotificationManager.get().dealNotification(id, notification, pkg)) {
      return 0;
    }
    VNotificationManager.get().addNotification(id, tag, pkg, getAppUserId());
    args[0] = getHostPkg();
    if (Build.VERSION.SDK_INT >= 18 && args[1] instanceof String) {
      args[1] = getHostPkg();
    }
    return method.invoke(who, args);
  }
}
origin: darkskygit/VirtualApp

private void cancelNotification(int userId, int id, String pkg) {
  id = VNotificationManager.get().dealNotificationId(id, pkg, null, userId);
  String tag = VNotificationManager.get().dealNotificationTag(id, pkg, null, userId);
  nm.cancel(tag, id);
}
com.lody.virtual.client.ipcVNotificationManager

Javadoc

Fake notification manager

Most used methods

  • addNotification
  • areNotificationsEnabledForPackage
  • cancelAllNotification
  • dealNotification
  • dealNotificationId
  • dealNotificationTag
  • get
  • getService
  • setNotificationsEnabledForPackage

Popular in Java

  • Reading from database using SQL prepared statement
  • runOnUiThread (Activity)
  • requestLocationUpdates (LocationManager)
  • onCreateOptionsMenu (Activity)
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now