aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeith Mok <kmok@cyngn.com>2016-06-30 23:28:43 (GMT)
committerKeith Mok <ek9852@gmail.com>2016-09-26 16:41:56 (GMT)
commitffacfa0af7ce645620b22b1cc4fac101a46ad712 (patch)
tree8d244ab09aea8da1a7e0a5860d7c1977de136fae
parent2f870ff4f7921900478a6f59307bc017e7470f07 (diff)
downloadandroid_packages_wallpapers_PhotoPhase-ffacfa0af7ce645620b22b1cc4fac101a46ad712.zip
android_packages_wallpapers_PhotoPhase-ffacfa0af7ce645620b22b1cc4fac101a46ad712.tar.gz
android_packages_wallpapers_PhotoPhase-ffacfa0af7ce645620b22b1cc4fac101a46ad712.tar.bz2
PhotoPhase: refresh after grant runtime permissions
FEIJ-1482 Change-Id: Iaaa43e078f075268800f187be551ed85fdfeb9bb (cherry picked from commit 3b6c5f9be3b355b93ac7e0fd190db9b9b517c072)
-rw-r--r--src/org/cyanogenmod/wallpapers/photophase/RequestPermissionsActivity.java11
-rw-r--r--src/org/cyanogenmod/wallpapers/photophase/TextureManager.java1
2 files changed, 12 insertions, 0 deletions
diff --git a/src/org/cyanogenmod/wallpapers/photophase/RequestPermissionsActivity.java b/src/org/cyanogenmod/wallpapers/photophase/RequestPermissionsActivity.java
index 5999d10..e600cc2 100644
--- a/src/org/cyanogenmod/wallpapers/photophase/RequestPermissionsActivity.java
+++ b/src/org/cyanogenmod/wallpapers/photophase/RequestPermissionsActivity.java
@@ -5,10 +5,13 @@ import android.annotation.NonNull;
import android.annotation.Nullable;
import android.app.Activity;
import android.content.Context;
+import android.content.Intent;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.widget.Toast;
+import org.cyanogenmod.wallpapers.photophase.preferences.PreferencesProvider;
+
public class RequestPermissionsActivity extends Activity {
public static final int REQUEST_STORAGE_PERMISSION = 1;
@@ -34,6 +37,14 @@ public class RequestPermissionsActivity extends Activity {
// If request is cancelled, the result arrays are empty.
if (grantResults.length > 0
&& grantResults[0] == PackageManager.PERMISSION_GRANTED) {
+
+ Intent intent = new Intent(PreferencesProvider.ACTION_SETTINGS_CHANGED);
+ intent.putExtra(PreferencesProvider.EXTRA_FLAG_REDRAW, Boolean.TRUE);
+ intent.putExtra(PreferencesProvider.EXTRA_FLAG_RECREATE_WORLD, Boolean.TRUE);
+ intent.putExtra(PreferencesProvider.EXTRA_FLAG_MEDIA_RELOAD, Boolean.TRUE);
+ intent.putExtra(PreferencesProvider.EXTRA_ACTION_MEDIA_USER_RELOAD_REQUEST,
+ Boolean.FALSE);
+ sendBroadcast(intent);
setResult(Activity.RESULT_OK);
} else {
Toast.makeText(this, R.string.runtime_permission_warning, Toast.LENGTH_SHORT)
diff --git a/src/org/cyanogenmod/wallpapers/photophase/TextureManager.java b/src/org/cyanogenmod/wallpapers/photophase/TextureManager.java
index 3c3ad78..de3d645 100644
--- a/src/org/cyanogenmod/wallpapers/photophase/TextureManager.java
+++ b/src/org/cyanogenmod/wallpapers/photophase/TextureManager.java
@@ -230,6 +230,7 @@ public class TextureManager implements OnMediaPictureDiscoveredListener {
* @param userRequest If the request was generated by the user
*/
void reloadMedia(final boolean userRequest) {
+ mStatus = 0; // Loading
Log.d(TAG, "Reload media picture data");
// Discovery new media
// GLThread doesn't run in the UI thread and AsyncThread can't create a