Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor tv android app into platfor-app(in preperation to add content-app) #17378

Merged
merged 2 commits into from
Apr 14, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/tv-app/android/App/.idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/tv-app/android/App/.idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions examples/tv-app/android/App/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ android {
compileSdk 30

defaultConfig {
applicationId "com.tcl.chip.chiptvserver"
applicationId "com.matter.tv.server"
minSdk 24
targetSdk 30
versionCode 1
Expand Down Expand Up @@ -39,7 +39,7 @@ android {

sourceSets {
main {
jniLibs.srcDirs = ['libs/jniLibs']
jniLibs.srcDirs = ['../app/libs/jniLibs']

// uncomment this code to debug
// java.srcDirs = [
Expand All @@ -54,7 +54,7 @@ android {
}

dependencies {
implementation fileTree(dir: "libs", include: ["*.jar","*.so"])
implementation fileTree(dir: "../app/libs", include: ["*.jar","*.so"])
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.1'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.tcl.chip.chiptvserver;
package com.matter.tv.server;

import static org.junit.Assert.*;

Expand All @@ -19,6 +19,6 @@ public class ExampleInstrumentedTest {
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("com.tcl.chip.chiptvslave", appContext.getPackageName());
assertEquals("com.matter.tv.server", appContext.getPackageName());
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.tcl.chip.chiptvserver">
package="com.matter.tv.server">

<uses-permission android:name="android.permission.BLUETOOTH"/>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
Expand All @@ -19,17 +19,17 @@
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:name=".ChipTvServerApplication"
android:theme="@style/Theme.CHIPTVSlave">
<activity android:name=".MainActivity"
android:name="com.matter.tv.server.MatterTvServerApplication"
android:theme="@style/Theme.MatterTVSlave">
<activity android:name="com.matter.tv.server.MainActivity"
android:launchMode="singleTask">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service android:name=".service.MatterServantService" />
<service android:name="com.matter.tv.server.service.MatterServantService" />
</application>

</manifest>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.tcl.chip.chiptvserver;
package com.matter.tv.server;

import android.graphics.Bitmap;
import android.os.Bundle;
Expand All @@ -10,7 +10,7 @@
import chip.setuppayload.DiscoveryCapability;
import chip.setuppayload.SetupPayload;
import chip.setuppayload.SetupPayloadParser;
import com.tcl.chip.chiptvserver.service.MatterServant;
import com.matter.tv.server.service.MatterServant;
import java.util.HashSet;

public class MainActivity extends AppCompatActivity {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package com.tcl.chip.chiptvserver;
package com.matter.tv.server;

import android.app.Application;
import android.content.Intent;
import android.os.Build;
import com.tcl.chip.chiptvserver.service.MatterServantService;
import com.matter.tv.server.service.MatterServantService;

public class ChipTvServerApplication extends Application {
public class MatterTvServerApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.tcl.chip.chiptvserver;
package com.matter.tv.server;

import android.graphics.Bitmap;
import android.graphics.Color;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*
*/
package com.tcl.chip.chiptvserver.service;
package com.matter.tv.server.service;

import android.content.Context;
import androidx.annotation.NonNull;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.tcl.chip.chiptvserver.service;
package com.matter.tv.server.service;

import android.app.Notification;
import android.app.NotificationChannel;
Expand All @@ -10,8 +10,8 @@
import android.os.IBinder;
import androidx.annotation.Nullable;
import androidx.core.app.NotificationCompat;
import com.tcl.chip.chiptvserver.MainActivity;
import com.tcl.chip.chiptvserver.R;
import com.matter.tv.server.MainActivity;
import com.matter.tv.server.R;

public class MatterServantService extends Service {
private static final String CHANNEL_ID = "Matter";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
tools:context="com.matter.tv.server.MainActivity">

<TextView
android:id="@+id/qrCodeTxt"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Theme.CHIPTVSlave" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<style name="Theme.MatterTVSlave" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/purple_200</item>
<item name="colorPrimaryVariant">@color/purple_700</item>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<resources>
<string name="app_name">MatterTVServer</string>
</resources>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Theme.CHIPTVSlave" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<style name="Theme.MatterTVSlave" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/purple_500</item>
<item name="colorPrimaryVariant">@color/purple_700</item>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.tcl.chip.chiptvserver;
package com.matter.tv.server;

import static org.junit.Assert.*;

Expand Down
4 changes: 2 additions & 2 deletions examples/tv-app/android/App/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
rootProject.name = "CHIPTVServer"
include ':app'
rootProject.name = "MatterTVAndroid"
include ':platform-app'
2 changes: 2 additions & 0 deletions scripts/build/build/targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,8 @@ def AndroidTargets():
yield target.Extend('androidstudio-x64-chip-tool', board=AndroidBoard.AndroidStudio_X64, app=AndroidApp.CHIP_TOOL)
yield target.Extend('arm64-chip-tvserver', board=AndroidBoard.ARM64, app=AndroidApp.CHIP_TVServer)
yield target.Extend('arm-chip-tvserver', board=AndroidBoard.ARM, app=AndroidApp.CHIP_TVServer)
yield target.Extend('x86-chip-tvserver', board=AndroidBoard.X86, app=AndroidApp.CHIP_TVServer)
andy31415 marked this conversation as resolved.
Show resolved Hide resolved
yield target.Extend('x64-chip-tvserver', board=AndroidBoard.X64, app=AndroidApp.CHIP_TVServer)
yield target.Extend('arm64-chip-tv-casting-app', board=AndroidBoard.ARM64, app=AndroidApp.CHIP_TV_CASTING_APP)
yield target.Extend('arm-chip-tv-casting-app', board=AndroidBoard.ARM, app=AndroidApp.CHIP_TV_CASTING_APP)

Expand Down