Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions controller/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
so a single mechanism keeps the terminal input above the keyboard. -->
<activity
android:name=".TerminalActivity"
android:theme="@style/Theme.IIABController.Terminal"
android:exported="false"
android:launchMode="singleTop"
android:configChanges="orientation|screenSize|screenLayout|keyboardHidden" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public void onReceive(Context context, Intent intent) {
if (nm != null) {
ensureChannel(nm);
NotificationCompat.Builder builder = new NotificationCompat.Builder(context, CHANNEL_ID)
.setSmallIcon(android.R.drawable.ic_dialog_info)
.setSmallIcon(R.drawable.ic_stat_k2go)
.setContentTitle("Pairing initiated")
.setContentText("Returning to app...");
nm.notify(NOTIFICATION_ID, builder.build());
Expand Down Expand Up @@ -98,7 +98,7 @@ private void performNativePairing(Context context, String hostIp, int pairingPor
if (nmReturn != null) {
ensureChannel(nmReturn);
NotificationCompat.Builder rb = new NotificationCompat.Builder(context, CHANNEL_ID)
.setSmallIcon(android.R.drawable.ic_dialog_info)
.setSmallIcon(R.drawable.ic_stat_k2go)
.setContentTitle("Paired")
.setContentText("Tap to return to K2Go")
.setAutoCancel(true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ private Notification buildNotification() {
return new NotificationCompat.Builder(this, CHANNEL_ID)
.setContentTitle(getString(R.string.terminal_notif_title))
.setContentText(getString(R.string.terminal_notif_text))
.setSmallIcon(android.R.drawable.ic_menu_view)
.setSmallIcon(R.drawable.ic_stat_k2go)
.setContentIntent(pending)
.setPriority(NotificationCompat.PRIORITY_LOW)
.setOngoing(true) // cannot be swiped away while a session is alive
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,8 @@ private Notification createNotification() {

return new NotificationCompat.Builder(this, CHANNEL_ID)
.setContentTitle(getString(R.string.watchdog_notif_title))
.setContentText("Protecting critical background operations...")
.setSmallIcon(android.R.drawable.ic_lock_idle_lock)
.setContentText(getString(R.string.watchdog_notif_text))
.setSmallIcon(R.drawable.ic_stat_tethering)
.setContentIntent(pendingIntent)
.setPriority(NotificationCompat.PRIORITY_LOW)
.setOngoing(true) // Cannot be swiped away by the user
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ private Notification buildNotification(@Nullable String contentText) {
return new NotificationCompat.Builder(this, CHANNEL_ID)
.setContentTitle(getString(R.string.k2go_cx_delete_notif_title))
.setContentText(text)
.setSmallIcon(android.R.drawable.ic_menu_delete)
.setSmallIcon(R.drawable.ic_stat_k2go)
.setOngoing(true)
.setPriority(NotificationCompat.PRIORITY_LOW)
.setOnlyAlertOnce(true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ private Notification buildNotification(@Nullable String contentText) {
return new NotificationCompat.Builder(this, CHANNEL_ID)
.setContentTitle(getString(R.string.k2go_cx_export_notif_title))
.setContentText(text)
.setSmallIcon(android.R.drawable.stat_sys_upload)
.setSmallIcon(R.drawable.ic_stat_k2go)
.setOngoing(true)
.setPriority(NotificationCompat.PRIORITY_LOW)
.setOnlyAlertOnce(true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,7 @@ private Notification buildNotification(@Nullable String contentText) {
return new NotificationCompat.Builder(this, CHANNEL_ID)
.setContentTitle(getString(R.string.k2go_cx_import_notif_title))
.setContentText(text)
.setSmallIcon(android.R.drawable.stat_sys_download)
.setSmallIcon(R.drawable.ic_stat_k2go)
.setOngoing(true)
.setPriority(NotificationCompat.PRIORITY_LOW)
.setOnlyAlertOnce(true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ private void pollProgress() {
nm.notify(NOTIFICATION_ID, new NotificationCompat.Builder(this, CHANNEL_ID)
.setContentTitle(getString(R.string.k2go_cx_share_notif_title))
.setContentText(getString(ShareSession.endedMessage(p)))
.setSmallIcon(android.R.drawable.stat_sys_upload_done)
.setSmallIcon(R.drawable.ic_stat_k2go)
.setAutoCancel(true)
.build());
}
Expand Down Expand Up @@ -326,7 +326,7 @@ private Notification buildNotification(String text) {
return new NotificationCompat.Builder(this, CHANNEL_ID)
.setContentTitle(getString(R.string.k2go_cx_share_notif_title))
.setContentText(text)
.setSmallIcon(android.R.drawable.stat_sys_upload)
.setSmallIcon(R.drawable.ic_stat_k2go)
.setOngoing(true)
.setPriority(NotificationCompat.PRIORITY_LOW)
.setOnlyAlertOnce(true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,7 @@ private Notification buildNotification(String text) {
NotificationCompat.Builder b = new NotificationCompat.Builder(this, CHANNEL_ID)
.setContentTitle(getString(R.string.deepop_notif_title))
.setContentText(text)
.setSmallIcon(android.R.drawable.stat_sys_download)
.setSmallIcon(R.drawable.ic_stat_k2go)
.setContentIntent(contentIntent)
.setOngoing(true)
.setPriority(NotificationCompat.PRIORITY_LOW)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ private static boolean run(Context ctx, long floorBytes, boolean forced) {
// persisted lever, and tell the user. The user re-enables the server after freeing space.
ServerLifecycleReconciler.get().setUserWantsOn(ctx, false);
report(ctx, "low_disk", "escalated_stopped", floorBytes, reaped, reclaimed, v.tripCount, null);
notifyUser(ctx, NOTIF_ID, ctx.getString(R.string.disk_guard_notif_title),
notifyUser(ctx, NOTIF_ID, R.drawable.ic_stat_storage, ctx.getString(R.string.disk_guard_notif_title),
ctx.getString(R.string.disk_guard_notif_body),
buildReportMessage(ctx, "low_disk", "escalated_stopped", reaped, reclaimed, v.tripCount, null));
Log.w(TAG, "K2GO-386: recurring disk pressure (trip " + v.tripCount + "): stopped and staying down");
Expand Down Expand Up @@ -242,7 +242,7 @@ private static boolean actOnFirehose(Context ctx, String source, int streak, Lis
long reclaimed = reclaimRunawayLog(ctx);
ServerLifecycleReconciler.get().requestReconcileNow();
report(ctx, source, "contained_firehose", 0L, reaped, reclaimed, streak, paths);
notifyUser(ctx, NOTIF_ID_FIREHOSE, ctx.getString(R.string.disk_guard_firehose_title),
notifyUser(ctx, NOTIF_ID_FIREHOSE, R.drawable.ic_stat_shield, ctx.getString(R.string.disk_guard_firehose_title),
ctx.getString(R.string.disk_guard_firehose_body),
buildReportMessage(ctx, source, "contained_firehose", reaped, reclaimed, streak, paths));
Log.w(TAG, "K2GO-386: contained recurring firehose (streak " + streak + "): reaped=" + reaped
Expand Down Expand Up @@ -372,7 +372,7 @@ private static long reclaimRunawayLog(Context ctx) {
* containment already happened. Each event kind passes its own notifId so one does not replace the
* other.
*/
private static void notifyUser(Context ctx, int notifId, String title, String body, String reportMessage) {
private static void notifyUser(Context ctx, int notifId, int icon, String title, String body, String reportMessage) {
try {
NotificationManager nm = (NotificationManager) ctx.getSystemService(Context.NOTIFICATION_SERVICE);
if (nm != null && Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
Expand All @@ -393,7 +393,7 @@ private static void notifyUser(Context ctx, int notifId, String title, String bo
.setContentTitle(title)
.setContentText(body)
.setStyle(new NotificationCompat.BigTextStyle().bigText(body))
.setSmallIcon(android.R.drawable.stat_sys_warning)
.setSmallIcon(icon)
.setPriority(NotificationCompat.PRIORITY_HIGH)
.setContentIntent(pi)
.setAutoCancel(true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ private Notification buildNotification() {
return new NotificationCompat.Builder(this, CHANNEL_ID)
.setContentTitle(getString(R.string.k2go_forgejo_seed_notif_title))
.setContentText(getString(R.string.k2go_forgejo_seed_title))
.setSmallIcon(android.R.drawable.stat_sys_download)
.setSmallIcon(R.drawable.ic_stat_k2go)
.setContentIntent(contentIntent)
.setOngoing(true)
.setPriority(NotificationCompat.PRIORITY_LOW)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public static Notification buildOngoing(Context ctx, String text, boolean instal
NotificationCompat.Builder b = new NotificationCompat.Builder(ctx, CHANNEL_ID)
.setContentTitle(ctx.getString(R.string.install_notif_title))
.setContentText(text)
.setSmallIcon(android.R.drawable.stat_sys_download)
.setSmallIcon(R.drawable.ic_stat_k2go)
.setContentIntent(contentIntent)
.setOngoing(true)
.setPriority(NotificationCompat.PRIORITY_LOW)
Expand Down Expand Up @@ -138,7 +138,7 @@ public static void postModuleFailure(Context ctx, List<String> failed) {
Notification n = new NotificationCompat.Builder(ctx, CHANNEL_ID)
.setContentTitle(ctx.getString(R.string.k2go_mod_phase_failed))
.setContentText(TextUtils.join(", ", failed))
.setSmallIcon(android.R.drawable.stat_notify_error)
.setSmallIcon(R.drawable.ic_stat_error)
.setContentIntent(pi)
.setAutoCancel(true)
.setPriority(NotificationCompat.PRIORITY_DEFAULT)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ private Notification buildNotification(String label) {
return new NotificationCompat.Builder(this, CHANNEL_ID)
.setContentTitle(getString(R.string.k2go_kolibri_dl_notif_title))
.setContentText(label)
.setSmallIcon(android.R.drawable.stat_sys_download)
.setSmallIcon(R.drawable.ic_stat_k2go)
.setContentIntent(contentIntent)
.setOngoing(true)
.setPriority(NotificationCompat.PRIORITY_LOW)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public static void clearNotice(@NonNull Context ctx) {

private static void notifyMetered(@NonNull Context ctx) {
NotificationCompat.Builder b = new NotificationCompat.Builder(ctx, CHANNEL_ID)
.setSmallIcon(android.R.drawable.stat_sys_warning)
.setSmallIcon(R.drawable.ic_stat_cell)
.setContentTitle(ctx.getString(R.string.k2go_netpolicy_switched_title))
.setContentText(ctx.getString(R.string.k2go_netpolicy_switched_msg))
.setStyle(new NotificationCompat.BigTextStyle()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ private Notification buildNotification() {
return new NotificationCompat.Builder(this, CHANNEL_ID)
.setContentTitle(getString(R.string.k2go_clone_notif_title))
.setContentText(getString(cableDone ? R.string.k2go_clone_link_usb_done : R.string.k2go_clone_notif_text))
.setSmallIcon(android.R.drawable.stat_sys_upload)
.setSmallIcon(R.drawable.ic_stat_k2go)
.setContentIntent(contentIntent)
.setOngoing(true)
.setPriority(NotificationCompat.PRIORITY_LOW)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ protected Notification buildNotification(@Nullable String contentText) {
NotificationCompat.Builder b = new NotificationCompat.Builder(this, channelId())
.setContentTitle(notifTitle())
.setContentText(text)
.setSmallIcon(android.R.drawable.stat_sys_download)
.setSmallIcon(R.drawable.ic_stat_k2go)
.setOngoing(true)
.setPriority(NotificationCompat.PRIORITY_LOW)
.setOnlyAlertOnce(true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ private Notification buildOngoing() {
NotificationCompat.Builder b = new NotificationCompat.Builder(this, CHANNEL_ID)
.setContentTitle(getString(R.string.k2go_dash_live_title))
.setContentText(progressText())
.setSmallIcon(android.R.drawable.stat_sys_download)
.setSmallIcon(R.drawable.ic_stat_k2go)
.setContentIntent(openDashboardDetail())
.setOngoing(true)
.setAutoCancel(false)
Expand All @@ -351,7 +351,7 @@ private Notification buildFinal(@StringRes int msgRes) {
return new NotificationCompat.Builder(this, CHANNEL_ID)
.setContentTitle(getString(R.string.k2go_dash_live_title))
.setContentText(getString(msgRes))
.setSmallIcon(android.R.drawable.stat_sys_download_done)
.setSmallIcon(R.drawable.ic_stat_k2go)
.setContentIntent(openDashboardDetail())
.setAutoCancel(true)
.setOngoing(false)
Expand Down
8 changes: 8 additions & 0 deletions controller/app/src/main/res/drawable/ic_stat_cell.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- K2GO-590: Material icon "signal_cellular_alt" (Apache License 2.0): downloads now use mobile data. Status bar icon: Android draws only the alpha. -->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp" android:height="24dp"
android:viewportWidth="24" android:viewportHeight="24">
<path android:fillColor="#FFFFFFFF"
android:pathData="M17,4h3v16h-3L17,4zM5,14h3v6L5,20v-6zM11,9h3v11h-3L11,9z"/>
</vector>
8 changes: 8 additions & 0 deletions controller/app/src/main/res/drawable/ic_stat_error.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- K2GO-590: Material icon "error" (Apache License 2.0): an install failed. Status bar icon: Android draws only the alpha. -->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp" android:height="24dp"
android:viewportWidth="24" android:viewportHeight="24">
<path android:fillColor="#FFFFFFFF"
android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM13,17h-2v-2h2v2zM13,13h-2L11,7h2v6z"/>
</vector>
12 changes: 12 additions & 0 deletions controller/app/src/main/res/drawable/ic_stat_k2go.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- K2GO-590: brand icon: a solid phone with the K2Go head (from the launcher icon) cut out. Status bar icon: Android draws only the alpha. -->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp" android:height="24dp"
android:viewportWidth="24" android:viewportHeight="24">
<group android:translateX="6.296" android:translateY="4.106"
android:scaleX="0.046" android:scaleY="0.046">
<path android:fillColor="#FFFFFFFF"
android:fillType="evenOdd"
android:pathData="M47.91,-45.78h152.17a54.35,54.35 0 0 1 54.35,54.35v326.09a54.35,54.35 0 0 1 -54.35,54.35h-152.17a54.35,54.35 0 0 1 -54.35,-54.35v-326.09a54.35,54.35 0 0 1 54.35,-54.35ZM97.91,-15.35h52.17a10.87,10.87 0 0 1 10.87,10.87v0.00a10.87,10.87 0 0 1 -10.87,10.87h-52.17a10.87,10.87 0 0 1 -10.87,-10.87v-0.00a10.87,10.87 0 0 1 10.87,-10.87ZM113.67,101.73c38.27-2.33,73.13,19.25,75.11,59.94.24,4.87-.57,8.78-1.65,13.42,4.03,8.03,9.22,15.47,13.47,23.35,3.93,7.29,2.22,12.37-5.09,16.16-1.86.96-3.99,1.44-5.76,2.44,0,2.2,1.12,5.22.03,7.23-.28.52-1.02,1.01-1.13,1.48-.1.43.32,1.26.36,1.84.25,4.2-2.45,4.72-3.26,8.04-.9,3.7-.07,7.35-1.31,11.44-4.22,13.91-17.56,13.98-29.71,13.34-3.01-.16-6.89-1.82-8.68,1.43-2.79,5.1-1.32,12.43-1.57,17.9-.09,1.95-1.48,3.92-3.48,4.23-.98.15-2.96.22-4.06.27-9.97.44-20.13-.21-30.08-.2-11.54,0-23.26.34-34.87-.06-4.48-.15-9.9,1.26-9.99-5.16,3.91-16.26,11.38-34.41,1.96-50.08-5.75-9.57-12.58-17.06-17-27.75-20.74-50.15,15.34-96.15,66.7-99.28ZM75.09,160.74a33.70,33.70 0 1 0 67.39,0a33.70,33.70 0 1 0 -67.39,0Z"/>
</group>
</vector>
8 changes: 8 additions & 0 deletions controller/app/src/main/res/drawable/ic_stat_shield.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- K2GO-590: Material icon "shield" (Apache License 2.0): K2Go stopped a process that ran out of control. Status bar icon: Android draws only the alpha. -->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp" android:height="24dp"
android:viewportWidth="24" android:viewportHeight="24">
<path android:fillColor="#FFFFFFFF"
android:pathData="M12,1L3,5v6c0,5.55 3.84,10.74 9,12 5.16,-1.26 9,-6.45 9,-12L21,5l-9,-4z"/>
</vector>
8 changes: 8 additions & 0 deletions controller/app/src/main/res/drawable/ic_stat_storage.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- K2GO-590: Material icon "storage" (Apache License 2.0): the storage is almost full. Status bar icon: Android draws only the alpha. -->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp" android:height="24dp"
android:viewportWidth="24" android:viewportHeight="24">
<path android:fillColor="#FFFFFFFF"
android:pathData="M2,20h20v-4L2,16v4zM4,17h2v2L4,19v-2zM2,4v4h20L22,4L2,4zM6,7L4,7L4,5h2v2zM2,14h20v-4L2,10v4zM4,11h2v2L4,13v-2z"/>
</vector>
8 changes: 8 additions & 0 deletions controller/app/src/main/res/drawable/ic_stat_tethering.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- K2GO-590: Material icon "wifi_tethering" (Apache License 2.0): the library is open to devices nearby. Status bar icon: Android draws only the alpha. -->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp" android:height="24dp"
android:viewportWidth="24" android:viewportHeight="24">
<path android:fillColor="#FFFFFFFF"
android:pathData="M12,11c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM18,13c0,-3.31 -2.69,-6 -6,-6s-6,2.69 -6,6c0,2.22 1.21,4.15 3,5.19l1,-1.74c-1.19,-0.7 -2,-1.97 -2,-3.45 0,-2.21 1.79,-4 4,-4s4,1.79 4,4c0,1.48 -0.81,2.75 -2,3.45l1,1.74c1.79,-1.04 3,-2.97 3,-5.19zM12,3C6.48,3 2,7.48 2,13c0,3.7 2.01,6.92 4.99,8.65l1,-1.73C5.61,18.53 4,15.96 4,13c0,-4.42 3.58,-8 8,-8s8,3.58 8,8c0,2.96 -1.61,5.53 -4,6.92l1,1.73c2.99,-1.73 5,-4.95 5,-8.65 0,-5.52 -4.48,-10 -10,-10z"/>
</vector>
1 change: 1 addition & 0 deletions controller/app/src/main/res/values-ar/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1689,4 +1689,5 @@
<string name="k2go_dl_held_metered">في انتظار شبكة الواي فاي. لن يستخدم التنزيل بيانات الجوال حتى تسمح بذلك.</string>
<string name="k2go_dl_held_offline">في الانتظار. التطبيق مضبوط على البقاء دون اتصال، لذلك لن يتصل التنزيل حتى تسمح بذلك.</string>
<string name="k2go_mod_phase_downloading">جارٍ التنزيل…</string>
<string name="watchdog_notif_text">K2Go قيد التشغيل. مكتبتك متاحة على هذا الهاتف.</string>
</resources>
1 change: 1 addition & 0 deletions controller/app/src/main/res/values-az/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1705,4 +1705,5 @@
<string name="k2go_dl_held_metered">Wi-Fi gözlənilir. Siz icazə verənə qədər yükləmə mobil internetdən istifadə etmir.</string>
<string name="k2go_dl_held_offline">Gözləyir. Tətbiq oflayn saxlanılır, ona görə də siz icazə verənə qədər yükləmə qoşulmur.</string>
<string name="k2go_mod_phase_downloading">Yüklənir…</string>
<string name="watchdog_notif_text">K2Go işləyir. Kitabxananız bu telefonda əlçatandır.</string>
</resources>
Loading
Loading