mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
Merge pull request #14809 from highfidelity/commandLineAndroid
case 19113: Recreated changes due to CLA issue in previous pr. Adding args to int…
This commit is contained in:
commit
384d4fb959
4 changed files with 53 additions and 9 deletions
|
@ -24,6 +24,7 @@ import android.net.Uri;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Vibrator;
|
import android.os.Vibrator;
|
||||||
|
import android.text.TextUtils;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
@ -54,6 +55,7 @@ public class InterfaceActivity extends QtActivity implements WebViewFragment.OnW
|
||||||
public static final String DOMAIN_URL = "url";
|
public static final String DOMAIN_URL = "url";
|
||||||
public static final String EXTRA_GOTO_USERNAME = "gotousername";
|
public static final String EXTRA_GOTO_USERNAME = "gotousername";
|
||||||
private static final String TAG = "Interface";
|
private static final String TAG = "Interface";
|
||||||
|
public static final String EXTRA_ARGS = "args";
|
||||||
private static final int WEB_DRAWER_RIGHT_MARGIN = 262;
|
private static final int WEB_DRAWER_RIGHT_MARGIN = 262;
|
||||||
private static final int WEB_DRAWER_BOTTOM_MARGIN = 150;
|
private static final int WEB_DRAWER_BOTTOM_MARGIN = 150;
|
||||||
private static final int NORMAL_DPI = 160;
|
private static final int NORMAL_DPI = 160;
|
||||||
|
@ -78,6 +80,7 @@ public class InterfaceActivity extends QtActivity implements WebViewFragment.OnW
|
||||||
|
|
||||||
private boolean nativeEnterBackgroundCallEnqueued = false;
|
private boolean nativeEnterBackgroundCallEnqueued = false;
|
||||||
private SlidingDrawer mWebSlidingDrawer;
|
private SlidingDrawer mWebSlidingDrawer;
|
||||||
|
private boolean mStartInDomain;
|
||||||
// private GvrApi gvrApi;
|
// private GvrApi gvrApi;
|
||||||
// Opaque native pointer to the Application C++ object.
|
// Opaque native pointer to the Application C++ object.
|
||||||
// This object is owned by the InterfaceActivity instance and passed to the native methods.
|
// This object is owned by the InterfaceActivity instance and passed to the native methods.
|
||||||
|
@ -93,8 +96,14 @@ public class InterfaceActivity extends QtActivity implements WebViewFragment.OnW
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.isLoading = true;
|
super.isLoading = true;
|
||||||
Intent intent = getIntent();
|
Intent intent = getIntent();
|
||||||
if (intent.hasExtra(DOMAIN_URL) && !intent.getStringExtra(DOMAIN_URL).isEmpty()) {
|
if (intent.hasExtra(DOMAIN_URL) && !TextUtils.isEmpty(intent.getStringExtra(DOMAIN_URL))) {
|
||||||
intent.putExtra("applicationArguments", "--url " + intent.getStringExtra(DOMAIN_URL));
|
intent.putExtra("applicationArguments", "--url " + intent.getStringExtra(DOMAIN_URL));
|
||||||
|
} else if (intent.hasExtra(EXTRA_ARGS)) {
|
||||||
|
String args = intent.getStringExtra(EXTRA_ARGS);
|
||||||
|
if (!TextUtils.isEmpty(args)) {
|
||||||
|
mStartInDomain = true;
|
||||||
|
intent.putExtra("applicationArguments", args);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
|
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
|
||||||
|
@ -125,7 +134,10 @@ public class InterfaceActivity extends QtActivity implements WebViewFragment.OnW
|
||||||
getActionBar().hide();
|
getActionBar().hide();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
startActivity(new Intent(this, SplashActivity.class));
|
Intent splashIntent = new Intent(this, SplashActivity.class);
|
||||||
|
splashIntent.putExtra(SplashActivity.EXTRA_START_IN_DOMAIN, mStartInDomain);
|
||||||
|
startActivity(splashIntent);
|
||||||
|
|
||||||
mVibrator = (Vibrator) this.getSystemService(VIBRATOR_SERVICE);
|
mVibrator = (Vibrator) this.getSystemService(VIBRATOR_SERVICE);
|
||||||
headsetStateReceiver = new HeadsetStateReceiver();
|
headsetStateReceiver = new HeadsetStateReceiver();
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,7 @@ import android.content.pm.PackageManager;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
|
||||||
import org.json.JSONException;
|
import org.json.JSONException;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
@ -27,9 +28,14 @@ public class PermissionChecker extends Activity {
|
||||||
private static final boolean CHOOSE_AVATAR_ON_STARTUP = false;
|
private static final boolean CHOOSE_AVATAR_ON_STARTUP = false;
|
||||||
private static final String TAG = "Interface";
|
private static final String TAG = "Interface";
|
||||||
|
|
||||||
|
private static final String EXTRA_ARGS = "args";
|
||||||
|
private String mArgs;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
mArgs =(getIntent().getStringExtra(EXTRA_ARGS));
|
||||||
|
|
||||||
Intent myIntent = new Intent(this, BreakpadUploaderService.class);
|
Intent myIntent = new Intent(this, BreakpadUploaderService.class);
|
||||||
startService(myIntent);
|
startService(myIntent);
|
||||||
if (CHOOSE_AVATAR_ON_STARTUP) {
|
if (CHOOSE_AVATAR_ON_STARTUP) {
|
||||||
|
@ -76,6 +82,11 @@ public class PermissionChecker extends Activity {
|
||||||
|
|
||||||
private void launchActivityWithPermissions(){
|
private void launchActivityWithPermissions(){
|
||||||
Intent i = new Intent(this, InterfaceActivity.class);
|
Intent i = new Intent(this, InterfaceActivity.class);
|
||||||
|
|
||||||
|
if (!TextUtils.isEmpty(mArgs)) {
|
||||||
|
i.putExtra(EXTRA_ARGS, mArgs);
|
||||||
|
}
|
||||||
|
|
||||||
startActivity(i);
|
startActivity(i);
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,9 @@ import android.view.View;
|
||||||
|
|
||||||
public class SplashActivity extends Activity {
|
public class SplashActivity extends Activity {
|
||||||
|
|
||||||
|
public static final String EXTRA_START_IN_DOMAIN = "start-in-domain";
|
||||||
|
private boolean mStartInDomain;
|
||||||
|
|
||||||
private native void registerLoadCompleteListener();
|
private native void registerLoadCompleteListener();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -36,13 +39,27 @@ public class SplashActivity extends Activity {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onAppLoadedComplete() {
|
public void onAppLoadedComplete() {
|
||||||
if (HifiUtils.getInstance().isUserLoggedIn()) {
|
if (!mStartInDomain) {
|
||||||
startActivity(new Intent(this, MainActivity.class));
|
if (HifiUtils.getInstance().isUserLoggedIn()) {
|
||||||
} else {
|
startActivity(new Intent(this, MainActivity.class));
|
||||||
Intent menuIntent = new Intent(this, LoginMenuActivity.class);
|
} else {
|
||||||
menuIntent.putExtra(LoginMenuActivity.EXTRA_FINISH_ON_BACK, true);
|
Intent menuIntent = new Intent(this, LoginMenuActivity.class);
|
||||||
startActivity(menuIntent);
|
menuIntent.putExtra(LoginMenuActivity.EXTRA_FINISH_ON_BACK, true);
|
||||||
|
startActivity(menuIntent);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
SplashActivity.this.finish();
|
SplashActivity.this.finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onSaveInstanceState(Bundle outState) {
|
||||||
|
super.onSaveInstanceState(outState);
|
||||||
|
outState.putBoolean(EXTRA_START_IN_DOMAIN, mStartInDomain);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onRestoreInstanceState(Bundle savedInstanceState) {
|
||||||
|
super.onRestoreInstanceState(savedInstanceState);
|
||||||
|
mStartInDomain = savedInstanceState.getBoolean(EXTRA_START_IN_DOMAIN, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -333,7 +333,11 @@ if (APPLE)
|
||||||
COMMAND "${CMAKE_COMMAND}" -E copy_directory
|
COMMAND "${CMAKE_COMMAND}" -E copy_directory
|
||||||
"${PROJECT_SOURCE_DIR}/resources/fonts"
|
"${PROJECT_SOURCE_DIR}/resources/fonts"
|
||||||
"${RESOURCES_DEV_DIR}/fonts"
|
"${RESOURCES_DEV_DIR}/fonts"
|
||||||
# add redirect json to macOS builds.
|
#copy serverless for android
|
||||||
|
COMMAND "${CMAKE_COMMAND}" -E copy_directory
|
||||||
|
"${PROJECT_SOURCE_DIR}/resources/serverless"
|
||||||
|
"${RESOURCES_DEV_DIR}/serverless"
|
||||||
|
# add redirect json to macOS builds.
|
||||||
COMMAND "${CMAKE_COMMAND}" -E copy_if_different
|
COMMAND "${CMAKE_COMMAND}" -E copy_if_different
|
||||||
"${PROJECT_SOURCE_DIR}/resources/serverless/redirect.json"
|
"${PROJECT_SOURCE_DIR}/resources/serverless/redirect.json"
|
||||||
"${RESOURCES_DEV_DIR}/serverless/redirect.json"
|
"${RESOURCES_DEV_DIR}/serverless/redirect.json"
|
||||||
|
|
Loading…
Reference in a new issue