IntentCompat.java 3.19 KB
package android.support.v4.content;

import android.content.ComponentName;
import android.content.Intent;
import android.os.Build.VERSION;

public final class IntentCompat
{
  public static final String ACTION_EXTERNAL_APPLICATIONS_AVAILABLE = "android.intent.action.EXTERNAL_APPLICATIONS_AVAILABLE";
  public static final String ACTION_EXTERNAL_APPLICATIONS_UNAVAILABLE = "android.intent.action.EXTERNAL_APPLICATIONS_UNAVAILABLE";
  public static final String CATEGORY_LEANBACK_LAUNCHER = "android.intent.category.LEANBACK_LAUNCHER";
  public static final String EXTRA_CHANGED_PACKAGE_LIST = "android.intent.extra.changed_package_list";
  public static final String EXTRA_CHANGED_UID_LIST = "android.intent.extra.changed_uid_list";
  public static final String EXTRA_HTML_TEXT = "android.intent.extra.HTML_TEXT";
  public static final int FLAG_ACTIVITY_CLEAR_TASK = 32768;
  public static final int FLAG_ACTIVITY_TASK_ON_HOME = 16384;
  private static final a a = new b();
  
  static
  {
    int i = Build.VERSION.SDK_INT;
    if (i >= 15)
    {
      a = new d();
      return;
    }
    if (i >= 11)
    {
      a = new c();
      return;
    }
  }
  
  public static Intent makeMainActivity(ComponentName paramComponentName)
  {
    return a.a(paramComponentName);
  }
  
  public static Intent makeMainSelectorActivity(String paramString1, String paramString2)
  {
    return a.a(paramString1, paramString2);
  }
  
  public static Intent makeRestartActivityTask(ComponentName paramComponentName)
  {
    return a.b(paramComponentName);
  }
  
  static abstract interface a
  {
    public abstract Intent a(ComponentName paramComponentName);
    
    public abstract Intent a(String paramString1, String paramString2);
    
    public abstract Intent b(ComponentName paramComponentName);
  }
  
  static class b
    implements IntentCompat.a
  {
    public Intent a(ComponentName paramComponentName)
    {
      Intent localIntent = new Intent("android.intent.action.MAIN");
      localIntent.setComponent(paramComponentName);
      localIntent.addCategory("android.intent.category.LAUNCHER");
      return localIntent;
    }
    
    public Intent a(String paramString1, String paramString2)
    {
      paramString1 = new Intent(paramString1);
      paramString1.addCategory(paramString2);
      return paramString1;
    }
    
    public Intent b(ComponentName paramComponentName)
    {
      paramComponentName = a(paramComponentName);
      paramComponentName.addFlags(268468224);
      return paramComponentName;
    }
  }
  
  static class c
    extends IntentCompat.b
  {
    public final Intent a(ComponentName paramComponentName)
    {
      return Intent.makeMainActivity(paramComponentName);
    }
    
    public final Intent b(ComponentName paramComponentName)
    {
      return Intent.makeRestartActivityTask(paramComponentName);
    }
  }
  
  static final class d
    extends IntentCompat.c
  {
    public final Intent a(String paramString1, String paramString2)
    {
      return Intent.makeMainSelectorActivity(paramString1, paramString2);
    }
  }
}


/* Location:              /home/merong/decompile/hackery-dex2jar.jar!/android/support/v4/content/IntentCompat.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */