Skip to content

Commit

Permalink
CHG: [droid] reorganize java sources
Browse files Browse the repository at this point in the history
  • Loading branch information
koying committed Feb 2, 2018
1 parent 5e7bfa4 commit 459c1e6
Show file tree
Hide file tree
Showing 21 changed files with 64 additions and 88 deletions.
28 changes: 14 additions & 14 deletions project/cmake/scripts/android/Install.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,27 +31,30 @@ set(package_files strings.xml
searchable.xml
AndroidManifest.xml
build.gradle
src/Splash.java
src/XBMCVideoView.java
src/XBMCBroadcastReceiver.java
src/XBMCJsonRPC.java
src/XBMCFile.java
src/XBMCMediaSession.java
src/XBMCRecommendationBuilder.java
src/XBMCProperties.java
src/XBMCSettingsContentObserver.java
src/activities/Splash.java
src/activities/Main.java
src/activities/Service.java
src/activities/XBMCCrashHandler.java
src/activities/XBMCProjection.java
src/activities/XBMCSearchableActivity.java
src/channels/SyncChannelJobService.java
src/channels/SyncProgramsJobService.java
src/channels/model/XBMCDatabase.java
src/channels/model/Subscription.java
src/channels/util/SharedPreferencesHelper.java
src/channels/util/TvUtil.java
src/XBMCCrashHandler.java
src/Main.java
src/XBMCProjection.java
src/XBMCMediaSession.java
src/interfaces/XBMCSurfaceTextureOnFrameAvailableListener.java
src/interfaces/XBMCNsdManagerResolveListener.java
src/interfaces/XBMCAudioManagerOnAudioFocusChangeListener.java
src/interfaces/XBMCNsdManagerRegistrationListener.java
src/interfaces/XBMCNsdManagerDiscoveryListener.java
src/interfaces/XBMCInputDeviceListener.java
src/XBMCBroadcastReceiver.java
src/model/TVEpisode.java
src/model/Movie.java
src/model/TVShow.java
Expand All @@ -60,16 +63,13 @@ set(package_files strings.xml
src/model/Song.java
src/model/MusicVideo.java
src/model/Media.java
src/XBMCSearchableActivity.java
src/XBMCRecommendationBuilder.java
src/XBMCProperties.java
src/content/XBMCFileContentProvider.java
src/content/XBMCMediaContentProvider.java
src/content/XBMCContentProvider.java
src/content/XBMCYTDLContentProvider.java
src/XBMCSettingsContentObserver.java
src/XBMCMainView.java
src/Service.java
src/content/XBMCFile.java
src/views/XBMCMainView.java
src/views/XBMCVideoView.java
)
foreach(file IN LISTS package_files)
configure_file(${CORE_SOURCE_DIR}/tools/android/packaging/xbmc/${file}.in
Expand Down
10 changes: 5 additions & 5 deletions tools/android/packaging/xbmc/AndroidManifest.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
android:label="@string/app_name"
android:logo="@drawable/banner">
<activity
android:name=".Splash"
android:name=".activities.Splash"
android:configChanges="orientation|keyboard|keyboardHidden|navigation|touchscreen|screenLayout|screenSize"
android:finishOnTaskLaunch="true"
android:launchMode="singleInstance"
Expand Down Expand Up @@ -93,7 +93,7 @@
This will take care of integrating with our NDK code.
-->
<activity
android:name=".Main"
android:name=".activities.Main"
android:configChanges="orientation|keyboard|keyboardHidden|navigation|touchscreen|screenLayout|screenSize"
android:finishOnTaskLaunch="true"
android:label="@string/app_name"
Expand All @@ -109,7 +109,7 @@
android:value="@APP_NAME_LC@" />
</activity>
<activity
android:name=".XBMCCrashHandler"
android:name=".activities.XBMCCrashHandler"
android:configChanges="keyboard|keyboardHidden|orientation"
android:exported="false"
android:process=":XBMCCrashHandler"
Expand Down Expand Up @@ -137,7 +137,7 @@
android:authorities="@APP_PACKAGE@.ytdl"
android:exported="true" />

<activity android:name=".XBMCSearchableActivity">
<activity android:name=".activities.XBMCSearchableActivity">
<intent-filter>
<action android:name="android.intent.action.SEARCH" />

Expand Down Expand Up @@ -165,7 +165,7 @@
android:exported="false"
android:permission="android.permission.BIND_JOB_SERVICE" />
<service
android:name=".Service"
android:name=".activities.Service"
android:enabled="true"
android:exported="true"/>
</application>
Expand Down
41 changes: 0 additions & 41 deletions tools/android/packaging/xbmc/src/KeepAliveService.java.in

This file was deleted.

1 change: 1 addition & 0 deletions tools/android/packaging/xbmc/src/XBMCJsonRPC.java.in
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import android.net.Uri;
import android.provider.BaseColumns;
import android.util.Log;

import @APP_PACKAGE@.activities.Splash;
import @APP_PACKAGE@.content.XBMCYTDLContentProvider;
import @APP_PACKAGE@.model.Album;
import @APP_PACKAGE@.model.Movie;
Expand Down
4 changes: 1 addition & 3 deletions tools/android/packaging/xbmc/src/XBMCMediaSession.java.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package @APP_PACKAGE@;

import android.app.Activity;
import android.app.PendingIntent;
import android.content.Intent;
import android.media.MediaMetadata;
Expand All @@ -10,8 +9,7 @@ import android.media.session.PlaybackState;
import android.os.Build;
import android.util.Log;

import java.util.concurrent.Callable;
import java.util.concurrent.FutureTask;
import @APP_PACKAGE@.activities.Main;

import static android.media.Rating.RATING_5_STARS;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package @APP_PACKAGE@;
package @APP_PACKAGE@.activities;

import android.app.AlarmManager;
import android.app.AlertDialog;
Expand All @@ -22,7 +22,6 @@ import android.media.projection.MediaProjectionManager;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Handler;
import android.support.media.tv.TvContractCompat;
import android.text.Html;
import android.util.Log;
import android.view.Choreographer;
Expand All @@ -31,8 +30,14 @@ import android.view.View;
import android.widget.RelativeLayout;
import android.widget.TextView;

import @APP_PACKAGE@.R;
import @APP_PACKAGE@.XBMCBroadcastReceiver;
import @APP_PACKAGE@.XBMCJsonRPC;
import @APP_PACKAGE@.XBMCProperties;
import @APP_PACKAGE@.XBMCSettingsContentObserver;
import @APP_PACKAGE@.channels.util.TvUtil;
import @APP_PACKAGE@.interfaces.XBMCInputDeviceListener;
import @APP_PACKAGE@.views.XBMCMainView;

import java.text.MessageFormat;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package @APP_PACKAGE@;
package @APP_PACKAGE@.activities;

import android.app.Notification;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.IBinder;

import @APP_PACKAGE@.R;

public class Service extends android.app.Service
{
native boolean _launchApplication();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package @APP_PACKAGE@;
package @APP_PACKAGE@.activities;

import java.io.BufferedOutputStream;
import java.io.File;
Expand Down Expand Up @@ -44,6 +44,9 @@ import android.content.BroadcastReceiver;
import android.content.IntentFilter;
import android.os.Environment;

import @APP_PACKAGE@.R;
import @APP_PACKAGE@.XBMCProperties;

public class Splash extends Activity
{

Expand Down Expand Up @@ -797,7 +800,7 @@ public class Splash extends Activity
{
// Run @APP_NAME@
Intent intent = getIntent();
intent.setClass(this, @APP_PACKAGE@.Main.class);
intent.setClass(this, Main.class);
intent.addFlags(Intent.FLAG_ACTIVITY_PREVIOUS_IS_TOP);
startActivity(intent);

Expand All @@ -819,7 +822,7 @@ public class Splash extends Activity
.getRunningTasks(Integer.MAX_VALUE);
for (RunningTaskInfo task : tasks)
if (task.topActivity.toString().equalsIgnoreCase(
"ComponentInfo{@APP_PACKAGE@/@APP_PACKAGE@.Main}"))
"ComponentInfo{@APP_PACKAGE@/@APP_PACKAGE@.activities.Main}"))
{
// @APP_NAME@ already running; just activate it
startXBMC();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package @APP_PACKAGE@;
package @APP_PACKAGE@.activities;

import android.app.Activity;
import android.app.AlertDialog;
Expand All @@ -19,6 +19,9 @@ import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;

import @APP_PACKAGE@.R;
import @APP_PACKAGE@.XBMCProperties;

import org.json.JSONObject;

import java.io.BufferedReader;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package @APP_PACKAGE@;
package @APP_PACKAGE@.activities;

import android.graphics.Bitmap;
import android.graphics.PixelFormat;
Expand All @@ -11,6 +11,9 @@ import android.media.projection.MediaProjection;
import android.os.Handler;
import android.os.Looper;

import @APP_PACKAGE@.XBMCProperties;
import @APP_PACKAGE@.activities.Main;

import java.io.FileOutputStream;
import java.nio.ByteBuffer;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package @APP_PACKAGE@;
package @APP_PACKAGE@.activities;

import android.content.Intent;
import android.database.Cursor;
Expand All @@ -10,6 +10,10 @@ import android.widget.SimpleCursorAdapter;
import android.util.Log;
import android.widget.ListView;

import @APP_PACKAGE@.R;
import @APP_PACKAGE@.XBMCJsonRPC;
import @APP_PACKAGE@.activities.Main;

public class XBMCSearchableActivity extends Activity
{

Expand Down Expand Up @@ -67,7 +71,7 @@ public class XBMCSearchableActivity extends Activity

Intent newIntent = new Intent(origIntent.getAction(), data);
newIntent.setDataAndType(data, "video/*");
newIntent.setClass(this, @APP_PACKAGE@.Main.class);
newIntent.setClass(this, Main.class);
newIntent.addFlags(Intent.FLAG_ACTIVITY_PREVIOUS_IS_TOP);
startActivity(newIntent);
finish();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import android.support.media.tv.PreviewProgram;
import android.support.media.tv.TvContractCompat;
import android.util.Log;

import @APP_PACKAGE@.Splash;
import @APP_PACKAGE@.activities.Splash;
import @APP_PACKAGE@.XBMCJsonRPC;
import @APP_PACKAGE@.model.Movie;
import @APP_PACKAGE@.model.TVEpisode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import android.support.media.tv.ChannelLogoUtils;
import android.support.media.tv.TvContractCompat;
import android.util.Log;

import @APP_PACKAGE@.Splash;
import @APP_PACKAGE@.activities.Splash;
import @APP_PACKAGE@.channels.SyncChannelJobService;
import @APP_PACKAGE@.channels.SyncProgramsJobService;
import @APP_PACKAGE@.channels.model.Subscription;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package @APP_PACKAGE@;
package @APP_PACKAGE@.content;

import android.util.Log;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import android.net.Uri;
import android.os.ParcelFileDescriptor;
import android.util.Log;

import @APP_PACKAGE@.XBMCFile;
import @APP_PACKAGE@.XBMCJsonRPC;
import @APP_PACKAGE@.model.File;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package @APP_PACKAGE@;
package @APP_PACKAGE@.views;

import android.content.Context;
import android.graphics.PixelFormat;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
package @APP_PACKAGE@;
package @APP_PACKAGE@.views;

import android.graphics.Color;
import android.graphics.PixelFormat;
import android.graphics.Rect;
import android.util.Log;
import android.view.Surface;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.view.View;
import android.widget.RelativeLayout;

import @APP_PACKAGE@.activities.Main;
import @APP_PACKAGE@.R;

import java.util.concurrent.Callable;
import java.util.concurrent.FutureTask;

Expand Down
2 changes: 1 addition & 1 deletion xbmc/platform/android/activity/JNIXBMCFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

using namespace jni;

static std::string s_className = std::string(CCompileInfo::GetClass()) + "/XBMCFile";
static std::string s_className = std::string(CCompileInfo::GetClass()) + "/content/XBMCFile";

CJNIXBMCFile::CJNIXBMCFile()
: CJNIBase()
Expand Down
2 changes: 1 addition & 1 deletion xbmc/platform/android/activity/JNIXBMCMainView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

using namespace jni;

static std::string s_className = std::string(CCompileInfo::GetClass()) + "/XBMCMainView";
static std::string s_className = std::string(CCompileInfo::GetClass()) + "/views/XBMCMainView";
CEvent CJNIXBMCMainView::m_surfaceCreated;
CJNIXBMCMainView* CJNIXBMCMainView::m_instance = nullptr;

Expand Down
2 changes: 1 addition & 1 deletion xbmc/platform/android/activity/JNIXBMCVideoView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

using namespace jni;

static std::string s_className = std::string(CCompileInfo::GetClass()) + "/XBMCVideoView";
static std::string s_className = std::string(CCompileInfo::GetClass()) + "/views/XBMCVideoView";

void CJNIXBMCVideoView::RegisterNatives(JNIEnv* env)
{
Expand Down
Loading

0 comments on commit 459c1e6

Please sign in to comment.