diff options
| author | 2022-10-25 16:31:58 -0700 | |
|---|---|---|
| committer | 2022-11-07 19:54:17 +0000 | |
| commit | fc13cb1d680d57ea6401e2d45dfb1e46bf046fc7 (patch) | |
| tree | dddc028f7a64587237d107e96c04cb2f54c734a9 /packages/SystemUI | |
| parent | 05d894c1b37202d9052ec0bd8e126b424776f962 (diff) | |
Generate consent dialog when device log access is requested in SystemUI
This change is to implement device log access dialog from SystemUI rather than
system server.
Bug: 238434889, 244173014
Test: GtsVerifier
Ignore-AOSP-First: migration of device log access dialog
Change-Id: I17058c008084f91099cd45a51ec8d8fbab1d78bb
Diffstat (limited to 'packages/SystemUI')
13 files changed, 529 insertions, 0 deletions
diff --git a/packages/SystemUI/AndroidManifest.xml b/packages/SystemUI/AndroidManifest.xml index 07e37d3f67d6..61df65aff8d7 100644 --- a/packages/SystemUI/AndroidManifest.xml +++ b/packages/SystemUI/AndroidManifest.xml @@ -986,5 +986,11 @@ <action android:name="com.android.systemui.action.DISMISS_VOLUME_PANEL_DIALOG" /> </intent-filter> </receiver> + + <activity android:name=".logcat.LogAccessDialogActivity" + android:theme="@android:style/Theme.Translucent.NoTitleBar" + android:excludeFromRecents="true" + android:exported="false"> + </activity> </application> </manifest> diff --git a/packages/SystemUI/res/drawable/grant_permissions_buttons_bottom.xml b/packages/SystemUI/res/drawable/grant_permissions_buttons_bottom.xml new file mode 100644 index 000000000000..a800f15b297e --- /dev/null +++ b/packages/SystemUI/res/drawable/grant_permissions_buttons_bottom.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + ~ Copyright (C) 2022 The Android Open Source Project + ~ + ~ Licensed under the Apache License, Version 2.0 (the "License"); + ~ you may not use this file except in compliance with the License. + ~ You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License. + --> + +<shape xmlns:android="http://schemas.android.com/apk/res/android" + android:shape="rectangle"> + <solid android:color="@android:color/system_accent1_100"/> + <corners android:topLeftRadius="4dp" android:topRightRadius="4dp" + android:bottomLeftRadius="12dp" android:bottomRightRadius="12dp"/> +</shape>
\ No newline at end of file diff --git a/packages/SystemUI/res/drawable/grant_permissions_buttons_top.xml b/packages/SystemUI/res/drawable/grant_permissions_buttons_top.xml new file mode 100644 index 000000000000..2bf803e340ec --- /dev/null +++ b/packages/SystemUI/res/drawable/grant_permissions_buttons_top.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + ~ Copyright (C) 2022 The Android Open Source Project + ~ + ~ Licensed under the Apache License, Version 2.0 (the "License"); + ~ you may not use this file except in compliance with the License. + ~ You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License. + --> + +<shape xmlns:android="http://schemas.android.com/apk/res/android" + android:shape="rectangle"> + <solid android:color="@android:color/system_accent1_100"/> + <corners android:topLeftRadius="12dp" android:topRightRadius="12dp" + android:bottomLeftRadius="4dp" android:bottomRightRadius="4dp"/> +</shape>
\ No newline at end of file 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 000000000000..df9ddab9fdb0 --- /dev/null +++ b/packages/SystemUI/res/drawable/ic_doc_document.xml @@ -0,0 +1,24 @@ +<!-- +Copyright (C) 2022 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="24dp" + android:height="24dp" + android:viewportWidth="24.0" + android:viewportHeight="24.0"> + <path + android:fillColor="#FF4883F3" + android:pathData="M19 3H5c-1.1 0,-2 .9,-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2,-.9 2,-2V5c0,-1.1,-.9,-2,-2,-2zm-1.99 6H7V7h10.01v2zm0 4H7v-2h10.01v2zm-3 4H7v-2h7.01v2z"/> +</vector> diff --git a/packages/SystemUI/res/layout/log_access_user_consent_dialog_permission.xml b/packages/SystemUI/res/layout/log_access_user_consent_dialog_permission.xml new file mode 100644 index 000000000000..89e36ac93387 --- /dev/null +++ b/packages/SystemUI/res/layout/log_access_user_consent_dialog_permission.xml @@ -0,0 +1,101 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* +** Copyright 2022, The Android Open Source Project +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ +--> +<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="380dp" + android:layout_height="match_parent" + android:clipToPadding="false"> + <LinearLayout + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical" + android:gravity="center" + android:paddingLeft="24dp" + android:paddingRight="24dp" + android:paddingTop="24dp" + android:paddingBottom="24dp"> + + <ImageView + android:id="@+id/log_access_image_view" + android:layout_width="32dp" + android:layout_height="32dp" + android:layout_marginBottom="16dp" + android:src="@drawable/ic_doc_document" + tools:layout_editor_absoluteX="148dp" + tools:layout_editor_absoluteY="35dp" + android:gravity="center" /> + + <TextView + android:id="@+id/log_access_dialog_title" + android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:layout_marginBottom="32dp" + android:text="@string/log_access_confirmation_title" + android:textAppearance="@style/AllowLogAccess" + android:textColor="?android:attr/textColorPrimary" + android:gravity="center" /> + + <TextView + android:id="@+id/log_access_dialog_body" + android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:layout_marginBottom="40dp" + android:text="@string/log_access_confirmation_body" + android:textAppearance="@style/PrimaryAllowLogAccess" + android:textColor="?android:attr/textColorPrimary" + android:gravity="center" /> + + <Space + android:layout_width="match_parent" + android:layout_height="0dp" + android:layout_weight="1" /> + + <LinearLayout + android:orientation="vertical" + android:layout_width="match_parent" + android:layout_height="wrap_content"> + <Button + android:id="@+id/log_access_dialog_allow_button" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:text="@string/log_access_confirmation_allow" + style="?permissionGrantButtonTopStyle" + android:textAppearance="@style/PermissionGrantButtonTextAppearance" + android:layout_marginBottom="5dp" + android:layout_centerHorizontal="true" + android:layout_alignParentTop="true" + android:layout_alignParentBottom="true" + android:clipToOutline="true" + android:gravity="center" /> + + <Button + android:id="@+id/log_access_dialog_deny_button" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:text="@string/log_access_confirmation_deny" + style="?permissionGrantButtonBottomStyle" + android:textAppearance="@style/PermissionGrantButtonTextAppearance" + android:layout_centerHorizontal="true" + android:layout_alignParentTop="true" + android:layout_alignParentBottom="true" + android:clipToOutline="true" + android:gravity="center" /> + </LinearLayout> + </LinearLayout> +</ScrollView> diff --git a/packages/SystemUI/res/values-television/strings.xml b/packages/SystemUI/res/values-television/strings.xml new file mode 100644 index 000000000000..f30b73ea6f13 --- /dev/null +++ b/packages/SystemUI/res/values-television/strings.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/** + * Copyright (c) 2022, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +--> +<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> + <!-- Content for the log access confirmation dialog. [CHAR LIMIT=NONE]--> + <string name="log_access_confirmation_body">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. + </string> + + <!-- Learn more URL for the log access confirmation dialog. [DO NOT TRANSLATE]--> + <string name="log_access_confirmation_learn_more" translatable="false"></string> +</resources>
\ 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 12020f946103..c517845c582f 100644 --- a/packages/SystemUI/res/values-television/styles.xml +++ b/packages/SystemUI/res/values-television/styles.xml @@ -63,4 +63,10 @@ <item name="android:paddingVertical">@dimen/bottom_sheet_button_padding_vertical</item> <item name="android:stateListAnimator">@anim/tv_bottom_sheet_button_state_list_animator</item> </style> + + <!-- The style for log access consent button --> + <style name="LogAccessDialogTheme" parent="@android:style/Theme.DeviceDefault.Dialog.Alert"> + <item name="permissionGrantButtonTopStyle">?android:buttonBarButtonStyle</item> + <item name="permissionGrantButtonBottomStyle">?android:buttonBarButtonStyle</item> + </style> </resources> diff --git a/packages/SystemUI/res/values/attrs.xml b/packages/SystemUI/res/values/attrs.xml index df0659d67afe..44ba3f6e6d86 100644 --- a/packages/SystemUI/res/values/attrs.xml +++ b/packages/SystemUI/res/values/attrs.xml @@ -204,5 +204,10 @@ <attr name="passwordTextAppearance" format="reference" /> <attr name="errorTextAppearance" format="reference"/> </declare-styleable> + + <declare-styleable name="LogAccessPermissionGrantDialog"> + <attr name="permissionGrantButtonTopStyle" format="reference"/> + <attr name="permissionGrantButtonBottomStyle" format="reference"/> + </declare-styleable> </resources> diff --git a/packages/SystemUI/res/values/ids.xml b/packages/SystemUI/res/values/ids.xml index 4fd25a98a71c..2b6ab305542f 100644 --- a/packages/SystemUI/res/values/ids.xml +++ b/packages/SystemUI/res/values/ids.xml @@ -195,5 +195,7 @@ <item type="id" name="pm_lite"/> <item type="id" name="settings_button_container"/> + <item type="id" name="log_access_dialog_allow_button" /> + <item type="id" name="log_access_dialog_deny_button" /> </resources> diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml index cbcfbf83c801..5778e72d424b 100644 --- a/packages/SystemUI/res/values/strings.xml +++ b/packages/SystemUI/res/values/strings.xml @@ -2770,4 +2770,19 @@ <!-- Time format for the Dream Time Complication for 24-hour time format [CHAR LIMIT=NONE] --> <string name="dream_time_complication_24_hr_time_format">kk:mm</string> + + <!-- Title for the log access confirmation dialog. [CHAR LIMIT=NONE] --> + <string name="log_access_confirmation_title">Allow <xliff:g id="log_access_app_name" example="Example App">%s</xliff:g> to access all device logs?</string> + <!-- Label for the allow button on the log access confirmation dialog. [CHAR LIMIT=40] --> + <string name="log_access_confirmation_allow">Allow one-time access</string> + <!-- Label for the deny button on the log access confirmation dialog. [CHAR LIMIT=20] --> + <string name="log_access_confirmation_deny">Don\u2019t allow</string> + + <!-- Content for the log access confirmation dialog. [CHAR LIMIT=NONE]--> + <string name="log_access_confirmation_body">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. + </string> + + <!-- Learn more URL for the log access confirmation dialog. [DO NOT TRANSLATE]--> + <string name="log_access_confirmation_learn_more" translatable="false"><a href="https://support.google.com/android?p=system_logs#topic=7313011">Learn more</a></string> </resources> diff --git a/packages/SystemUI/res/values/styles.xml b/packages/SystemUI/res/values/styles.xml index e76887babc50..4e4bfe2ee8f3 100644 --- a/packages/SystemUI/res/values/styles.xml +++ b/packages/SystemUI/res/values/styles.xml @@ -1274,4 +1274,45 @@ <item name="android:textColor">?androidprv:attr/textColorOnAccent</item> <item name="android:textSize">@dimen/broadcast_dialog_btn_text_size</item> </style> + + + <!-- The style for log access consent dialog --> + <style name="LogAccessDialogTheme" parent="@style/Theme.SystemUI.Dialog.Alert"> + <item name="permissionGrantButtonTopStyle">@style/PermissionGrantButtonTop</item> + <item name="permissionGrantButtonBottomStyle">@style/PermissionGrantButtonBottom</item> + </style> + + <style name="AllowLogAccess"> + <item name="android:textSize">24sp</item> + <item name="android:fontFamily">@*android:string/config_headlineFontFamily</item> + </style> + + <style name="PrimaryAllowLogAccess"> + <item name="android:textSize">14sp</item> + <item name="android:fontFamily">@*android:string/config_headlineFontFamily</item> + </style> + + <style name="PermissionGrantButtonTextAppearance"> + <item name="android:fontFamily">@*android:string/config_headlineFontFamilyMedium</item> + <item name="android:textSize">14sp</item> + <item name="android:textColor">@android:color/system_neutral1_900</item> + </style> + + <style name="PermissionGrantButtonTop" + parent="@android:style/Widget.DeviceDefault.Button.Borderless.Colored"> + <item name="android:layout_width">332dp</item> + <item name="android:layout_height">56dp</item> + <item name="android:layout_marginTop">2dp</item> + <item name="android:layout_marginBottom">2dp</item> + <item name="android:background">@drawable/grant_permissions_buttons_top</item> + </style> + + <style name="PermissionGrantButtonBottom" + parent="@android:style/Widget.DeviceDefault.Button.Borderless.Colored"> + <item name="android:layout_width">332dp</item> + <item name="android:layout_height">56dp</item> + <item name="android:layout_marginTop">2dp</item> + <item name="android:layout_marginBottom">2dp</item> + <item name="android:background">@drawable/grant_permissions_buttons_bottom</item> + </style> </resources> diff --git a/packages/SystemUI/src/com/android/systemui/logcat/LogAccessDialogActivity.java b/packages/SystemUI/src/com/android/systemui/logcat/LogAccessDialogActivity.java new file mode 100644 index 000000000000..a88a4ca58820 --- /dev/null +++ b/packages/SystemUI/src/com/android/systemui/logcat/LogAccessDialogActivity.java @@ -0,0 +1,254 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.systemui.logcat; + +import android.annotation.StyleRes; +import android.app.Activity; +import android.app.AlertDialog; +import android.content.Context; +import android.content.Intent; +import android.content.pm.PackageManager; +import android.content.pm.PackageManager.NameNotFoundException; +import android.os.Build; +import android.os.Bundle; +import android.os.Handler; +import android.os.RemoteException; +import android.os.UserHandle; +import android.text.Html; +import android.text.Spannable; +import android.text.TextUtils; +import android.text.method.LinkMovementMethod; +import android.text.style.TypefaceSpan; +import android.text.style.URLSpan; +import android.util.Slog; +import android.view.ContextThemeWrapper; +import android.view.InflateException; +import android.view.LayoutInflater; +import android.view.View; +import android.widget.Button; +import android.widget.TextView; + +import com.android.internal.app.ILogAccessDialogCallback; +import com.android.systemui.R; + + +/** + * Dialog responsible for obtaining user consent per-use log access + */ +public class LogAccessDialogActivity extends Activity implements + View.OnClickListener { + private static final String TAG = LogAccessDialogActivity.class.getSimpleName(); + public static final String EXTRA_CALLBACK = "EXTRA_CALLBACK"; + + + private static final int DIALOG_TIME_OUT = Build.IS_DEBUGGABLE ? 60000 : 300000; + private static final int MSG_DISMISS_DIALOG = 0; + + private String mPackageName; + private int mUid; + private ILogAccessDialogCallback mCallback; + + private String mAlertTitle; + private String mAlertBody; + private String mAlertLearnMore; + private AlertDialog.Builder mAlertDialog; + private AlertDialog mAlert; + private View mAlertView; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + // retrieve Intent extra information + if (!readIntentInfo(getIntent())) { + Slog.e(TAG, "Invalid Intent extras, finishing"); + finish(); + return; + } + + // retrieve the title string from passed intent extra + try { + mAlertTitle = getTitleString(this, mPackageName, mUid); + } catch (NameNotFoundException e) { + Slog.e(TAG, "Unable to fetch label of package " + mPackageName, e); + declineLogAccess(); + finish(); + return; + } + + mAlertBody = getResources().getString(R.string.log_access_confirmation_body); + mAlertLearnMore = getResources().getString(R.string.log_access_confirmation_learn_more); + + // create View + int themeId = R.style.LogAccessDialogTheme; + mAlertView = createView(themeId); + + // create AlertDialog + mAlertDialog = new AlertDialog.Builder(this, themeId); + mAlertDialog.setView(mAlertView); + mAlertDialog.setOnCancelListener(dialog -> declineLogAccess()); + mAlertDialog.setOnDismissListener(dialog -> finish()); + + // show Alert + mAlert = mAlertDialog.create(); + mAlert.getWindow().setHideOverlayWindows(true); + mAlert.show(); + + // set Alert Timeout + mHandler.sendEmptyMessageDelayed(MSG_DISMISS_DIALOG, DIALOG_TIME_OUT); + } + + @Override + protected void onDestroy() { + super.onDestroy(); + if (!isChangingConfigurations() && mAlert != null && mAlert.isShowing()) { + mAlert.dismiss(); + } + mAlert = null; + } + + private boolean readIntentInfo(Intent intent) { + if (intent == null) { + Slog.e(TAG, "Intent is null"); + return false; + } + + mCallback = ILogAccessDialogCallback.Stub.asInterface( + intent.getExtras().getBinder(EXTRA_CALLBACK)); + if (mCallback == null) { + Slog.e(TAG, "Missing callback"); + return false; + } + + mPackageName = intent.getStringExtra(Intent.EXTRA_PACKAGE_NAME); + if (mPackageName == null || mPackageName.length() == 0) { + Slog.e(TAG, "Missing package name extra"); + return false; + } + + if (!intent.hasExtra(Intent.EXTRA_UID)) { + Slog.e(TAG, "Missing EXTRA_UID"); + return false; + } + + mUid = intent.getIntExtra(Intent.EXTRA_UID, 0); + + return true; + } + + private Handler mHandler = new Handler() { + public void handleMessage(android.os.Message msg) { + switch (msg.what) { + case MSG_DISMISS_DIALOG: + if (mAlert != null) { + mAlert.dismiss(); + mAlert = null; + declineLogAccess(); + } + break; + + default: + break; + } + } + }; + + private String getTitleString(Context context, String callingPackage, int uid) + throws NameNotFoundException { + PackageManager pm = context.getPackageManager(); + + CharSequence appLabel = pm.getApplicationInfoAsUser(callingPackage, + PackageManager.MATCH_DIRECT_BOOT_AUTO, + UserHandle.getUserId(uid)).loadLabel(pm); + + String titleString = context.getString(R.string.log_access_confirmation_title, appLabel); + + return titleString; + } + + private Spannable styleFont(String text) { + Spannable s = (Spannable) Html.fromHtml(text); + for (URLSpan span : s.getSpans(0, s.length(), URLSpan.class)) { + TypefaceSpan typefaceSpan = new TypefaceSpan("google-sans"); + s.setSpan(typefaceSpan, s.getSpanStart(span), s.getSpanEnd(span), 0); + } + return s; + } + + /** + * Returns the dialog view. + * If we cannot retrieve the package name, it returns null and we decline the full device log + * access + */ + private View createView(@StyleRes int themeId) { + Context themedContext = new ContextThemeWrapper(this, themeId); + final View view = LayoutInflater.from(themedContext).inflate( + R.layout.log_access_user_consent_dialog_permission, null /*root*/); + + if (view == null) { + throw new InflateException(); + } + + ((TextView) view.findViewById(R.id.log_access_dialog_title)) + .setText(mAlertTitle); + + if (!TextUtils.isEmpty(mAlertLearnMore)) { + Spannable mSpannableLearnMore = styleFont(mAlertLearnMore); + + ((TextView) view.findViewById(R.id.log_access_dialog_body)) + .setText(TextUtils.concat(mAlertBody, "\n\n", mSpannableLearnMore)); + + ((TextView) view.findViewById(R.id.log_access_dialog_body)) + .setMovementMethod(LinkMovementMethod.getInstance()); + } else { + ((TextView) view.findViewById(R.id.log_access_dialog_body)) + .setText(mAlertBody); + } + + Button button_allow = (Button) view.findViewById(R.id.log_access_dialog_allow_button); + button_allow.setOnClickListener(this); + + Button button_deny = (Button) view.findViewById(R.id.log_access_dialog_deny_button); + button_deny.setOnClickListener(this); + + return view; + + } + + @Override + public void onClick(View view) { + try { + 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(); + } + } + + private void declineLogAccess() { + try { + mCallback.declineAccessForClient(mUid, mPackageName); + } 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 000000000000..9c0c414011a1 --- /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 |