Skip to content

Commit

Permalink
[android] Remove code responsible for InfoActivity (expo#10334)
Browse files Browse the repository at this point in the history
# Why

Follow up to expo#10333. Removes `InfoActivity` we replaced with sophisticated dev menu.

# How

Removed `InfoActivity`, its layout, assets (`dev_menu` icon) and the code that showed the activity.

# Test Plan

I have confirmed Android Expo client compiled and tapping on the app name in the persistent notification does not open the `InfoActivity`.
  • Loading branch information
sjchmiela authored Sep 24, 2020
1 parent a11a209 commit 4672828
Show file tree
Hide file tree
Showing 12 changed files with 0 additions and 323 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,15 @@

import host.exp.exponent.analytics.Analytics;
import host.exp.exponent.di.NativeModuleDepsProvider;
import host.exp.exponent.experience.BaseExperienceActivity;
import host.exp.exponent.experience.ExperienceActivity;
import host.exp.exponent.experience.InfoActivity;
import host.exp.exponent.storage.ExponentSharedPreferences;
import host.exp.exponent.kernel.Kernel;
import host.exp.expoview.Exponent;
import host.exp.expoview.R;

import static host.exp.exponent.kernel.KernelConstants.MANIFEST_URL_KEY;

public class ExponentIntentService extends IntentService {

private static final String ACTION_INFO_SCREEN = "host.exp.exponent.action.INFO_SCREEN";
private static final String ACTION_RELOAD_EXPERIENCE = "host.exp.exponent.action.RELOAD_EXPERIENCE";
private static final String ACTION_SAVE_EXPERIENCE = "host.exp.exponent.action.SAVE_EXPERIENCE";
private static final String ACTION_STAY_AWAKE = "host.exp.exponent.action.STAY_AWAKE";
Expand All @@ -50,13 +46,6 @@ public class ExponentIntentService extends IntentService {

private Handler mHandler = new Handler();

public static Intent getActionInfoScreen(Context context, String manifestUrl) {
Intent intent = new Intent(context, ExponentIntentService.class);
intent.setAction(ACTION_INFO_SCREEN);
intent.putExtra(MANIFEST_URL_KEY, manifestUrl);
return intent;
}

public static Intent getActionReloadExperience(Context context, String manifestUrl) {
Intent intent = new Intent(context, ExponentIntentService.class);
intent.setAction(ACTION_RELOAD_EXPERIENCE);
Expand Down Expand Up @@ -93,10 +82,6 @@ protected void onHandleIntent(Intent intent) {
String action = intent.getAction();
boolean isUserAction = false;
switch (action) {
case ACTION_INFO_SCREEN:
isUserAction = true;
handleActionInfoScreen(intent.getStringExtra(MANIFEST_URL_KEY));
break;
case ACTION_RELOAD_EXPERIENCE:
isUserAction = true;
handleActionReloadExperience(intent.getStringExtra(MANIFEST_URL_KEY));
Expand All @@ -120,23 +105,6 @@ protected void onHandleIntent(Intent intent) {
}
}

private void handleActionInfoScreen(String manifestUrl) {
BaseExperienceActivity activity = BaseExperienceActivity.getVisibleActivity();

if (activity != null) {
Intent infoIntent = new Intent(activity, InfoActivity.class);
infoIntent.putExtra(InfoActivity.MANIFEST_URL_KEY, manifestUrl);
infoIntent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP);
activity.startActivity(infoIntent);

Intent intent = new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
sendBroadcast(intent);
Analytics.logEventWithManifestUrl(Analytics.INFO_SCREEN, manifestUrl);
}

stopSelf();
}

private void handleActionReloadExperience(String manifestUrl) {
mKernel.reloadVisibleExperience(manifestUrl);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ public class Analytics {
public static final String ERROR_APPEARED = "ERROR_APPEARED";
public static final String EXPERIENCE_APPEARED = "EXPERIENCE_APPEARED";
public static final String LOAD_EXPERIENCE = "LOAD_EXPERIENCE";
public static final String INFO_SCREEN = "INFO_SCREEN";
public static final String RELOAD_EXPERIENCE = "RELOAD_EXPERIENCE";
public static final String SAVE_EXPERIENCE = "SAVE_EXPERIENCE";
public static final String SAVE_EXPERIENCE_ALERT = "SAVE_EXPERIENCE_ALERT";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -744,12 +744,6 @@ private void addNotification(final JSONObject options) {
remoteViews.setOnClickPendingIntent(R.id.home_image_button, PendingIntent.getActivity(this, 0,
homeIntent, 0));

// Info
// Doing PendingIntent.getActivity doesn't work here - it opens the activity in the main
// stack and not in the experience's stack
remoteViews.setOnClickPendingIntent(R.id.home_text_button, PendingIntent.getService(this, 0,
ExponentIntentService.getActionInfoScreen(this, mManifestUrl), PendingIntent.FLAG_UPDATE_CURRENT));

if (!mIsShellApp) {
// Share
// TODO: add analytics
Expand Down

This file was deleted.

129 changes: 0 additions & 129 deletions android/expoview/src/main/res/layout/info_activity.xml

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
9 changes: 0 additions & 9 deletions android/expoview/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
<resources>
<string name="app_name">Exponent</string>
<string name="info_activity_name">Info</string>
<string name="info_app_name_placeholder">App Name</string>
<string name="info_sdk_version">SDK Version: %s</string>
<string name="info_id">ID: %s</string>
<string name="info_published_time">Published Time: %s</string>
<string name="info_is_verified">Is Verified: %s</string>
<string name="info_clear_data">Clear Data</string>
<string name="info_show_manifest">Show Manifest</string>
<string name="info_hide_manifest">Hide Manifest</string>
<string name="preference_file_key">host.exp.exponent.SharedPreferences</string>
<string name="error_header">Something went wrong.</string>
<string name="error_default_client">Sorry about that. You can go back to Expo home or try to reload the Experience.</string>
Expand Down
6 changes: 0 additions & 6 deletions template-files/android/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -256,12 +256,6 @@
android:screenOrientation="portrait">
</activity>

<activity
android:name=".experience.InfoActivity"
android:screenOrientation="portrait"
android:theme="@style/Theme.Exponent.Light">
</activity>

<activity
android:name="com.facebook.FacebookActivity"
android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
Expand Down

0 comments on commit 4672828

Please sign in to comment.