• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#objective-cqtwindows誰得cocoapythonphprubygameguibathyscaphec翻訳omegat計画中(planning stage)frameworktwittertestdomvb.netdirectxbtronarduinopreviewerゲームエンジン

packages/apps/Gallery2


Commit MetaInfo

修订版56da2b67a5099afea2f1fceb0257aafdbf6236e0 (tree)
时间2019-01-23 08:31:38
作者Raman Tenneti <rtenneti@goog...>
Commiterandroid-build-merger

Log Message

Merge "app/Gallery2/Gallery2.apk app - update the version to target P (28) or higher. Use JobIntentService to start the AsyncService."
am: 5c232b2f41

Change-Id: I71aa836e07bdf33e13ea0df421da2594561b4558

更改概述

差异

--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -7,7 +7,7 @@
77
88 <original-package android:name="com.android.gallery3d" />
99
10- <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="24" />
10+ <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="28" />
1111
1212 <permission android:name="com.android.gallery3d.permission.GALLERY_PROVIDER"
1313 android:protectionLevel="signatureOrSystem" />
@@ -324,7 +324,9 @@
324324 <data android:scheme="package"/>
325325 </intent-filter>
326326 </receiver>
327- <service android:name="com.android.gallery3d.app.PackagesMonitor$AsyncService"/>
327+ <service android:name="com.android.gallery3d.app.PackagesMonitor$AsyncService"
328+ android:permission="android.permission.BIND_JOB_SERVICE"
329+ android:exported="true"/>
328330 <service android:name="com.android.gallery3d.gadget.WidgetService"
329331 android:permission="android.permission.BIND_REMOTEVIEWS"/>
330332 <activity android:name="com.android.gallery3d.gadget.WidgetConfigure"
--- a/proguard.flags
+++ b/proguard.flags
@@ -47,6 +47,9 @@
4747 -keep interface com.actionbarsherlock.** { *; }
4848 -keepattributes *Annotation*
4949
50+# Required for JobIntentService
51+-keep class androidx.core.app.CoreComponentFactory { *; }
52+
5053 # Required for mp4parser
5154 -keep public class * implements com.coremedia.iso.boxes.Box
5255
--- a/src/com/android/gallery3d/app/PackagesMonitor.java
+++ b/src/com/android/gallery3d/app/PackagesMonitor.java
@@ -22,6 +22,7 @@ import android.content.Context;
2222 import android.content.Intent;
2323 import android.content.SharedPreferences;
2424 import android.preference.PreferenceManager;
25+import androidx.core.app.JobIntentService;
2526
2627 import com.android.gallery3d.picasasource.PicasaSource;
2728 import com.android.gallery3d.util.LightCycleHelper;
@@ -37,16 +38,18 @@ public class PackagesMonitor extends BroadcastReceiver {
3738 @Override
3839 public void onReceive(final Context context, final Intent intent) {
3940 intent.setClass(context, AsyncService.class);
40- context.startService(intent);
41+ AsyncService.enqueueWork(context, intent);
4142 }
4243
43- public static class AsyncService extends IntentService {
44- public AsyncService() {
45- super("GalleryPackagesMonitorAsync");
44+ public static class AsyncService extends JobIntentService {
45+ public static final int JOB_ID = 1;
46+
47+ public static void enqueueWork(Context context, Intent work) {
48+ enqueueWork(context, AsyncService.class, JOB_ID, work);
4649 }
4750
4851 @Override
49- protected void onHandleIntent(Intent intent) {
52+ protected void onHandleWork(Intent intent) {
5053 onReceiveAsync(this, intent);
5154 }
5255 }