App extends Application { public static boolean isInstalledOnSDCard(Context context) { PackageInfo pInfo; try { pInfo = context.getPackageManager().getPackageInfo(context.getPackageName(), PackageManager.GET_META_DATA); return (pInfo.applicationInfo.flags & ApplicationInfo.FLAG_EXTERNAL_STORAGE) != 0; } catch (PackageManager.NameNotFoundException e) { Log.e(TAG, "error", e); return false; } }  @Override void onCreate(); @Subscribe void autoBackupSettingsChanged(final AutoBackupSettingsChangedEvent event); static void register(Object listener); static void unregister(Object listener); static void post(Object event); @Nullable static String getVersionName(Context context); @SuppressWarnings("deprecation") static int getVersionCode(Context context); static boolean isInstalledOnSDCard(Context context); static final boolean LOCAL_LOGV; static final String TAG; static final String LOG; static final String CHANNEL_ID; static boolean gcmAvailable; }
@Test public void shouldTestOnSDCARD() throws Exception { assertThat(App.isInstalledOnSDCard(RuntimeEnvironment.application)).isFalse(); }