diff options
Diffstat (limited to 'packages/Shell')
| -rw-r--r-- | packages/Shell/res/values-eu-rES/strings.xml | 2 | ||||
| -rw-r--r-- | packages/Shell/res/values-si-rLK/strings.xml | 2 | ||||
| -rw-r--r-- | packages/Shell/src/com/android/shell/BugreportReceiver.java | 39 |
3 files changed, 29 insertions, 14 deletions
diff --git a/packages/Shell/res/values-eu-rES/strings.xml b/packages/Shell/res/values-eu-rES/strings.xml index 2904cbb..2bf91ad 100644 --- a/packages/Shell/res/values-eu-rES/strings.xml +++ b/packages/Shell/res/values-eu-rES/strings.xml @@ -20,6 +20,6 @@ <string name="bugreport_finished_title" msgid="2293711546892863898">"Programa-akatsen txostena jaso da"</string> <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"Programa-akatsen txostena partekatzeko, pasatu hatza ezkerrera"</string> <string name="bugreport_finished_text" product="default" msgid="3559904746859400732">"Programa-akatsen txostena partekatzeko, ukitu"</string> - <string name="bugreport_confirm" msgid="5130698467795669780">"Programa-akatsen txostenek sistemaren erregistro-fitxategietako datuak dauzkate, informazio pertsonala eta pribatua barne. Programa-akatsen txostenak partekatzen badituzu, partekatu soilik aplikazio eta pertsona fidagarriekin."</string> + <string name="bugreport_confirm" msgid="5130698467795669780">"Errore-txostenek sistemaren erregistro-fitxategietako datuak dauzkate, informazio pertsonala eta pribatua barne. Errore-txostenak partekatzen badituzu, partekatu soilik aplikazio eta pertsona fidagarriekin."</string> <string name="bugreport_confirm_repeat" msgid="4926842460688645058">"Erakutsi mezu hau hurrengoan"</string> </resources> diff --git a/packages/Shell/res/values-si-rLK/strings.xml b/packages/Shell/res/values-si-rLK/strings.xml index 34d7f82..1a7559b 100644 --- a/packages/Shell/res/values-si-rLK/strings.xml +++ b/packages/Shell/res/values-si-rLK/strings.xml @@ -18,7 +18,7 @@ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="app_label" msgid="3701846017049540910">"ෂෙල්"</string> <string name="bugreport_finished_title" msgid="2293711546892863898">"දෝෂ වාර්තාව ලබාගන්නා ලදි"</string> - <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"ඔබගේ දෝෂ වාර්තාව බෙදාගැනීමට වමට ස්වයිප් කරන්න"</string> + <string name="bugreport_finished_text" product="watch" msgid="8389172248433597683">"Swipe left to share your bug report"</string> <string name="bugreport_finished_text" product="default" msgid="3559904746859400732">"ඔබගේ දෝෂ වාර්තාව බෙදා ගැනීමට ස්පර්ශ කරන්න"</string> <string name="bugreport_confirm" msgid="5130698467795669780">"පුද්ගලික සහ පෞද්ගලික තොරතුරු ඇතුළත්ව පද්ධතියේ විවිධ ලොග් ගොනු වල දත්ත දෝෂ වාර්තාවේ අඩංගු වේ. ඔබට විශ්වාසවන්ත යෙදුම් සහ පුද්ගලයින් සමඟ පමණක් දෝෂ වාර්තා බෙදා ගන්න."</string> <string name="bugreport_confirm_repeat" msgid="4926842460688645058">"ඊළඟ වෙලාවේ මෙම පණිවිඩය පෙන්වන්න"</string> diff --git a/packages/Shell/src/com/android/shell/BugreportReceiver.java b/packages/Shell/src/com/android/shell/BugreportReceiver.java index 48ecaa5..b3ba895 100644 --- a/packages/Shell/src/com/android/shell/BugreportReceiver.java +++ b/packages/Shell/src/com/android/shell/BugreportReceiver.java @@ -27,6 +27,7 @@ import android.app.PendingIntent; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; +import android.content.res.Configuration; import android.net.Uri; import android.os.AsyncTask; import android.os.FileUtils; @@ -65,9 +66,35 @@ public class BugreportReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { + final Configuration conf = context.getResources().getConfiguration(); final File bugreportFile = getFileExtra(intent, EXTRA_BUGREPORT); final File screenshotFile = getFileExtra(intent, EXTRA_SCREENSHOT); + if ((conf.uiMode & Configuration.UI_MODE_TYPE_MASK) != Configuration.UI_MODE_TYPE_WATCH) { + triggerLocalNotification(context, bugreportFile, screenshotFile); + } + + // Clean up older bugreports in background + final PendingResult result = goAsync(); + new AsyncTask<Void, Void, Void>() { + @Override + protected Void doInBackground(Void... params) { + FileUtils.deleteOlderFiles( + bugreportFile.getParentFile(), MIN_KEEP_COUNT, MIN_KEEP_AGE); + result.finish(); + return null; + } + }.execute(); + } + + /** + * Responsible for triggering a notification that allows the user to start a + * "share" intent with the bug report. On watches we have other methods to allow the user to + * start this intent (usually by triggering it on another connected device); we don't need to + * display the notification in this case. + */ + private void triggerLocalNotification(final Context context, final File bugreportFile, + final File screenshotFile) { // Files are kept on private storage, so turn into Uris that we can // grant temporary permissions for. final Uri bugreportUri = FileProvider.getUriForFile(context, AUTHORITY, bugreportFile); @@ -97,18 +124,6 @@ public class BugreportReceiver extends BroadcastReceiver { com.android.internal.R.color.system_notification_accent_color)); NotificationManager.from(context).notify(TAG, 0, builder.build()); - - // Clean up older bugreports in background - final PendingResult result = goAsync(); - new AsyncTask<Void, Void, Void>() { - @Override - protected Void doInBackground(Void... params) { - FileUtils.deleteOlderFiles( - bugreportFile.getParentFile(), MIN_KEEP_COUNT, MIN_KEEP_AGE); - result.finish(); - return null; - } - }.execute(); } private static Intent buildWarningIntent(Context context, Intent sendIntent) { |
