Advertisement
Guest User

Untitled

a guest
Nov 7th, 2017
378
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.87 KB | None | 0 0
  1. package p000;
  2.  
  3. import android.content.Context;
  4. import android.content.Intent;
  5. import android.content.pm.PackageManager;
  6. import android.content.pm.ResolveInfo;
  7. import android.net.Uri;
  8. import com.google.android.youtube.R;
  9. import java.util.ArrayList;
  10. import java.util.List;
  11.  
  12. public final class rzs {
  13.     public static Intent m18955a() {
  14.         return new Intent().setAction("android.intent.action.SEND").setType("text/plain").setFlags(524288);
  15.     }
  16.  
  17.     public static List m18956a(PackageManager packageManager) {
  18.         List arrayList = new ArrayList();
  19.         for (ResolveInfo resolveInfo : packageManager.queryIntentActivities(rzs.m18955a(), 65536)) {
  20.             if (!(resolveInfo == null || resolveInfo.activityInfo == null || resolveInfo.activityInfo.name == null || resolveInfo.activityInfo.applicationInfo == null || resolveInfo.activityInfo.applicationInfo.packageName == null)) {
  21.                 arrayList.add(resolveInfo);
  22.             }
  23.         }
  24.         return arrayList;
  25.     }
  26.  
  27.     public static void m18957a(Context context, String str, Uri uri) {
  28.         Intent b = rzs.m18958b(context, str, uri);
  29.         if (b != null) {
  30.             context.startActivity(b);
  31.         } else {
  32.             rym.m18924d("Share video error: null watch uri");
  33.         }
  34.     }
  35.  
  36.     public static Intent m18958b(Context context, String str, Uri uri) {
  37.         String e = rzt.m18978e(str);
  38.         Uri b = saj.m19005b(uri);
  39.         if (b == null) {
  40.             return null;
  41.         }
  42.         Intent createChooser = Intent.createChooser(rzs.m18961e(context, e, b), context.getText(R.string.send_video));
  43.         createChooser.addFlags(268435456);
  44.         return createChooser;
  45.     }
  46.  
  47.     public static void m18959c(Context context, String str, Uri uri) {
  48.         Intent d = rzs.m18960d(context, str, uri);
  49.         if (d != null) {
  50.             context.startActivity(d);
  51.         } else {
  52.             rym.m18924d("Share playlist error: empty playlist url");
  53.         }
  54.     }
  55.  
  56.     public static Intent m18960d(Context context, String str, Uri uri) {
  57.         if (uri == null) {
  58.             return null;
  59.         }
  60.         Intent createChooser = Intent.createChooser(rzs.m18961e(context, str, uri), context.getText(R.string.send_playlist));
  61.         createChooser.addFlags(268435456);
  62.         return createChooser;
  63.     }
  64.  
  65.     private static Intent m18961e(Context context, String str, Uri uri) {
  66.         if (str == null) {
  67.             str = context.getString(R.string.share_untitled);
  68.         }
  69.         String a = wf.m20808a().m20811a(str);
  70.         Intent a2 = rzs.m18955a();
  71.         String string = context.getString(R.string.share_subject, new Object[]{a});
  72.         a = context.getString(R.string.share_text, new Object[]{a, uri});
  73.         a2.putExtra("android.intent.extra.SUBJECT", string);
  74.         a2.putExtra("android.intent.extra.TEXT", a);
  75.         return a2;
  76.     }
  77. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement