diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index f0fbff1e63e2a..87f47a4f33f82 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -6908,13 +6908,6 @@
android:exported="false">
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml
index 1f459c6f623df..3260420dedd0a 100644
--- a/core/res/res/values/strings.xml
+++ b/core/res/res/values/strings.xml
@@ -5759,32 +5759,6 @@
Harmful app detected
-
- Allow %s to access all device logs?
-
- Allow one-time access
-
- Don\u2019t allow
-
-
- Device logs record what happens on your device. Apps can use these logs to find and fix issues.\n\nSome logs may contain sensitive info, so only allow apps you trust to access all device logs.
- \n\nIf you don’t allow this app to access all device logs, it can still access its own logs. Your device manufacturer may still be able to access some logs or info on your device.
-
-
-
- Device logs record what happens on your device. Apps can use these logs to find and fix issues.\n\nSome logs may contain sensitive info, so only allow apps you trust to access all device logs.
- \n\nIf you don’t allow this app to access all device logs, it can still access its own logs. Your device manufacturer may still be able to access some logs or info on your device.\n\nLearn more at g.co/android/devicelogs.
-
-
-
- <a href="https://support.google.com/android?p=system_logs#topic=7313011">Learn more</a>
-
-
-
-
-
- Don\u2019t show again
-
%1$s wants to show %2$s slices
diff --git a/core/res/res/values/styles.xml b/core/res/res/values/styles.xml
index 2dd563d0b843a..476c18ee0c6c9 100644
--- a/core/res/res/values/styles.xml
+++ b/core/res/res/values/styles.xml
@@ -1541,40 +1541,4 @@ please see styles_device_defaults.xml.
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index 54e4074376ebe..7b6284196bfd5 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -3938,17 +3938,6 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/packages/SystemUI/AndroidManifest.xml b/packages/SystemUI/AndroidManifest.xml
index 07e37d3f67d6e..61df65aff8d7b 100644
--- a/packages/SystemUI/AndroidManifest.xml
+++ b/packages/SystemUI/AndroidManifest.xml
@@ -986,5 +986,11 @@
+
+
+
diff --git a/core/res/res/drawable/grant_permissions_buttons_bottom.xml b/packages/SystemUI/res/drawable/grant_permissions_buttons_bottom.xml
similarity index 100%
rename from core/res/res/drawable/grant_permissions_buttons_bottom.xml
rename to packages/SystemUI/res/drawable/grant_permissions_buttons_bottom.xml
diff --git a/core/res/res/drawable/grant_permissions_buttons_top.xml b/packages/SystemUI/res/drawable/grant_permissions_buttons_top.xml
similarity index 100%
rename from core/res/res/drawable/grant_permissions_buttons_top.xml
rename to packages/SystemUI/res/drawable/grant_permissions_buttons_top.xml
diff --git a/packages/SystemUI/res/drawable/ic_doc_document.xml b/packages/SystemUI/res/drawable/ic_doc_document.xml
new file mode 100644
index 0000000000000..df9ddab9fdb01
--- /dev/null
+++ b/packages/SystemUI/res/drawable/ic_doc_document.xml
@@ -0,0 +1,24 @@
+
+
+
+
diff --git a/core/res/res/layout/log_access_user_consent_dialog_permission.xml b/packages/SystemUI/res/layout/log_access_user_consent_dialog_permission.xml
similarity index 97%
rename from core/res/res/layout/log_access_user_consent_dialog_permission.xml
rename to packages/SystemUI/res/layout/log_access_user_consent_dialog_permission.xml
index 3da14c8f18860..89e36ac933878 100644
--- a/core/res/res/layout/log_access_user_consent_dialog_permission.xml
+++ b/packages/SystemUI/res/layout/log_access_user_consent_dialog_permission.xml
@@ -75,7 +75,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/log_access_confirmation_allow"
- style="@style/PermissionGrantButtonTop"
+ style="?permissionGrantButtonTopStyle"
android:textAppearance="@style/PermissionGrantButtonTextAppearance"
android:layout_marginBottom="5dp"
android:layout_centerHorizontal="true"
@@ -89,7 +89,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/log_access_confirmation_deny"
- style="@style/PermissionGrantButtonBottom"
+ style="?permissionGrantButtonBottomStyle"
android:textAppearance="@style/PermissionGrantButtonTextAppearance"
android:layout_centerHorizontal="true"
android:layout_alignParentTop="true"
diff --git a/packages/SystemUI/res/values-television/strings.xml b/packages/SystemUI/res/values-television/strings.xml
new file mode 100644
index 0000000000000..f30b73ea6f131
--- /dev/null
+++ b/packages/SystemUI/res/values-television/strings.xml
@@ -0,0 +1,27 @@
+
+
+
+
+ Device logs record what happens on your device. Apps can use these logs to find and fix issues.\n\nSome logs may contain sensitive info, so only allow apps you trust to access all device logs.
+ \n\nIf you don’t allow this app to access all device logs, it can still access its own logs. Your device manufacturer may still be able to access some logs or info on your device.\n\nLearn more at g.co/android/devicelogs.
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/SystemUI/res/values-television/styles.xml b/packages/SystemUI/res/values-television/styles.xml
index 12020f946103b..c517845c582fb 100644
--- a/packages/SystemUI/res/values-television/styles.xml
+++ b/packages/SystemUI/res/values-television/styles.xml
@@ -63,4 +63,10 @@
- @dimen/bottom_sheet_button_padding_vertical
- @anim/tv_bottom_sheet_button_state_list_animator
+
+
+
diff --git a/packages/SystemUI/res/values/attrs.xml b/packages/SystemUI/res/values/attrs.xml
index df0659d67afee..44ba3f6e6d86c 100644
--- a/packages/SystemUI/res/values/attrs.xml
+++ b/packages/SystemUI/res/values/attrs.xml
@@ -204,5 +204,10 @@
+
+
+
+
+
diff --git a/packages/SystemUI/res/values/ids.xml b/packages/SystemUI/res/values/ids.xml
index 4fd25a98a71c0..2b6ab305542fe 100644
--- a/packages/SystemUI/res/values/ids.xml
+++ b/packages/SystemUI/res/values/ids.xml
@@ -195,5 +195,7 @@
+
+
diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml
index cbcfbf83c801b..5778e72d424bf 100644
--- a/packages/SystemUI/res/values/strings.xml
+++ b/packages/SystemUI/res/values/strings.xml
@@ -2770,4 +2770,19 @@
kk:mm
+
+
+ Allow %s to access all device logs?
+
+ Allow one-time access
+
+ Don\u2019t allow
+
+
+ Device logs record what happens on your device. Apps can use these logs to find and fix issues.\n\nSome logs may contain sensitive info, so only allow apps you trust to access all device logs.
+ \n\nIf you don’t allow this app to access all device logs, it can still access its own logs. Your device manufacturer may still be able to access some logs or info on your device.
+
+
+
+ <a href="https://support.google.com/android?p=system_logs#topic=7313011">Learn more</a>
diff --git a/packages/SystemUI/res/values/styles.xml b/packages/SystemUI/res/values/styles.xml
index e76887babc502..4e4bfe2ee8f37 100644
--- a/packages/SystemUI/res/values/styles.xml
+++ b/packages/SystemUI/res/values/styles.xml
@@ -1274,4 +1274,45 @@
- ?androidprv:attr/textColorOnAccent
- @dimen/broadcast_dialog_btn_text_size
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/core/java/com/android/internal/app/LogAccessDialogActivity.java b/packages/SystemUI/src/com/android/systemui/logcat/LogAccessDialogActivity.java
similarity index 89%
rename from core/java/com/android/internal/app/LogAccessDialogActivity.java
rename to packages/SystemUI/src/com/android/systemui/logcat/LogAccessDialogActivity.java
index 4adb8673084b7..a88a4ca58820b 100644
--- a/core/java/com/android/internal/app/LogAccessDialogActivity.java
+++ b/packages/SystemUI/src/com/android/systemui/logcat/LogAccessDialogActivity.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.internal.app;
+package com.android.systemui.logcat;
import android.annotation.StyleRes;
import android.app.Activity;
@@ -23,7 +23,6 @@ import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
-import android.content.res.Configuration;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
@@ -43,7 +42,9 @@ import android.view.View;
import android.widget.Button;
import android.widget.TextView;
-import com.android.internal.R;
+import com.android.internal.app.ILogAccessDialogCallback;
+import com.android.systemui.R;
+
/**
* Dialog responsible for obtaining user consent per-use log access
@@ -93,10 +94,7 @@ public class LogAccessDialogActivity extends Activity implements
mAlertLearnMore = getResources().getString(R.string.log_access_confirmation_learn_more);
// create View
- boolean isDarkTheme = (getResources().getConfiguration().uiMode
- & Configuration.UI_MODE_NIGHT_MASK) == Configuration.UI_MODE_NIGHT_YES;
- int themeId = isDarkTheme ? android.R.style.Theme_DeviceDefault_Dialog_Alert :
- android.R.style.Theme_DeviceDefault_Light_Dialog_Alert;
+ int themeId = R.style.LogAccessDialogTheme;
mAlertView = createView(themeId);
// create AlertDialog
@@ -177,8 +175,7 @@ public class LogAccessDialogActivity extends Activity implements
PackageManager.MATCH_DIRECT_BOOT_AUTO,
UserHandle.getUserId(uid)).loadLabel(pm);
- String titleString = context.getString(
- com.android.internal.R.string.log_access_confirmation_title, appLabel);
+ String titleString = context.getString(R.string.log_access_confirmation_title, appLabel);
return titleString;
}
@@ -235,15 +232,12 @@ public class LogAccessDialogActivity extends Activity implements
@Override
public void onClick(View view) {
try {
- switch (view.getId()) {
- case R.id.log_access_dialog_allow_button:
- mCallback.approveAccessForClient(mUid, mPackageName);
- finish();
- break;
- case R.id.log_access_dialog_deny_button:
- declineLogAccess();
- finish();
- break;
+ if (view.getId() == R.id.log_access_dialog_allow_button) {
+ mCallback.approveAccessForClient(mUid, mPackageName);
+ finish();
+ } else if (view.getId() == R.id.log_access_dialog_allow_button) {
+ declineLogAccess();
+ finish();
}
} catch (RemoteException e) {
finish();
diff --git a/packages/SystemUI/src/com/android/systemui/logcat/OWNERS b/packages/SystemUI/src/com/android/systemui/logcat/OWNERS
new file mode 100644
index 0000000000000..9c0c414011a15
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/logcat/OWNERS
@@ -0,0 +1,2 @@
+# Bug component: 1218649
+file:platform/frameworks/base:/services/core/java/com/android/server/logcat/OWNERS
\ No newline at end of file
diff --git a/services/core/java/com/android/server/logcat/LogcatManagerService.java b/services/core/java/com/android/server/logcat/LogcatManagerService.java
index fdc5bab7c6eb9..497ed0346d973 100644
--- a/services/core/java/com/android/server/logcat/LogcatManagerService.java
+++ b/services/core/java/com/android/server/logcat/LogcatManagerService.java
@@ -23,6 +23,7 @@ import android.annotation.NonNull;
import android.annotation.Nullable;
import android.app.ActivityManager;
import android.app.ActivityManagerInternal;
+import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
@@ -41,7 +42,6 @@ import android.util.Slog;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.app.ILogAccessDialogCallback;
-import com.android.internal.app.LogAccessDialogActivity;
import com.android.internal.util.ArrayUtils;
import com.android.server.LocalServices;
import com.android.server.SystemService;
@@ -62,6 +62,10 @@ import java.util.function.Supplier;
public final class LogcatManagerService extends SystemService {
private static final String TAG = "LogcatManagerService";
private static final boolean DEBUG = false;
+ private static final String TARGET_PACKAGE_NAME = "com.android.systemui";
+ private static final String TARGET_ACTIVITY_NAME =
+ "com.android.systemui.logcat.LogAccessDialogActivity";
+ public static final String EXTRA_CALLBACK = "EXTRA_CALLBACK";
/** How long to wait for the user to approve/decline before declining automatically */
@VisibleForTesting
@@ -442,6 +446,7 @@ public final class LogcatManagerService extends SystemService {
mClock.get() + PENDING_CONFIRMATION_TIMEOUT_MILLIS);
final Intent mIntent = createIntent(client);
mIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ mIntent.setComponent(new ComponentName(TARGET_PACKAGE_NAME, TARGET_ACTIVITY_NAME));
mContext.startActivityAsUser(mIntent, UserHandle.SYSTEM);
}
@@ -536,13 +541,13 @@ public final class LogcatManagerService extends SystemService {
* Create the Intent for LogAccessDialogActivity.
*/
public Intent createIntent(LogAccessClient client) {
- final Intent intent = new Intent(mContext, LogAccessDialogActivity.class);
+ final Intent intent = new Intent();
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
intent.putExtra(Intent.EXTRA_PACKAGE_NAME, client.mPackageName);
intent.putExtra(Intent.EXTRA_UID, client.mUid);
- intent.putExtra(LogAccessDialogActivity.EXTRA_CALLBACK, mDialogCallback.asBinder());
+ intent.putExtra(EXTRA_CALLBACK, mDialogCallback.asBinder());
return intent;
}