Skip to content

Commit

Permalink
add : log exporter activity ( hidden )
Browse files Browse the repository at this point in the history
  • Loading branch information
EmiyaSyahriel committed Jul 1, 2024
1 parent 8eb06e1 commit 83da647
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 0 deletions.
19 changes: 19 additions & 0 deletions launcher_app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
>

<application>
<activity
android:name=".activities.XmbExportLog"
android:exported="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name_export_log"
>
<intent-filter>
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package id.psw.vshlauncher.activities

import android.app.Activity
import android.content.Intent
import android.os.Bundle
import id.psw.vshlauncher.Logger
import java.io.File
import java.io.FileOutputStream
import java.text.SimpleDateFormat
import java.util.Locale
import java.util.Calendar

class XmbExportLog: Activity() {
companion object
{
const val RQ_PATH_ASKING = 10241
}

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
startActivityForResult(Logger.createExportIntent(), RQ_PATH_ASKING)
}

override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
if(requestCode == RQ_PATH_ASKING)
{
if(resultCode == RESULT_OK)
{
data?.data?.also {
Logger.exportLog(this, it)
}
}

finish()
}
}
}
4 changes: 4 additions & 0 deletions launcher_app/src/debug/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?>
<resources xmlns:tools="http://schemas.android.com/tools" tools:ignore="MissingTranslation">
<string name="app_name_export_log">CXL Export Log</string>
</resources>
1 change: 1 addition & 0 deletions launcher_app/src/main/java/id/psw/vshlauncher/Vsh.kt
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ class Vsh : Application() {
const val COPY_DATA_SIZE_BUFFER = 10240
const val ACT_REQ_INSTALL_PACKAGE = 4496
const val ACT_REQ_MEDIA_LISTING = 0x9121
const val ACT_REQ_LOG_EXPORT = 0x6200
const val ITEM_BUILTIN_ICON_BITMAP_SIZE = 300

val dbgMemInfo = Debug.MemoryInfo()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,15 @@ class Xmb : AppCompatActivity() {
vsh.M.audio.loadPickedMenuBgm(data)
}
}
Vsh.ACT_REQ_LOG_EXPORT ->
{
if(resultCode == RESULT_OK && data != null)
{
data.data?.also {
Logger.exportLog(this, it)
}
}
}
MediaListingSubmodule.RQI_PICK_PHOTO_DIR -> {
if(resultCode == RESULT_OK){
if(data != null){
Expand Down

0 comments on commit 83da647

Please sign in to comment.