diff --git a/core/res/res/values-en-rCA/strings.xml b/core/res/res/values-en-rCA/strings.xml
index a10300e8f9fd7..b60f6e980e016 100644
--- a/core/res/res/values-en-rCA/strings.xml
+++ b/core/res/res/values-en-rCA/strings.xml
@@ -1294,10 +1294,8 @@
"Tap to see all networks"
"Connect"
"All networks"
-
-
-
-
+ "Connect to Wi‑Fi networks?"
+ "Suggested by %s"
"Yes"
"No"
"Wi‑Fi will turn on automatically"
diff --git a/core/res/res/values-en-rXC/strings.xml b/core/res/res/values-en-rXC/strings.xml
index a53135592443b..b6f6674968885 100644
--- a/core/res/res/values-en-rXC/strings.xml
+++ b/core/res/res/values-en-rXC/strings.xml
@@ -1294,10 +1294,8 @@
"Tap to see all networks"
"Connect"
"All networks"
-
-
-
-
+ "Connect to Wi‑Fi networks?"
+ "Suggested by %s"
"Yes"
"No"
"Wi‑Fi will turn on automatically"
diff --git a/packages/SettingsLib/res/values-es-rUS/strings.xml b/packages/SettingsLib/res/values-es-rUS/strings.xml
index 3b67eeadfaf7d..bdc6a1d9f9524 100644
--- a/packages/SettingsLib/res/values-es-rUS/strings.xml
+++ b/packages/SettingsLib/res/values-es-rUS/strings.xml
@@ -143,7 +143,7 @@
"Aplicaciones eliminadas"
"Aplicaciones y usuarios eliminados"
"Actualizaciones del sistema"
- "Conexión mediante USB"
+ "Conexión USB"
"Hotspot portátil"
"Conexión mediante Bluetooth"
"Compartir conexión"
diff --git a/packages/SettingsLib/res/values-hi/strings.xml b/packages/SettingsLib/res/values-hi/strings.xml
index 76097fd225313..7bba7cf4ac029 100644
--- a/packages/SettingsLib/res/values-hi/strings.xml
+++ b/packages/SettingsLib/res/values-hi/strings.xml
@@ -90,7 +90,7 @@
"संपर्क साझाकरण के लिए उपयोग करें"
"इंटरनेट कनेक्शन साझाकरण"
"लेख संदेश"
- "सिम ऐक्सेस"
+ "सिम एक्सेस"
"HD ऑडियो: %1$s"
"HD ऑडियो"
"सुनने में मदद करने वाले डिवाइस"
diff --git a/packages/SettingsLib/res/values-vi/strings.xml b/packages/SettingsLib/res/values-vi/strings.xml
index 65e3c17f308dc..9240b45d1ee13 100644
--- a/packages/SettingsLib/res/values-vi/strings.xml
+++ b/packages/SettingsLib/res/values-vi/strings.xml
@@ -204,7 +204,7 @@
"Cài đặt chia sẻ kết nối không khả dụng cho người dùng này"
"Cài đặt tên điểm truy cập không khả dụng cho người dùng này"
"Gỡ lỗi USB"
- "Chế độ gỡ lỗi khi USB được kết nối"
+ "Bật chế độ gỡ lỗi khi kết nối USB"
"Thu hồi ủy quyền gỡ lỗi USB"
"Phím tắt báo cáo lỗi"
"Hiển thị một nút trong menu nguồn để thêm báo cáo lỗi"
@@ -261,8 +261,8 @@
"Cho phép vị trí mô phỏng"
"Cho phép vị trí mô phỏng"
"Cho phép kiểm tra thuộc tính của chế độ xem"
- "Luôn giữ cho dữ liệu di động hoạt động, ngay cả khi Wi-Fi đang hoạt động (để chuyển đổi mạng nhanh)."
- "Sử dụng tăng tốc phần cứng cho chia sẻ kết nối nếu được"
+ "Luôn bật dữ liệu di động ngay cả khi Wi-Fi đang hoạt động (để chuyển đổi mạng nhanh)."
+ "Sử dụng tính năng tăng tốc phần cứng khi chia sẻ kết nối nếu có"
"Cho phép gỡ lỗi USB?"
"Gỡ lỗi USB chỉ dành cho mục đích phát triển. Hãy sử dụng tính năng này để sao chép dữ liệu giữa máy tính và thiết bị của bạn, cài đặt ứng dụng trên thiết bị của bạn mà không thông báo và đọc dữ liệu nhật ký."
"Thu hồi quyền truy cập gỡ lỗi USB từ tất cả máy tính mà bạn đã ủy quyền trước đó?"
diff --git a/packages/SystemUI/res/values-en-rCA/strings.xml b/packages/SystemUI/res/values-en-rCA/strings.xml
index 926b077fab790..10f6317423071 100644
--- a/packages/SystemUI/res/values-en-rCA/strings.xml
+++ b/packages/SystemUI/res/values-en-rCA/strings.xml
@@ -385,8 +385,8 @@
"+%d"
"Less urgent notifications below"
"Tap again to open"
- "Swipe up to unlock"
- "This device is managed by your organization"
+ "Swipe up to open"
+ "This device is managed by your organisation"
"This device is managed by %s"
"Swipe from icon for phone"
"Swipe from icon for voice assist"
diff --git a/packages/SystemUI/res/values-en-rXC/strings.xml b/packages/SystemUI/res/values-en-rXC/strings.xml
index e23236ac2244b..2383c793a3486 100644
--- a/packages/SystemUI/res/values-en-rXC/strings.xml
+++ b/packages/SystemUI/res/values-en-rXC/strings.xml
@@ -385,7 +385,7 @@
"+%d"
"Less urgent notifications below"
"Tap again to open"
- "Swipe up to unlock"
+ "Swipe up to open"
"This device is managed by your organization"
"This device is managed by %s"
"Swipe from icon for phone"
diff --git a/packages/SystemUI/src/com/android/systemui/CornerHandleView.java b/packages/SystemUI/src/com/android/systemui/CornerHandleView.java
index a94952c5bc19f..6209c2c362063 100644
--- a/packages/SystemUI/src/com/android/systemui/CornerHandleView.java
+++ b/packages/SystemUI/src/com/android/systemui/CornerHandleView.java
@@ -19,6 +19,7 @@ package com.android.systemui;
import android.animation.ArgbEvaluator;
import android.content.Context;
import android.graphics.Canvas;
+import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.RectF;
@@ -27,6 +28,7 @@ import android.util.DisplayMetrics;
import android.view.ContextThemeWrapper;
import android.view.View;
+import com.android.internal.graphics.ColorUtils;
import com.android.settingslib.Utils;
/**
@@ -107,6 +109,7 @@ public class CornerHandleView extends View {
mPaint.setColor((int) ArgbEvaluator.getInstance().evaluate(darkIntensity,
mLightColor,
mDarkColor));
+ updateShadow();
if (getVisibility() == VISIBLE) {
invalidate();
}
@@ -118,6 +121,21 @@ public class CornerHandleView extends View {
canvas.drawPath(mPath, mPaint);
}
+ private void updateShadow() {
+ if (ColorUtils.calculateLuminance(mPaint.getColor()) > 0.7f) {
+ mPaint.setShadowLayer(/** radius */ 5,/** shadowDx */ 0, /** shadowDy */ -1,
+ /** color */ ColorUtils.setAlphaComponent(/** color */ Color.BLACK,
+ /** alpha */ 102));
+ } else {
+ mPaint.setShadowLayer(/** radius */ 0, /** shadowDx */ 0, /** shadowDy */ 0,
+ /** color */ Color.TRANSPARENT);
+ }
+
+ if (getVisibility() == VISIBLE) {
+ invalidate();
+ }
+ }
+
private static float convertDpToPixel(float dp, Context context) {
return dp * ((float) context.getResources().getDisplayMetrics().densityDpi
/ DisplayMetrics.DENSITY_DEFAULT);
diff --git a/packages/SystemUI/src/com/android/systemui/assist/AssistHandleReminderExpBehavior.java b/packages/SystemUI/src/com/android/systemui/assist/AssistHandleReminderExpBehavior.java
index c5064b7e04226..bdc666de4bc71 100644
--- a/packages/SystemUI/src/com/android/systemui/assist/AssistHandleReminderExpBehavior.java
+++ b/packages/SystemUI/src/com/android/systemui/assist/AssistHandleReminderExpBehavior.java
@@ -372,11 +372,18 @@ final class AssistHandleReminderExpBehavior implements BehaviorController {
long currentTimestamp = SystemClock.uptimeMillis();
mLearningTimeElapsed += currentTimestamp - mLastLearningTimestamp;
mLastLearningTimestamp = currentTimestamp;
- Settings.Secure.putLong(
- mContext.getContentResolver(), LEARNING_TIME_ELAPSED_KEY, mLearningTimeElapsed);
mIsLearned =
mLearningCount >= getLearningCount() || mLearningTimeElapsed >= getLearningTimeMs();
+
+ mHandler.post(this::recordLearnTimeElapsed);
+ }
+
+ private void recordLearnTimeElapsed() {
+ if (mContext != null) {
+ Settings.Secure.putLong(
+ mContext.getContentResolver(), LEARNING_TIME_ELAPSED_KEY, mLearningTimeElapsed);
+ }
}
private void resetConsecutiveTaskSwitches() {
diff --git a/packages/SystemUI/src/com/android/systemui/assist/AssistManager.java b/packages/SystemUI/src/com/android/systemui/assist/AssistManager.java
index 4e82c7521bbf5..6f13e4f8bb279 100644
--- a/packages/SystemUI/src/com/android/systemui/assist/AssistManager.java
+++ b/packages/SystemUI/src/com/android/systemui/assist/AssistManager.java
@@ -19,6 +19,7 @@ import android.os.AsyncTask;
import android.os.Binder;
import android.os.Bundle;
import android.os.Handler;
+import android.os.HandlerThread;
import android.os.RemoteException;
import android.os.SystemClock;
import android.os.UserHandle;
@@ -161,8 +162,10 @@ public class AssistManager implements ConfigurationChangedReceiver {
mAssistUtils = new AssistUtils(context);
mAssistDisclosure = new AssistDisclosure(context, new Handler());
mPhoneStateMonitor = new PhoneStateMonitor(context);
- mHandleController =
- new AssistHandleBehaviorController(context, mAssistUtils, new Handler());
+ final HandlerThread assistHandleThread = new HandlerThread("AssistHandleThread");
+ assistHandleThread.start();
+ mHandleController = new AssistHandleBehaviorController(
+ context, mAssistUtils, assistHandleThread.getThreadHandler());
registerVoiceInteractionSessionListener();
mInterestingConfigChanges = new InterestingConfigChanges(ActivityInfo.CONFIG_ORIENTATION
diff --git a/packages/SystemUI/src/com/android/systemui/screenrecord/RecordingService.java b/packages/SystemUI/src/com/android/systemui/screenrecord/RecordingService.java
index a9896f51369cc..0383dee4f9c35 100644
--- a/packages/SystemUI/src/com/android/systemui/screenrecord/RecordingService.java
+++ b/packages/SystemUI/src/com/android/systemui/screenrecord/RecordingService.java
@@ -22,34 +22,34 @@ import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.Service;
+import android.content.ContentResolver;
+import android.content.ContentValues;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
+import android.graphics.Point;
import android.graphics.drawable.Icon;
import android.hardware.display.DisplayManager;
import android.hardware.display.VirtualDisplay;
import android.media.MediaRecorder;
-import android.media.ThumbnailUtils;
import android.media.projection.MediaProjection;
import android.media.projection.MediaProjectionManager;
import android.net.Uri;
-import android.os.Environment;
import android.os.IBinder;
import android.provider.MediaStore;
import android.provider.Settings;
import android.util.DisplayMetrics;
import android.util.Log;
+import android.util.Size;
import android.view.Surface;
import android.widget.Toast;
-import androidx.core.content.FileProvider;
-
import com.android.systemui.R;
import java.io.File;
import java.io.IOException;
+import java.io.OutputStream;
import java.nio.file.Files;
-import java.nio.file.Path;
import java.text.SimpleDateFormat;
import java.util.Date;
@@ -76,12 +76,10 @@ public class RecordingService extends Service {
private static final String ACTION_DELETE = "com.android.systemui.screenrecord.DELETE";
private static final int TOTAL_NUM_TRACKS = 1;
- private static final String RECORD_DIR = "Captures"; // TODO: use a translatable string
private static final int VIDEO_BIT_RATE = 6000000;
private static final int VIDEO_FRAME_RATE = 30;
private static final int AUDIO_BIT_RATE = 16;
private static final int AUDIO_SAMPLE_RATE = 44100;
- private static final String FILE_PROVIDER = "com.android.systemui.fileprovider";
private MediaProjectionManager mMediaProjectionManager;
private MediaProjection mMediaProjection;
@@ -117,11 +115,11 @@ public class RecordingService extends Service {
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
- Log.d(TAG, "RecordingService is starting");
if (intent == null) {
return Service.START_NOT_STICKY;
}
String action = intent.getAction();
+ Log.d(TAG, "onStartCommand " + action);
NotificationManager notificationManager =
(NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
@@ -157,26 +155,7 @@ public class RecordingService extends Service {
case ACTION_STOP:
stopRecording();
-
- // Move temp file to user directory
- File recordDir = new File(
- Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_MOVIES),
- RECORD_DIR);
- recordDir.mkdirs();
-
- String fileName = new SimpleDateFormat("'screen-'yyyyMMdd-HHmmss'.mp4'")
- .format(new Date());
- Path path = new File(recordDir, fileName).toPath();
-
- try {
- Files.move(mTempFile.toPath(), path);
- Notification notification = createSaveNotification(path);
- notificationManager.notify(NOTIFICATION_ID, notification);
- } catch (IOException e) {
- e.printStackTrace();
- Toast.makeText(this, R.string.screenrecord_delete_error, Toast.LENGTH_LONG)
- .show();
- }
+ saveRecording(notificationManager);
break;
case ACTION_PAUSE:
@@ -190,8 +169,7 @@ public class RecordingService extends Service {
break;
case ACTION_SHARE:
- File shareFile = new File(intent.getStringExtra(EXTRA_PATH));
- Uri shareUri = FileProvider.getUriForFile(this, FILE_PROVIDER, shareFile);
+ Uri shareUri = Uri.parse(intent.getStringExtra(EXTRA_PATH));
Intent shareIntent = new Intent(Intent.ACTION_SEND)
.setType("video/mp4")
@@ -211,20 +189,18 @@ public class RecordingService extends Service {
// Close quick shade
sendBroadcast(new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS));
- File file = new File(intent.getStringExtra(EXTRA_PATH));
- if (file.delete()) {
- Toast.makeText(
- this,
- R.string.screenrecord_delete_description,
- Toast.LENGTH_LONG).show();
+ ContentResolver resolver = getContentResolver();
+ Uri uri = Uri.parse(intent.getStringExtra(EXTRA_PATH));
+ resolver.delete(uri, null, null);
- // Remove notification
- notificationManager.cancel(NOTIFICATION_ID);
- } else {
- Log.e(TAG, "Error deleting screen recording!");
- Toast.makeText(this, R.string.screenrecord_delete_error, Toast.LENGTH_LONG)
- .show();
- }
+ Toast.makeText(
+ this,
+ R.string.screenrecord_delete_description,
+ Toast.LENGTH_LONG).show();
+
+ // Remove notification
+ notificationManager.cancel(NOTIFICATION_ID);
+ Log.d(TAG, "Deleted recording " + uri);
break;
}
return Service.START_STICKY;
@@ -295,6 +271,7 @@ public class RecordingService extends Service {
mMediaRecorder.start();
} catch (IOException e) {
+ Log.e(TAG, "Error starting screen recording: " + e.getMessage());
e.printStackTrace();
throw new RuntimeException(e);
}
@@ -352,13 +329,10 @@ public class RecordingService extends Service {
notificationManager.notify(NOTIFICATION_ID, mRecordingNotificationBuilder.build());
}
- private Notification createSaveNotification(Path path) {
- Uri saveUri = FileProvider.getUriForFile(this, FILE_PROVIDER, path.toFile());
- Log.d(TAG, "Screen recording saved to " + path.toString());
-
+ private Notification createSaveNotification(Uri uri) {
Intent viewIntent = new Intent(Intent.ACTION_VIEW)
.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_GRANT_READ_URI_PERMISSION)
- .setDataAndType(saveUri, "video/mp4");
+ .setDataAndType(uri, "video/mp4");
Notification.Action shareAction = new Notification.Action.Builder(
Icon.createWithResource(this, R.drawable.ic_android),
@@ -366,7 +340,7 @@ public class RecordingService extends Service {
PendingIntent.getService(
this,
REQUEST_CODE,
- getShareIntent(this, path.toString()),
+ getShareIntent(this, uri.toString()),
PendingIntent.FLAG_UPDATE_CURRENT))
.build();
@@ -376,7 +350,7 @@ public class RecordingService extends Service {
PendingIntent.getService(
this,
REQUEST_CODE,
- getDeleteIntent(this, path.toString()),
+ getDeleteIntent(this, uri.toString()),
PendingIntent.FLAG_UPDATE_CURRENT))
.build();
@@ -394,8 +368,15 @@ public class RecordingService extends Service {
.setAutoCancel(true);
// Add thumbnail if available
- Bitmap thumbnailBitmap = ThumbnailUtils.createVideoThumbnail(path.toString(),
- MediaStore.Video.Thumbnails.MINI_KIND);
+ Bitmap thumbnailBitmap = null;
+ try {
+ ContentResolver resolver = getContentResolver();
+ Size size = Point.convert(MediaStore.ThumbnailConstants.MINI_SIZE);
+ thumbnailBitmap = resolver.loadThumbnail(uri, size, null);
+ } catch (IOException e) {
+ Log.e(TAG, "Error creating thumbnail: " + e.getMessage());
+ e.printStackTrace();
+ }
if (thumbnailBitmap != null) {
Notification.BigPictureStyle pictureStyle = new Notification.BigPictureStyle()
.bigPicture(thumbnailBitmap)
@@ -417,6 +398,38 @@ public class RecordingService extends Service {
stopSelf();
}
+ private void saveRecording(NotificationManager notificationManager) {
+ String fileName = new SimpleDateFormat("'screen-'yyyyMMdd-HHmmss'.mp4'")
+ .format(new Date());
+
+ ContentValues values = new ContentValues();
+ values.put(MediaStore.Video.Media.DISPLAY_NAME, fileName);
+ values.put(MediaStore.Video.Media.MIME_TYPE, "video/mp4");
+ values.put(MediaStore.Video.Media.DATE_ADDED, System.currentTimeMillis());
+ values.put(MediaStore.Video.Media.DATE_TAKEN, System.currentTimeMillis());
+
+ ContentResolver resolver = getContentResolver();
+ Uri collectionUri = MediaStore.Video.Media.getContentUri(
+ MediaStore.VOLUME_EXTERNAL_PRIMARY);
+ Uri itemUri = resolver.insert(collectionUri, values);
+
+ try {
+ // Add to the mediastore
+ OutputStream os = resolver.openOutputStream(itemUri, "w");
+ Files.copy(mTempFile.toPath(), os);
+ os.close();
+
+ Notification notification = createSaveNotification(itemUri);
+ notificationManager.notify(NOTIFICATION_ID, notification);
+
+ mTempFile.delete();
+ } catch (IOException e) {
+ Log.e(TAG, "Error saving screen recording: " + e.getMessage());
+ Toast.makeText(this, R.string.screenrecord_delete_error, Toast.LENGTH_LONG)
+ .show();
+ }
+ }
+
private void setTapsVisible(boolean turnOn) {
int value = turnOn ? 1 : 0;
Settings.System.putInt(getApplicationContext().getContentResolver(),